branch: externals/auctex commit 39badf048916c309437f37dbfb5c9d6ba5bf4801 Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
New defcustom LaTeX-fill-excluded-macros * latex.el (LaTeX-fill-excluded-macros): New defcustom for excluding macro arguments from filling. (LaTeX-fill-region-as-paragraph): Use it. --- ChangeLog | 6 ++++++ latex.el | 7 +++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index e81c6bb..de66ef6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-03-03 Tassilo Horn <t...@gnu.org> + + * latex.el (LaTeX-fill-excluded-macros): New defcustom for + excluding macro arguments from filling. + (LaTeX-fill-region-as-paragraph): Use it. + 2015-03-02 Tassilo Horn <t...@gnu.org> * font-latex.el (font-latex-match-command-with-arguments): Fix diff --git a/latex.el b/latex.el index 9c2646f..fc5ebdb 100644 --- a/latex.el +++ b/latex.el @@ -3353,6 +3353,12 @@ does not fit into the line." :group 'LaTeX :type 'boolean) +(defcustom LaTeX-fill-excluded-macros nil + "List of macro names (without leading \\) whose arguments must +not be subject to filling." + :group 'LaTeX + :type '(repeat string)) + (defvar LaTeX-nospace-between-char-regexp (if (featurep 'xemacs) (if (and (boundp 'word-across-newline) word-across-newline) @@ -3379,6 +3385,7 @@ pass args FROM, TO and JUSTIFY-FLAG." (interactive "*r\nP") (let ((end-marker (save-excursion (goto-char to) (point-marker)))) (if (or (assoc (LaTeX-current-environment) LaTeX-indent-environment-list) + (member (TeX-current-macro) LaTeX-fill-excluded-macros) ;; This could be generalized, if there are more cases where ;; a special string at the start of a region to fill should ;; inhibit filling.