Skip to content

Commit aba3e8f

Browse files
author
chap9
committed
Change: (org-ql-search) Generate the link of heading column with :ID
When a heading contains an id property, dynamic block generate the internal link with id not the heading text. In case two heading has the same text.
1 parent 4b8330a commit aba3e8f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

org-ql-search.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,12 @@ this (must be a single line in the Org buffer):
329329
(list (cons 'todo (lambda (element)
330330
(org-element-property :todo-keyword element)))
331331
(cons 'heading (lambda (element)
332-
(let ((normalized-heading
333-
(org-ql-search--link-heading-search-string (org-element-property :raw-value element))))
334-
(org-ql-search--org-make-link-string normalized-heading (org-link-display-format normalized-heading)))))
332+
(let* ((normalized-heading
333+
(org-ql-search--link-heading-search-string (org-element-property :raw-value element)))
334+
(id-value (org-element-property :ID element))
335+
(link-value (or (and id-value (format "id:%s" id-value))
336+
normalized-heading)))
337+
(org-ql-search--org-make-link-string link-value (org-link-display-format normalized-heading)))))
335338
(cons 'priority (lambda (element)
336339
(--when-let (org-element-property :priority element)
337340
(char-to-string it))))

0 commit comments

Comments
 (0)