X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=doi-utils.el;h=fa79d577f7e7db972ed98d4cc70e2c8477ec029f;hp=a0af934848d07bb6ec133d9870c1cef5bca05d33;hb=107f7d826250fa9a511bebb5ac4c14ace7c5dc90;hpb=f6a6ac450ac52f98255ef184800775a2163414b7 diff --git a/doi-utils.el b/doi-utils.el index a0af934..fa79d57 100644 --- a/doi-utils.el +++ b/doi-utils.el @@ -555,15 +555,16 @@ prompt. Otherwise, you have to type or pste in a DOI." ;; Wrap in save-window-excursion to restore your window arrangement after this ;; is done. (save-window-excursion - (find-file bibfile) - ;; Check if the doi already exists - (goto-char (point-min)) - (if (search-forward doi nil t) - (message "%s is already in this file" doi) - (end-of-buffer) - (insert "\n\n") - (doi-utils-insert-bibtex-entry-from-doi doi) - (save-buffer)))) + (with-current-buffer + (find-file-noselect bibfile) + ;; Check if the doi already exists + (goto-char (point-min)) + (if (search-forward doi nil t) + (message "%s is already in this file" doi) + (end-of-buffer) + (insert "\n\n") + (doi-utils-insert-bibtex-entry-from-doi doi) + (save-buffer))))) ;; * Updating bibtex entries @@ -603,7 +604,7 @@ Optional argument NODELIM see `bibtex-make-field'." (defun plist-get-keys (plist) "Return keys in a PLIST." - (loop + (cl-loop for key in results by #'cddr collect key)) (defun doi-utils-update-bibtex-entry-from-doi (doi)