emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: org-refile-get-target offers default candidate in duplicity [9.2.6 (9.2.6-4-ge30905-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20191007/)]
Date: Fri, 14 Feb 2020 10:41:13 -0300	[thread overview]
Message-ID: <878sl5ffra.fsf@gmail.com> (raw)
In-Reply-To: <87h7zttrjo.fsf@bzg.fr>

Hi Bastien,

On Fri, Feb 14 2020, Bastien wrote:

> I've revisited org-refile-get-location given your new information on
> ivy-completing-read but I'm not able to see something wrong in the
> current implementation of org-refile-get-location.  At the same time,
> I don't see why ivy-completing-read would handle arguments differently
> than completing-read-default, so _perhaps_ org-refile-get-location
> still does something wrong.

That was pretty much my thought too.

> If you - or other ivy users - have time to investigate and report,
> please do so.

I've tried, when I originally reported, and now again, to pin this 
further down.  Alas, there is much in 'org-refile-get-location' I don't 
understand (in the sense of not understanding why certain things are 
being done). I also have much to learn with respect to 
'completing-read'. But I can provide an ECM to reproduce it.

- Start 'emacs -Q'

- Do an initial setup:
  #+begin_src emacs-lisp
  (add-to-list 'load-path "~/src/org-mode/lisp"); current master
  (setq org-refile-targets '(("~/org/test.org" :maxlevel . 2)))
  (setq org-refile-use-outline-path 'file)
  (setq org-outline-path-complete-in-steps nil)
  #+end_src

- Open file "~/org/test.org", with contents:
  #+begin_src org
  ,* Top heading 1
  ,* Top heading 2
  ,** Entry 1
  ,** Entry 2
  #+end_src

- Now, do some refile operations here. Inspecting 'org-refile-history' 
  will give us:
  #+begin_src emacs-lisp
  ("test.org/Top heading 2/" "test.org/Top heading 2/" "test.org/Top 
  heading 1/" "test.org/Top heading 1/")
  #+end_src

- Now, we reset 'org-refile-history' and start 'ivy-mode':
  #+begin_src emacs-lisp
  (setq org-refile-history nil)
  (add-to-list 'load-path ".emacs.d/elpa/ivy-20200211.1338"); current 
  Melpa
  (require 'ivy)
  (ivy-mode)
  #+end_src

- After some refile operations, the value of 'org-refile-history' is:
  #+begin_src emacs-lisp
  ("test.org/Top heading 2" "test.org/Top heading 2" "test.org/Top 
  heading 1" "test.org/Top heading 1")
  #+end_src

The difference is, as previously reported, the presence/absence of the 
trailing slash (the "extra" in terms of 'org-refile-get-location'). As 
far as I can tell, it is inconsequential to the working of the refile 
operation, but it did intrigue me.

Environment: Org mode version 9.3.6 (release_9.3.6-298-g0fa69d @ 
/home/gustavo/src/org-mode/lisp/); GNU Emacs 26.3 (build 1, 
x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-11-11; 
ivy-20200211.1338

HTH,
Gustavo.

  reply	other threads:[~2020-02-14 13:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 18:34 Bug: org-refile-get-target offers default candidate in duplicity [9.2.6 (9.2.6-4-ge30905-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20191007/)] Gustavo Barros
2020-02-12 23:35 ` Bastien
2020-02-13  1:51   ` Gustavo Barros
2020-02-13  7:45     ` Bastien
2020-02-13 19:44       ` Samuel Wales
2020-02-14 10:02         ` Bastien
2020-02-17  0:06           ` Samuel Wales
2020-02-17  0:14             ` Bastien
2020-02-17  0:17               ` Samuel Wales
2020-02-17  0:25                 ` Samuel Wales
2020-02-17  0:38                   ` Bastien
2020-02-17  1:58                     ` Samuel Wales
2020-02-17 22:55                       ` Bastien
2020-02-17  0:15             ` Samuel Wales
2020-02-13 22:53       ` Gustavo Barros
2020-02-13 23:13         ` Samuel Wales
2020-02-14 10:02         ` Bastien
2020-02-14 13:41           ` Gustavo Barros [this message]
2020-02-14 15:29             ` Bastien
2020-02-14 16:37               ` Gustavo Barros
2020-02-14 15:33           ` Gustavo Barros
2020-02-16 23:22             ` Bastien
2020-02-17  0:45               ` Gustavo Barros
2020-02-17 17:45                 ` Bastien
2020-02-13  2:06   ` Gustavo Barros
2020-02-13  7:19     ` Bastien
2020-02-13 20:51       ` Gustavo Barros

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=878sl5ffra.fsf@gmail.com \
    --to=gusbrs.2016@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).