summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhor Radchenko <yantar92@posteo.net>2023-12-15 13:52:07 +0100
committerIhor Radchenko <yantar92@posteo.net>2023-12-15 13:52:07 +0100
commitcb71bde7cb04551bc60e61b7782692ce93f0a416 (patch)
tree036cc6524df9155bb8ed838e2a5fa4898b0cdc74
parent5c543cd9d92a85879742f88e5a9bd3184c761e5f (diff)
downloadorg-mode-cb71bde7c.tar.gz
lisp/org-macro.el (org-macro--get-property): Ignore narrowing
It is implied that we ignore narrowing when searching for property value. But `org-link-search' does not. Widen around its call.
-rw-r--r--lisp/org-macro.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/org-macro.el b/lisp/org-macro.el
index e694118..f9707d0 100644
--- a/lisp/org-macro.el
+++ b/lisp/org-macro.el
@@ -333,14 +333,14 @@ Return a list of arguments, as strings. This is the opposite of
"Find PROPERTY's value at LOCATION.
PROPERTY is a string. LOCATION is a search string, as expected
by `org-link-search', or the empty string."
- (save-excursion
- (when (org-string-nw-p location)
- (condition-case _
- (let ((org-link-search-must-match-exact-headline t))
- (org-link-search location nil t))
- (error
- (error "Macro property failed: cannot find location %s" location))))
- (org-entry-get nil property 'selective)))
+ (org-with-wide-buffer
+ (when (org-string-nw-p location)
+ (condition-case _
+ (let ((org-link-search-must-match-exact-headline t))
+ (org-link-search location nil t))
+ (error
+ (error "Macro property failed: cannot find location %s" location))))
+ (org-entry-get nil property 'selective)))
(defun org-macro--find-keyword-value (name &optional collect)
"Find value for keyword NAME in current buffer.