aboutsummaryrefslogtreecommitdiffstats
path: root/oni-org
diff options
context:
space:
mode:
authorGravatar Tom Willemse2022-04-01 18:39:47 -0700
committerGravatar Tom Willemse2022-04-01 18:39:47 -0700
commit64fee97d35fc1cd619c55b1085ea0d185e4bc01e (patch)
tree5f8a62f514c8c0b48f4c78ff6b27d7cb78434ae4 /oni-org
parent641f7364785a19327195251595634b32827ef1df (diff)
downloademacs-config-64fee97d35fc1cd619c55b1085ea0d185e4bc01e.tar.gz
emacs-config-64fee97d35fc1cd619c55b1085ea0d185e4bc01e.zip
[oni-org] Add support for id: backlinks in oni-backlinks dblock
Diffstat (limited to 'oni-org')
-rw-r--r--oni-org/oni-org.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el
index 6bdf04c..93c19ca 100644
--- a/oni-org/oni-org.el
+++ b/oni-org/oni-org.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2022.0315.220855
+;; Version: 2022.0401.183938
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti mixed-pitch)
;; This program is free software; you can redistribute it and/or modify
@@ -332,7 +332,9 @@ _di_: Add inlineimages STARTUP
(defun oni-org-dblock-write-backlinks (_params)
"Generate backlinks to org headings."
(let ((current-heading (nth 4 (org-heading-components)))
- (current-heading-id (alist-get "CUSTOM_ID" (org-entry-properties) nil nil #'string=))
+ (current-heading-id
+ (or (alist-get "CUSTOM_ID" (org-entry-properties) nil nil #'string=)
+ (org-id-get)))
backlinks)
(save-excursion
(goto-char (point-min))
@@ -344,7 +346,8 @@ _di_: Add inlineimages STARTUP
(when (not (null current-heading-id))
(save-excursion
(goto-char (point-min))
- (while (re-search-forward (rx-to-string `(and "#" ,current-heading-id "]")) nil t)
+ (while (re-search-forward (rx-to-string `(or (seq "[[id:" ,current-heading-id "]")
+ (seq "#" ,current-heading-id "]"))) nil t)
(unless (or (oni-org-in-dblock-p)
(oni-org-at-origin-property-p))
(let ((components (org-heading-components)))