emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Maxim Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-refile failed due to default option stored by org-goto
Date: Thu, 4 Mar 2021 15:53:02 -0700	[thread overview]
Message-ID: <CAJcAo8s6WkW-QhQRAkPB7bgx5bz_7KBKtnG7zqwmTbOHUWKXVw@mail.gmail.com> (raw)
In-Reply-To: <s1qrup$gu5$1@ciao.gmane.io>

if you are willing to try something as a complete stab in the dark,
here is something i have had from many years ago that fixed issues
possibly including a defaulting issue.  the issues include other stuff
too, but i do not understand the code now for health reasons to rule
this out as a solution to your problem in addition to the problem i
put in the comment and name.  i havce carried along this patch for
eyars.

commit deaa14b6ed264c259a1f3b805b67b2db3951ba20
Author: Your Name <you@example.com>
Date:   2020-09-20 13:30:55 -0700

    === alpha remove the parens from ido completion of olpaths

	Modified lisp/org-refile.el
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)) ")")



On 3/4/21, Maxim Nikulin <manikulin@gmail.com> wrote:
> On 03/03/2021 00:15, Maxim Nikulin wrote:
>>
>> There is one issue however. Default option option does not work if after
>> cache clean other command is called, e.g.
>> - jump using C-u C-c C-j
>> - clean cache C-u C-u C-u C-c C-w
>> - try to jump or to refile [C-u] C-c C-w to default offered option
>> - "user-error: Invalid target location"
>
> I have realized that this issue is rather loosely related to
> org-refile-use-cache and I have seen it in a worse variant with disabled
> cache.
>
> file init-refile.el:
>
> (package-initialize)
>
> (custom-set-variables
>   '(org-agenda-files (quote ("~/examples/org/test-notes.org")))
>   '(org-capture-templates
>     (quote
>      (("t" "Test" entry
>        (file "")
>        "* %?\n\n%U\n" :empty-lines 1))))
>   '(org-default-notes-file "~/examples/org/capture.org")
>   '(org-directory "~/examples/org/")
>   '(org-modules (quote (org-refile)))
>   '(org-outline-path-complete-in-steps nil)
>   '(org-refile-targets (quote ((nil :maxlevel . 5) (org-agenda-files
> :maxlevel . 5))))
>   '(org-refile-use-outline-path t)
> )
>
> emacs -Q -L ~/src/emacs/org-mode/lisp/ -L
> ~/src/emacs/org-mode/contrib/lisp/ -l ~/examples/org/init-refile.el
> ~/examples/org/test-notes.org
>
> - C-u C-c C-j (org-goto) to some heading in the test-notes.org, e.g.
> "Two" / "Third" / "Theme"
> - M-x org-capture RET t to capture some note
> - Let's assume that target of previously executed org-goto suits for
> this note
> - C-c C-w RET to refile the note from capture.org file to the heading in
> test-notes.org offered as the default option.
>
> Actual result:
> - "Invalid target location"
> - Captured note is still in the capture.org file but it is not apparent
> since capture frame is closed.
>
> Expected result:
> - Default option works for refile even if it is remained from org-goto
> command
>
> Side note. In some cases it not so easy to close capture frame. If
> org-default-note-file is configured to a file in a non-existing
> directory then C-c C-k asks to create that directory but does not
> discards the note.
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


  reply	other threads:[~2021-03-04 22:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 17:15 org-refile-use-cache and jumps using org-refile or org-goto Maxim Nikulin
2021-03-03  2:34 ` Samuel Wales
2021-03-04 13:51   ` Maxim Nikulin
2021-03-04 21:03     ` Samuel Wales
2021-03-06 16:15       ` [PATCH] optimize org-refile-get-targets Maxim Nikulin
2021-04-25 12:25         ` Bastien
2021-04-25 15:24           ` Maxim Nikulin
2021-03-04 14:47 ` org-refile failed due to default option stored by org-goto Maxim Nikulin
2021-03-04 22:53   ` Samuel Wales [this message]
2021-03-09 11:57     ` Maxim Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJcAo8s6WkW-QhQRAkPB7bgx5bz_7KBKtnG7zqwmTbOHUWKXVw@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    --subject='Re: org-refile failed due to default option stored by org-goto' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).