emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org 99cc9619c5: org-bibtex-yank: Fix bibtex par


From: ELPA Syncer
Subject: [elpa] externals-release/org 99cc9619c5: org-bibtex-yank: Fix bibtex parser not initialized in temp buffer
Date: Sun, 13 Aug 2023 12:58:16 -0400 (EDT)

branch: externals-release/org
commit 99cc9619c562b5c21a292dec7351d05df37d39fd
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-bibtex-yank: Fix bibtex parser not initialized in temp buffer
    
    * lisp/ol-bibtex.el (org-bibtex-yank): Make sure that we parse bibtex
    entry from the kill ring in a `bibtex-mode' buffer.  Otherwise,
    calling `org-bibtex-read' (that calls `bibtex-parse-entry') may err
    because some Bibtex parser variables are not initialized.
    
    Reported-by: J. G. <jerzor@pacbell.net>
    Link: 
https://orgmode.org/list/1939460027.3272000.1691771671040@mail.yahoo.com
---
 lisp/ol-bibtex.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el
index fd9517233e..a16a4b3927 100644
--- a/lisp/ol-bibtex.el
+++ b/lisp/ol-bibtex.el
@@ -761,7 +761,10 @@ drawer."
   "If kill ring holds a bibtex entry yank it as an Org headline."
   (interactive)
   (let (entry)
-    (with-temp-buffer (yank 1) (setf entry (org-bibtex-read)))
+    (with-temp-buffer
+      (yank 1)
+      (bibtex-mode)
+      (setf entry (org-bibtex-read)))
     (if entry
        (org-bibtex-write)
       (error "Yanked text does not appear to contain a BibTeX entry"))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]