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

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

[elpa] externals/org 3d1f4e0af0 2/2: org-cite-insert: Allow citations at


From: ELPA Syncer
Subject: [elpa] externals/org 3d1f4e0af0 2/2: org-cite-insert: Allow citations at the beginning of empty heading
Date: Wed, 19 Oct 2022 23:57:58 -0400 (EDT)

branch: externals/org
commit 3d1f4e0af0d98c57b720b9090e3a28fbffccafdf
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-cite-insert: Allow citations at the beginning of empty heading
    
    * lisp/oc.el (org-cite--allowed-p): When heading is empty, allow
    to insert citations after priority/todo/stars.
    
    Reported-by: Scott Otterson <scotto@sharpleaf.org>
    Link: 
https://orgmode.org/list/CAPY3P0TBuoU2AJX78Qi2FevGuCx6KW1YSoSGQQZrzusTiuphRA@mail.gmail.com
---
 lisp/oc.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/oc.el b/lisp/oc.el
index 4d37601db7..78fd7c3d22 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -1507,8 +1507,15 @@ CONTEXT is the element or object at point, as returned 
by `org-element-context'.
                        (not (looking-at-p "\\*+ END[ \t]*$")))
                      (let ((case-fold-search nil))
                        (looking-at org-complex-heading-regexp))))
-              (match-beginning 4)
-              (>= (point) (match-beginning 4))
+              (>= (point) (or
+                           ;; Real heading.
+                           (match-beginning 4)
+                           ;; If no heading, end of priority.
+                           (match-end 3)
+                           ;; ... end of todo keyword.
+                           (match-end 2)
+                           ;; ... after stars.
+                           (1+ (match-end 1))))
               (or (not (match-beginning 5))
                   (< (point) (match-beginning 5))))))
      ;; White spaces after an object or blank lines after an element



reply via email to

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