Bad formulation, meant to say not as a first approximation to a macro.
/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 Lars Madsen [[email protected]] Sent: 16 February 2015 10:26 To: Tassilo Horn; [email protected] Subject: Re: [AUCTeX] Modify environments interactively Not as a first env I was thinking more on the lines of \begin{foo} \begin{bar} cursor \end{bar} \end{foo} then some macro would transform this into \begin{foo} cursor \end{foo} i.e. if the env to be deleted is on lines of their own, then those lines are removed. BTW: I haven't switched to 11.88 yet, was hooks added to LaTeX-modify-environment? AFAIR we can add environment hooks to C-c C-e but not to C-u C-c C-e (I think someone mentioned at one point that that should be added as well. Why is this needed: I add cleanup hooks to certain envs, so if I mark a region and insert an env around it, then it clean up the contents. But at least with 11.87 no such hook fires if you change an env. An example of such a cleaner is for a hint env, used in exercises to make sure all hints are formatted the same way. Authors often forget this, thus the text is often Hint: Blah blah... My clean up hook here removes the 'Hint: ' /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 Tassilo Horn [[email protected]] Sent: 16 February 2015 07:56 To: [email protected] Subject: Re: [AUCTeX] Modify environments interactively Igor Sosa Mayor <[email protected]> writes: >> related, is there a build in feature for deleting a given env? >> >> This is sometimes handy when editing other peoples work. (some people >> are very messy) > > this would be a good idea... I guess doing `C-u C-c C-e' and then deleting the environment name could do that, i.e., modifying an environment so that is has an empty name. But there's no good way to delete an environment. I mean, deleting the \begin/\end is easy, but you'd probably also want to delete its \items in case its an enumerate/itemize, etc. Bye, Tassilo _______________________________________________ auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex _______________________________________________ auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex _______________________________________________ auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex
