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

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

[elpa] externals/org b02f1ea: oc: Allow citations following an item bull


From: ELPA Syncer
Subject: [elpa] externals/org b02f1ea: oc: Allow citations following an item bullet
Date: Sat, 18 Sep 2021 01:57:16 -0400 (EDT)

branch: externals/org
commit b02f1eae19049dfb3e7e3815fae98844aa008421
Author: TEC <tec@tecosaur.com>
Commit: TEC <tec@tecosaur.com>

    oc: Allow citations following an item bullet
    
    * lisp/oc.el (org-cite--allowed-p): Expand the allowed cases to include
    "item", which lets one insert a citation following a bullet, e.g. "- ".
    We just have to check to make sure the citation actually is at least one
    character away from the bullet, or five if a checkbox is present.
---
 lisp/oc.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/oc.el b/lisp/oc.el
index 5fcb9da..8948f3a 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -1420,6 +1420,12 @@ ARG is the prefix argument received when calling 
`org-open-at-point', or nil."
                          (skip-chars-backward " \r\t\n")
                          (if (eq (org-element-class context) 'object) (point)
                            (line-beginning-position 2)))))
+     ;; At the start of a list item is fine, as long as the bullet is 
unaffected.
+     ((eq type 'item)
+      (> (point) (+ (org-element-property :begin context)
+                    (org-get-indentation)
+                    (if (org-element-property :checkbox context)
+                        5 1))))
      ;; Other elements are invalid.
      ((eq (org-element-class context) 'element) nil)
      ;; Just before object is fine.



reply via email to

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