X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=doi-utils.el;h=fa79d577f7e7db972ed98d4cc70e2c8477ec029f;hp=e3e8b94cb86866433ee5b95c46033912835fa22f;hb=107f7d826250fa9a511bebb5ac4c14ace7c5dc90;hpb=a28522b48c126dba09e182ae3a790bc2f94f56ba diff --git a/doi-utils.el b/doi-utils.el index e3e8b94..fa79d57 100644 --- a/doi-utils.el +++ b/doi-utils.el @@ -530,7 +530,7 @@ prompt. If no region is selected and the first entry of the kill-ring starts like a DOI, then that is the intial prompt. Otherwise, you have to type or pste in a DOI." (interactive - (list (read-input "DOI: " + (list (read-string "DOI: " ;; now set initial input (cond ;; If region is active and it starts like a doi we want it. @@ -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) @@ -917,7 +918,7 @@ error." (defun doi-utils-add-entry-from-crossref-query (query bibtex-file) "Search Crossref with QUERY and use helm to select an entry to add to BIBTEX-FILE." (interactive (list - (read-input + (read-string "Query: " ;; now set initial input (cond