From 7543da991f696489d182a59f49d9a165ccee0dab Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 5 Feb 2022 19:06:45 +0800 Subject: [PATCH] org-bibtex-read: Fix regression from f7d6db1bf * lisp/ol-bibtex.el (org-bibtex-read): Make sure that the return value is the updated `org-bibtex-entries'. Document the return value requirement. The assumption about the return value is used by `org-bibtex-yank'. Fixes https://list.orgmode.org/86zgn689m5.fsf@krailli2.fritz.box/T/#u --- lisp/ol-bibtex.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el index 218f8f17e..81b99167b 100644 --- a/lisp/ol-bibtex.el +++ b/lisp/ol-bibtex.el @@ -655,7 +655,8 @@ With a prefix arg, query for optional fields." (defun org-bibtex-read () "Read a bibtex entry and save to `org-bibtex-entries'. -This uses `bibtex-parse-entry'." +This uses `bibtex-parse-entry'. +Return the new value of `org-bibtex-entries'." (interactive) (let ((keyword (lambda (str) (intern (concat ":" (downcase str))))) (clean-space (lambda (str) (replace-regexp-in-string @@ -678,7 +679,8 @@ This uses `bibtex-parse-entry'." (funcall clean-space (funcall strip-delim (cdr pair))))) (save-excursion (bibtex-beginning-of-entry) (bibtex-parse-entry))) org-bibtex-entries) - (unless (car org-bibtex-entries) (pop org-bibtex-entries)))) + (unless (car org-bibtex-entries) (pop org-bibtex-entries)) + org-bibtex-entries)) (defun org-bibtex-read-buffer (buffer) "Read all bibtex entries in BUFFER and save to `org-bibtex-entries'.