|
From: | Ivan Andrus |
Subject: | Re: [AUCTeX] auto-fill and tabular environments |
Date: | Sat, 20 Nov 2010 00:00:15 +0100 |
On Nov 17, 2010, at 5:15 PM, Brett Presnell wrote:
Yes, there is always a way. :-)
If you haven't already gotten a better solution, I have tweaked the following from my .emacs (without proper testing). Needless to say, it could be much smarter, but you can of course change it to be whatever you need. (defvar LaTeX-no-auto-fill-environments (mapcar 'car LaTeX-indent-environment-list) "List of LaTeX environments to suppress auto-fill.") (defun auto-preview-auto-fill-function () "Run `do-auto-fill' based on current mode. Will run `do-auto-fill' to provide auto-filling of current line unless the current LaTeX environment is a member of `LaTeX-no-auto-fill-environments'. For use as `auto-fill-function'." (unless (member (LaTeX-current-environment) LaTeX-no-auto-fill-environments) (do-auto-fill))) ;; And then in your LaTeX-mode-hook add (setq auto-fill-function 'auto-preview-auto-fill-function)
I believe save-excursion is what you want. It evaluates the body and then returns point to "where it was before": (defun LaTeX-align-current-environment () (interactive) (save-excursion (LaTeX-mark-environment) (align-current))) -Ivan Andrus |
[Prev in Thread] | Current Thread | [Next in Thread] |