> Uwe Brauer <[email protected]> writes: > Personally, I have the following in my .emacs file:
> (defun TeXlive (year) > "Use TeXlive with the given year (given as string), nil if no TeXlive." > (interactive > (let* ((year > (directory-files "/usr/local/texlive/" nil "\\`[0-9]+\\'"))) > (setq year > (completing-read (format "Year to use (default %s): " > (car (last year))) > (cons "none" year) > nil t nil nil (car (last year)))) > (list (unless (string= year "none") year)))) > (let ((path (getenv "PATH"))) > (while (string-match "/usr/local/texlive/[0-9]+/bin/[^:/]*:" path) > (setq path (replace-match "" t t path))) > (when year > (let* ((dir (format "/usr/local/texlive/%s/bin" year)) > (defs (directory-files dir nil "\\`[-a-zA-Z0-9_]+\\'")) > (arch (cond ((null defs) (error "No architectures in %s" dir)) > ((null (cdr defs)) (car defs)) > (t > (completing-read "Architecture? " defs nil t nil nil > defs))))) > (setq path (concat dir "/" arch ":" path)))) > (setenv "PATH" path))) > I call it as > M-x TeXlive RET Thanks very much, that looks very nifty. -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
smime.p7s
Description: S/MIME cryptographic signature
