From 64fee97d35fc1cd619c55b1085ea0d185e4bc01e Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 1 Apr 2022 18:39:47 -0700 Subject: [oni-org] Add support for id: backlinks in oni-backlinks dblock --- oni-org/oni-org.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'oni-org') 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 ;; 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))) -- cgit v1.2.3-54-g00ecf