emacs-orgmode
[Top][All Lists]
Advanced

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

Re: org-refile failed due to default option stored by org-goto


From: Maxim Nikulin
Subject: Re: org-refile failed due to default option stored by org-goto
Date: Tue, 9 Mar 2021 18:57:09 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 05/03/2021 05:53, Samuel Wales wrote:
diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 1e6872b46..8f98e9cf9 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -617,7 +617,9 @@ this function appends the default value from
         (tbl (mapcar
               (lambda (x)
                 (if (and (not (member org-refile-use-outline-path
-                                      '(file full-file-path)))
+                                       ;; === alpha remove the parens
from ido completion of olpaths
+                                      '(nil full-file-path)))
+                                      ;; '(file full-file-path)))
                          (not (equal filename (nth 1 x))))
                     (cons (concat (car x) extra " ("
                                   (file-name-nondirectory (nth 1 x)) ")")

The patch changes appearance of "(file.org)" at the end of each completion option. I do not know value of your org-refile-use-outline-path setting so I am unsure if your are trying to avoid it or vice versa to force it.

I do not think that the patch is relevant to sharing of default option between org-goto and org-refile. I think, buffer (or file) name should be stored separately from outline path within the buffer in org-refile history and merged accordingly to current settings just before completing-read. org-refile-cache likely requires a similar approach.

Personally I was confused by behavior of (org-refile-use-outline-path t). Completion options appears as "A (file.org)", "A/B (file.org)", and I could not figure out how to refile directly to "A" headings. I suspect that org-refile-allow-creating-parent-nodes does not work with "t" at all. Recently I have realized that after typing of "A/B" TAB completes option to "A/B (file.org)" and I was trying RET after "A". It is necessary to add space "A " to refile to a non-leaf node.

That was the reason why I set (org-refile-use-outline-path 'file). Completion options appears as "file.org/A/B". I have to press TAB at first to get "file.org/" but then after "file.org/A" RET works fine.





reply via email to

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