emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-transclusion a609eb0e36 02/18: fix: Don't ever prom


From: ELPA Syncer
Subject: [elpa] externals/org-transclusion a609eb0e36 02/18: fix: Don't ever prompt to create a headline when transcluding
Date: Sun, 21 Jan 2024 15:58:41 -0500 (EST)

branch: externals/org-transclusion
commit a609eb0e3601179b4a928827b4fb101d3de62e37
Author: Joseph Turner <joseph@breatheoutbreathe.in>
Commit: Joseph Turner <joseph@breatheoutbreathe.in>

    fix: Don't ever prompt to create a headline when transcluding
    
    The default setting of `org-link-search-must-match-exact-headline'
    causes Emacs to prompt the user to create a new heading when a link
    target is not found.
    
    This commit temporarily overrides the default setting to signal an
    error when no headline exactly matches the link target.  Since errors
    are demoted, this skips the failed transclusion.
    
    However, if the user has set
    `org-link-search-must-match-exact-headline' to perform a fuzzy search
    for link targets, we don't override the option.
---
 org-transclusion.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/org-transclusion.el b/org-transclusion.el
index 9015a851ee..e7d5c06f9c 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -1119,7 +1119,12 @@ work to
     ;; search-option is present.
     (let* ((path (org-element-property :path link))
            (search-option (org-element-property :search-option link))
-           (buf (find-file-noselect path)))
+           (buf (find-file-noselect path))
+           (org-link-search-must-match-exact-headline
+            ;; Don't ever prompt to create a headline when transcluding
+            (if (eq 'query-to-create org-link-search-must-match-exact-headline)
+                t  ;; Less surprising default than nil - fuzzy search
+              org-link-search-must-match-exact-headline)))
       (with-current-buffer buf
         (org-with-wide-buffer
          (if search-option



reply via email to

[Prev in Thread] Current Thread [Next in Thread]