From 5e26d9849a79bf78fda821979fc937f7e5e6df52 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Sun, 25 May 2014 19:40:54 +0200 Subject: [PATCH] Improve reftex-format-special * lisp/textmodes/reftex-ref.el (reftex-format-special): Make it work also for AMS Math's \eqref macro. --- lisp/ChangeLog | 5 +++++ lisp/textmodes/reftex-ref.el | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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 -- 2.39.2