what are the requirements for this macro? (still using 11.87)
/Lars Madsen Institut for Matematik / Department of Mathematics Aarhus Universitet / Aarhus University Mere info: http://au.dk/daleif@imf / More information: http://au.dk/en/daleif@imf ________________________________________ From: [email protected] [[email protected]] on behalf of Tamas Papp [[email protected]] Sent: 01 December 2014 19:06 To: auctex Subject: [AUCTeX] toggle environments with and without * Hi, I was trying to come up with a way to quickly switch between environment pairs with and without an asterisk (eg equation and equation*). My attempt is below, it works, but I was wondering if I am overcomplicating this and maybe there is a simpler way. Also, can someone suggest a way to comment and uncomment lines which start with \label? --8<---------------cut here---------------start------------->8--- (defun LaTeX-toggle-* () "Toggle between forms of the current environment with or without * at the end." (interactive) (let* ((environment (LaTeX-current-environment))) (when environment (let* ((l (length environment)) (*-p (and (cl-plusp l) (eql (aref environment (1- l)) ?*))) (bare-environment (if *-p (subseq environment 0 (1- l)) environment))) (cl-assert (cl-plusp (length bare-environment)) () "Empty environment ~S" bare-environment) (when (or (not LaTeX-toggle-*-environments) (cl-find bare-environment font-latex-math-environments :test #'equal)) (LaTeX-modify-environment (if *-p bare-environment (concat bare-environment "*")))))))) --8<---------------cut here---------------end--------------->8--- Best, Tamas _______________________________________________ auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex _______________________________________________ auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex
