Org-mode mailing list
 help / color / mirror / Atom feed
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: emacs-orgmode@gnu.org
Subject: 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: Mon, 07 Oct 2019 15:34:08 -0300
Message-ID: <87lftw1k2n.fsf@gmail.com> (raw)

Hi Org list,

`org-refile-get-target', when using `org-refile-use-outline-path' 
appends an "extra" slash at the end of every path, but candidates are 
stored in `org-refile-history' without that extra slash. As the default 
candidate passed to `completing-read' is the car of `org-refile-history' 
(the last refile target), the default candidate is provided in duplicity 
(once with the trailing slash and once without it). This is the case 
independent of the completion framework in use, but the difference is 
less prominent with the default `completing-read-default' and more so 
with, e.g., `ivy-completing-read'.

Steps to reproduce:

- Start 'emacs -Q'

- Do an initial setup:
  #+begin_src emacs-lisp
  (package-initialize)
  (setq org-refile-targets '(("~/org/test.org" :maxlevel . 2)))
  (setq org-refile-use-outline-path 'file)
  (setq org-outline-path-complete-in-steps nil)
  (ivy-mode)
  ;; as mentioned, Ivy just makes things clearer, the issue is 
  independent of it
  #+end_src

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

- Go to heading "Entry 1", refile it to "Top heading 1"

- Go to heading "Entry 2", and call `org-refile'

- Observe the available candidates, and notice "test.org/Top heading 1" 
  is there twice, once as the default candidate, without a trailing 
  slash, and also on the paths list, with the slash.

Best regards,
Gustavo Barros.



Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.22.30)
 of 2019-09-30
Package: Org mode version 9.2.6 (9.2.6-4-ge30905-elpaplus @ 
/home/gustavo/.emacs.d/elpa/org-plus-contrib-20191007/)

current state:
==============
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
 org-src-mode-configure-edit-buffer)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-refile-targets '(("~/org/test.org" :maxlevel . 2))
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
 change-major-mode-hook org-show-all append local] 5]
		 #[0 "\300\301\302\303\304$\207"
		   [add-hook change-major-mode-hook 
		   org-babel-show-result-all append local] 5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes 
		 org-eldoc-load)
 org-outline-path-complete-in-steps nil
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 
 "\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
 org-babel-header-arg-expand)
 org-src-lang-modes '(("arduino" . arduino) ("redis" . redis) ("php" 
 . php) ("C" . c) ("C++" . c++)
		      ("asymptote" . asy) ("bash" . sh) ("beamer" 
		      . latex) ("calc" . fundamental) ("cpp" . c++)
		      ("ditaa" . artist) ("dot" . fundamental) ("elisp" 
		      . emacs-lisp) ("ocaml" . tuareg)
		      ("screen" . shell-script) ("shell" . sh) ("sqlite" 
		      . sql))
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees 
 org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate 
 org-babel-speed-command-activate)
 org-refile-use-outline-path 'file
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("id" :follow org-id-open) ("eww" :follow eww 
 :store org-eww-store-link)
		       ("rmail" :follow org-rmail-open :store 
		       org-rmail-store-link)
		       ("mhe" :follow org-mhe-open :store 
		       org-mhe-store-link)
		       ("irc" :follow org-irc-visit :store 
		       org-irc-store-link :export org-irc-export)
		       ("info" :follow org-info-open :export 
		       org-info-export :store org-info-store-link)
		       ("gnus" :follow org-gnus-open :store 
		       org-gnus-store-link)
		       ("docview" :follow org-docview-open :export 
		       org-docview-export :store
			org-docview-store-link)
		       ("bibtex" :follow org-bibtex-open :store 
		       org-bibtex-store-link)
		       ("bbdb" :follow org-bbdb-open :export 
		       org-bbdb-export :complete org-bbdb-complete-link
			:store org-bbdb-store-link)
		       ("w3m" :store org-w3m-store-link) ("file+sys") 
		       ("file+emacs")
		       ("elfeed" :follow elfeed-link-open :store 
		       elfeed-link-store-link)
		       ("doi" :follow org--open-doi-link) ("elisp" 
		       :follow org--open-elisp-link)
		       ("file" :complete org-file-complete-link)
		       ("ftp" :follow (lambda (path) (browse-url (concat 
		       "ftp:" path))))
		       ("help" :follow org--open-help-link)
		       ("http" :follow (lambda (path) (browse-url 
		       (concat "http:" path))))
		       ("https" :follow (lambda (path) (browse-url 
		       (concat "https:" path))))
		       ("mailto" :follow (lambda (path) (browse-url 
		       (concat "mailto:" path))))
		       ("news" :follow (lambda (path) (browse-url 
		       (concat "news:" path))))
		       ("shell" :follow org--open-shell-link))
 )

             reply	other threads:[~2019-10-07 18:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 18:34 Gustavo Barros [this message]
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
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://orgmode.org

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

  git send-email \
    --in-reply-to=87lftw1k2n.fsf@gmail.com \
    --to=gusbrs.2016@gmail.com \
    --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

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git