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

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

[elpa] externals-release/org 308f4cb 1/2: oc: Ensure activation returns


From: ELPA Syncer
Subject: [elpa] externals-release/org 308f4cb 1/2: oc: Ensure activation returns a non-nil value
Date: Wed, 24 Nov 2021 16:57:22 -0500 (EST)

branch: externals-release/org
commit 308f4cb57054c3e8a14e4843bf9a95b4d806446b
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>

    oc: Ensure activation returns a non-nil value
    
    * lisp/oc.el (org-cite-activate): Return a non-nil value when
    successful, even if citation processor doesn't.
---
 lisp/oc.el | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/lisp/oc.el b/lisp/oc.el
index 41fd688..a8cd6c3 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -1163,16 +1163,20 @@ DATUM is a citation object, or a citation reference.  
In any case, apply
   "Activate citations from up to LIMIT buffer position.
 Each citation encountered is activated using the appropriate function
 from the processor set in `org-cite-activate-processor'."
-  (let ((name org-cite-activate-processor))
-    (let ((activate
-           (or (and name
-                    (org-cite-processor-has-capability-p name 'activate)
-                    (org-cite-processor-activate (org-cite--get-processor 
name)))
-               #'org-cite-fontify-default)))
-      (while (re-search-forward org-element-citation-prefix-re limit t)
-        (let ((cite (org-with-point-at (match-beginning 0)
-                      (org-element-citation-parser))))
-          (when cite (save-excursion (funcall activate cite))))))))
+  (let* ((name org-cite-activate-processor)
+         (activate
+          (or (and name
+                   (org-cite-processor-has-capability-p name 'activate)
+                   (org-cite-processor-activate (org-cite--get-processor 
name)))
+              #'org-cite-fontify-default)))
+    (when (re-search-forward org-element-citation-prefix-re limit t)
+      (let ((cite (org-with-point-at (match-beginning 0)
+                    (org-element-citation-parser))))
+        (when cite
+          (funcall activate cite)
+          ;; Move after cite object and make sure to return
+          ;; a non-nil value.
+          (goto-char (org-element-property :end cite)))))))
 
 
 ;;; Internal interface with Org Export library (export capability)



reply via email to

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