diff options
| author | Ihor Radchenko <yantar92@posteo.net> | 2023-12-24 12:18:52 +0100 |
|---|---|---|
| committer | Ihor Radchenko <yantar92@posteo.net> | 2023-12-24 12:18:52 +0100 |
| commit | cee9b6abc687207e5e1b0243772627683b57c6b2 (patch) | |
| tree | ca5da055b4ae2c97def37e7c245459411f3bd329 | |
| parent | a64b779cbef8fdedcdd030ac781f92886a700e0c (diff) | |
| download | org-mode-cee9b6abc.tar.gz | |
Revert "lisp/oc.el (org-cite-parse-elements): Use org-mode buffer for parsing"
This reverts commit 36f61a9c8b8d15335f5cb2cd7a627ad5d7103956.
Because of complex dependencies, it is not easy to properly "require"
`org-element-with-buffer-copy' in oc.el. So, reverting for now.
| -rw-r--r-- | lisp/oc.el | 25 |
1 files changed, 8 insertions, 17 deletions
@@ -1162,23 +1162,14 @@ the same object, call `org-cite-adjust-note' first." The return value is suitable as a replacement for a \"print_bibliography\" keyword. As a consequence, the function raises an error if S contains a headline." - (org-element-with-buffer-copy - :to-buffer (org-get-buffer-create " *Org parse*" t) - :drop-contents t - :drop-visibility t - :drop-narrowing t - :drop-locals t - ;; Transferring local variables may put the temporary buffer - ;; into a read-only state. Make sure we can insert STRING. - (let ((inhibit-read-only t)) (erase-buffer) (insert s)) - ;; Prevent "Buffer *temp* modified; kill anyway?". - (restore-buffer-modified-p nil) - (pcase (org-element-contents (org-element-parse-buffer)) - ('nil nil) - (`(,(and section (guard (org-element-type-p section 'section)))) - (org-element-contents section)) - (_ - (error "Headlines cannot replace a keyword"))))) + (with-temp-buffer + (insert s) + (pcase (org-element-contents (org-element-parse-buffer)) + ('nil nil) + (`(,(and section (guard (org-element-type-p section 'section)))) + (org-element-contents section)) + (_ + (error "Headlines cannot replace a keyword"))))) (defun org-cite-parse-objects (s &optional affix) "Parse string S as a secondary string. |
