auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] Changes to reftex/lisp/reftex-ref.el,v


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to reftex/lisp/reftex-ref.el,v
Date: Sun, 30 Nov 2008 22:13:21 +0000

CVSROOT:        /sources/auctex
Module name:    reftex
Changes by:     Ralf Angeli <angeli>    08/11/30 22:13:21

Index: reftex-ref.el
===================================================================
RCS file: /sources/auctex/reftex/lisp/reftex-ref.el,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- reftex-ref.el       15 Oct 2008 16:27:57 -0000      1.36
+++ reftex-ref.el       30 Nov 2008 22:13:20 -0000      1.37
@@ -433,8 +433,10 @@
          (progn
            ;; Build a temporary list which handles more easily.
            (dolist (elt reftex-ref-style-alist)
-             (when (member (nth 1 elt) reftex-ref-style-active-list)
-               (add-to-list 'style-alist (cons (nth 3 elt) (car elt)) t)))
+             (when (member (car elt) reftex-ref-style-active-list)
+               (mapc (lambda (x)
+                       (add-to-list 'style-alist (cons (cadr x) (car x)) t))
+                     (nth 2 elt))))
            ;; Prompt the user for the macro.
            (let ((key (reftex-select-with-char
                        "" (concat "SELECT A REFERENCE FORMAT\n\n"
@@ -444,18 +446,16 @@
                                              (if (> (car x) 31) " " "")
                                              (cdr x)))
                                    style-alist "\n")))))
-             (setq refstyle (cdr (assq key style-alist)))
+             (setq refstyle (cdr (assoc key style-alist)))
              (unless refstyle
                (error "No reference macro associated with key `%c'" key))))
        ;; Get the first macro from `reftex-ref-style-alist' which
        ;; matches the first entry in `reftex-ref-style-active-list'.
        (setq refstyle
-             (catch 'found
-               (dolist (elt reftex-ref-style-alist)
-                 (when (equal (nth 1 elt) (car reftex-ref-style-active-list))
-                   (throw 'found (car elt))))
+             (or (caar (nth 2 (assoc (car reftex-ref-style-active-list)
+                                     reftex-ref-style-alist)))
                ;; Use the first entry in r-r-s-a as a last resort.
-               (caar reftex-ref-style-alist)))))
+                 (caar (nth 2 (car reftex-ref-style-alist)))))))
 
     (unless type
       ;; Guess type from context
@@ -823,9 +823,10 @@
 ;; macros.  The functions are named `reftex-<package>-<macro>',
 ;; e.g. `reftex-varioref-vref'.
 (dolist (elt reftex-ref-style-alist)
-  (when (stringp (nth 2 elt))
-    (let ((macro (car elt))
-         (package (nth 2 elt)))
+  (when (stringp (nth 1 elt))
+    (dolist (item (nth 2 elt))
+      (let ((macro (car item))
+           (package (nth 1 elt)))
       (eval `(defun ,(intern (format "reftex-%s-%s" package
                                     (substring macro 1 (length macro)))) ()
               ,(format "Insert a reference using the `%s' macro from the %s \
@@ -833,7 +834,7 @@
                      macro package)
               (interactive)
               (let ((refstyle ,macro))
-                (reftex-reference)))))))
+                  (reftex-reference))))))))
 
 (defun reftex-format-special (label fmt refstyle)
   "Apply selected reference style to format FMT and add LABEL.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]