]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve reftex-format-special
authorTassilo Horn <tsdh@gnu.org>
Sun, 25 May 2014 17:40:54 +0000 (19:40 +0200)
committerTassilo Horn <tsdh@gnu.org>
Sun, 25 May 2014 17:40:54 +0000 (19:40 +0200)
* lisp/textmodes/reftex-ref.el (reftex-format-special): Make it work
also for AMS Math's \eqref macro.

lisp/ChangeLog
lisp/textmodes/reftex-ref.el

index 43ff5e8547494c9e989a205ad64db4b1413a5636..78dcac1399ee4213edcf6745fe83f38729eec398 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-25  Tassilo Horn  <tsdh@gnu.org>
+
+       * textmodes/reftex-ref.el (reftex-format-special): Make it work
+       also for AMS Math's \eqref macro.
+
 2014-05-25  Thien-Thi Nguyen  <ttn@gnu.org>
 
        Arrange to never byte-compile the generated -pkg.el file.
index 7b48c8a62c2280b90d1e66b8e4b76f7a37cf9de2..ac01b6852ec5d8ca235ebd1d379963fb1a1a9932 100644 (file)
@@ -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