From: Tassilo Horn Date: Sun, 25 May 2014 17:40:54 +0000 (+0200) Subject: Improve reftex-format-special X-Git-Tag: emacs-25.0.90~2612^2~709^2~886 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5e26d9849a79bf78fda821979fc937f7e5e6df52;p=emacs.git Improve reftex-format-special * lisp/textmodes/reftex-ref.el (reftex-format-special): Make it work also for AMS Math's \eqref macro. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 43ff5e85474..78dcac1399e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-05-25 Tassilo Horn + + * textmodes/reftex-ref.el (reftex-format-special): Make it work + also for AMS Math's \eqref macro. + 2014-05-25 Thien-Thi Nguyen Arrange to never byte-compile the generated -pkg.el file. diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 7b48c8a62c2..ac01b6852ec 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -840,8 +840,11 @@ package.\n\nThis is a generated function." Replace any occurrences of \"\\ref\" with REFSTYLE." ;; Replace instances of \ref in `fmt' with the special reference ;; style selected by the user. - (while (string-match "\\(\\\\ref\\)[ \t]*{" fmt) - (setq fmt (replace-match refstyle t t fmt 1))) + (cond + ((while (string-match "\\(\\\\ref\\)[ \t]*{" fmt) + (setq fmt (replace-match refstyle t t fmt 1)))) + ((string-match "\\(\\\\[[:alpha:]]+\\)[ \t]*{" fmt) + (setq fmt (replace-match refstyle t t fmt 1)))) (format fmt label)) ;;;###autoload