Change/Fix: (--format-element) Use marker's buffer
When formatting an element outside the element's buffer (e.g. when mapping --format-element across the results of org-ql), the current buffer is not the element's source buffer, so functions like org-get-tags-at will not return the correct results, because they don't use the marker's buffer. So now we set the current buffer to the marker's buffer. As this package matures, this might become unnecessary in the future, but it's probably best to keep it for correctness.
This commit is contained in:
parent
056c93bcd6
commit
fe32388d50
1 changed files with 3 additions and 1 deletions
|
|
@ -163,7 +163,9 @@ Its property list should be the second item in the list, as returned by `org-ele
|
|||
(if-let ((marker (or (org-element-property :org-hd-marker element)
|
||||
(org-element-property :org-marker element)
|
||||
(org-element-property :begin element))))
|
||||
(org-get-tags-at marker (not org-use-tag-inheritance))
|
||||
(with-current-buffer (marker-buffer marker)
|
||||
;; I wish `org-get-tags-at' used the correct buffer automatically.
|
||||
(org-get-tags-at marker (not org-use-tag-inheritance)))
|
||||
;; No marker found
|
||||
(warn "No marker found for item: %s" title)
|
||||
(org-element-property :tags element))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue