]> git.donarmstrong.com Git - org-ref.git/commitdiff
modify find key in file
authorJohn Kitchin <jkitchin@andrew.cmu.edu>
Fri, 20 Feb 2015 01:43:40 +0000 (20:43 -0500)
committerJohn Kitchin <jkitchin@andrew.cmu.edu>
Fri, 20 Feb 2015 01:43:40 +0000 (20:43 -0500)
this seems to fix a long-standing issue when you add new references that do not get recognized.

org-ref.org

index 79480c19a06704a503314c56d1e668f3ee502cc9..bf6c7a45ae213aa33b5c08cbc64fde239392e2a5 100644 (file)
@@ -1716,6 +1716,13 @@ Now, we can see if an entry is in a file.
   (interactive "skey: \nsFile: ")
   (save-current-buffer
     (let ((bibtex-files (list filename)))
+      ;; This is something I am trying because when the bibtex file is open, and
+      ;; you have added to it, the only way I find to get the update to update
+      ;; is to close it and reopen it. or to save it and revert it.
+      (when (get-file-buffer filename)
+       (set-buffer (get-file-buffer filename))
+       (save-buffer)
+       (revert-buffer t t))
       (bibtex-search-entry key t))))
 #+END_SRC
 
@@ -3522,6 +3529,7 @@ This code provides a helm interface to things you can do when you click on a cit
            (org-ref-bib-citation)))
       "!!! No entry found !!!" )))
 
+
 (defun org-ref-cite-candidates ()
   "Generate the list of possible candidates for click actions on a cite link.
 Checks for pdf and doi, and add appropriate functions."