[oni-org] Add support for id: backlinks in oni-backlinks dblock
This commit is contained in:
parent
641f736478
commit
64fee97d35
1 changed files with 6 additions and 3 deletions
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue