]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/reftex-ref.el
Update copyright year to 2015
[gnu-emacs] / lisp / textmodes / reftex-ref.el
index 7b48c8a62c2280b90d1e66b8e4b76f7a37cf9de2..be119d9db58682ba15714cd4ad27be431f6babc5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; reftex-ref.el --- code to create labels and references with RefTeX
 
-;; Copyright (C) 1997-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2015 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -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