]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix reftex-citation bug
authorTassilo Horn <tsdh@gnu.org>
Wed, 22 Apr 2015 07:24:54 +0000 (09:24 +0200)
committerTassilo Horn <tsdh@gnu.org>
Wed, 22 Apr 2015 07:25:54 +0000 (09:25 +0200)
* reftex-cite.el (reftex-extract-bib-entries): Fix
`wrong-type-argument stringp nil' error that occurs when AUCTeX
integration is enabled and there are no citations in the document
so far.

lisp/textmodes/reftex-cite.el

index fa09efb64a4f01e0add7628408b61077058708ab..b22e8b1dcc0a7429566ba3ac201a0b85325d80e4 100644 (file)
@@ -197,7 +197,7 @@ Return list with entries."
              "[" default "]: ")
             (if reftex-mode
                 (if (fboundp 'LaTeX-bibitem-list)
-                    (LaTeX-bibitem-list)
+                    (or (LaTeX-bibitem-list) '(""))
                   (cdr (assoc 'bibview-cache
                               (symbol-value reftex-docstruct-symbol))))
               nil)
@@ -228,11 +228,11 @@ Return list with entries."
               (message "No such BibTeX file %s (ignored)" buffer)
             (message "Scanning bibliography database %s" buffer1)
            (unless (verify-visited-file-modtime buffer1)
-                (when (y-or-n-p
-                       (format "File %s changed on disk.  Reread from disk? "
-                               (file-name-nondirectory
-                                (buffer-file-name buffer1))))
-                  (with-current-buffer buffer1 (revert-buffer t t)))))
+              (when (y-or-n-p
+                     (format "File %s changed on disk.  Reread from disk? "
+                             (file-name-nondirectory
+                              (buffer-file-name buffer1))))
+                (with-current-buffer buffer1 (revert-buffer t t)))))
 
           (set-buffer buffer1)
           (reftex-with-special-syntax-for-bib