emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-refile and ivy
@ 2021-01-22 15:49 Eric S Fraga
  2021-01-22 17:37 ` Gustavo Barros
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Eric S Fraga @ 2021-01-22 15:49 UTC (permalink / raw)
  To: Emacs Org mode mailing list

Dear all org mode list readers,

I have been trying to get to grips with org-refile.  For some reason,
the completion mechanism (I use ivy generally but I have no idea what
org-refile actually tries to do/use) only shows me the current file name
if I have org-refile-targets set to nil.  It doesn't show any top level
headlines to choose from which is what I would expect from the
documentation.  Hitting RET to select the completion target given (file
name only) refiles to the end of the file which is not what I want.

This is with org updated fairly recently but not quite up to
date.  However, I've had this problem for a long time and don't use
org-refile as a result.

Any suggestions welcome.

Thank you,
eric

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-179-g5b5c42


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-refile and ivy
  2021-01-22 15:49 org-refile and ivy Eric S Fraga
@ 2021-01-22 17:37 ` Gustavo Barros
  2021-01-22 19:24   ` Tim Cross
  2021-01-25  8:40   ` Eric S Fraga
  2021-01-22 18:23 ` Pankaj Jangid
  2021-01-25  8:29 ` Loris Bennett
  2 siblings, 2 replies; 7+ messages in thread
From: Gustavo Barros @ 2021-01-22 17:37 UTC (permalink / raw)
  To: Emacs Org mode mailing list

Hi Eric,

On Fri, 22 Jan 2021 at 15:49, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

> Dear all org mode list readers,
>
> I have been trying to get to grips with org-refile.  For some reason,
> the completion mechanism (I use ivy generally but I have no idea what
> org-refile actually tries to do/use) only shows me the current file name
> if I have org-refile-targets set to nil.  It doesn't show any top level
> headlines to choose from which is what I would expect from the
> documentation.  Hitting RET to select the completion target given (file
> name only) refiles to the end of the file which is not what I want.
>
> This is with org updated fairly recently but not quite up to
> date.  However, I've had this problem for a long time and don't use
> org-refile as a result.
>
> Any suggestions welcome.

I use org-refile with ivy, so I might share.  If I recall correctly, the
only thing that does not play well between the two is
`org-outline-path-complete-in-steps`.   My basic setup is the following:

#+begin_src emacs-lisp
(setq org-refile-targets
      '((org-agenda-files :maxlevel . 6)
        ;; 'nil' means consider headings of the current buffer
        (nil :maxlevel . 6)))
(setq org-refile-use-outline-path 'file)
(setq org-outline-path-complete-in-steps nil)
#+end_src

That should get you started.  I personally like org-refile for its
quickness, so I do some extra work to filter out candidates of this list
and keeping only the frequent targets (with
`org-refile-target-verify-function').  And if something atypical arises,
I just go with kill-yank.

Note however, on the relation of org-refile and ivy:
https://orgmode.org/list/87tuvrj7ww.fsf@gmail.com/

HTH,
Gustavo.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-refile and ivy
  2021-01-22 15:49 org-refile and ivy Eric S Fraga
  2021-01-22 17:37 ` Gustavo Barros
@ 2021-01-22 18:23 ` Pankaj Jangid
  2021-01-25  8:29 ` Loris Bennett
  2 siblings, 0 replies; 7+ messages in thread
From: Pankaj Jangid @ 2021-01-22 18:23 UTC (permalink / raw)
  To: Emacs Org mode mailing list

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I have been trying to get to grips with org-refile.  For some reason,
> the completion mechanism (I use ivy generally but I have no idea what
> org-refile actually tries to do/use) only shows me the current file name
> if I have org-refile-targets set to nil.  It doesn't show any top level
> headlines to choose from which is what I would expect from the
> documentation.  Hitting RET to select the completion target given (file
> name only) refiles to the end of the file which is not what I want.

I use the built-in completion framework. And if the org-refile-targets
is nil, it shows me the top level headings from the same file in the
*Completions* buffer when I press TAB.

So, in your case, it looks like an Ivy issue.

> This is with org updated fairly recently but not quite up to
> date.  However, I've had this problem for a long time and don't use
> org-refile as a result.

My org-version is 9.4.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-refile and ivy
  2021-01-22 17:37 ` Gustavo Barros
@ 2021-01-22 19:24   ` Tim Cross
  2021-01-25  8:40   ` Eric S Fraga
  1 sibling, 0 replies; 7+ messages in thread
From: Tim Cross @ 2021-01-22 19:24 UTC (permalink / raw)
  To: emacs-orgmode


Gustavo Barros <gusbrs.2016@gmail.com> writes:

> On Fri, 22 Jan 2021 at 15:49, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>
>> Dear all org mode list readers,
>>
>> I have been trying to get to grips with org-refile.  For some reason,
>> the completion mechanism (I use ivy generally but I have no idea what
>> org-refile actually tries to do/use) only shows me the current file name
>> if I have org-refile-targets set to nil.  It doesn't show any top level
>> headlines to choose from which is what I would expect from the
>> documentation.  Hitting RET to select the completion target given (file
>> name only) refiles to the end of the file which is not what I want.
>>
>> This is with org updated fairly recently but not quite up to
>> date.  However, I've had this problem for a long time and don't use
>> org-refile as a result.
>>
>> Any suggestions welcome.
>
> I use org-refile with ivy, so I might share.  If I recall correctly, the
> only thing that does not play well between the two is
> `org-outline-path-complete-in-steps`.   My basic setup is the following:
>
> #+begin_src emacs-lisp
> (setq org-refile-targets
>       '((org-agenda-files :maxlevel . 6)
>         ;; 'nil' means consider headings of the current buffer
>         (nil :maxlevel . 6)))
> (setq org-refile-use-outline-path 'file)
> (setq org-outline-path-complete-in-steps nil)
> #+end_src
>
> That should get you started.  I personally like org-refile for its
> quickness, so I do some extra work to filter out candidates of this list
> and keeping only the frequent targets (with
> `org-refile-target-verify-function').  And if something atypical arises,
> I just go with kill-yank.
>
> Note however, on the relation of org-refile and ivy:
> https://orgmode.org/list/87tuvrj7ww.fsf@gmail.com/
>

I am using spacemacs, currently with helm, but have used it with ivy as
well and I have the following setup for my org-refile, which I find
works well for my purposes.

      org-refile-allow-creating-parent-nodes 'confirm
      org-refile-targets (quote ((nil :maxlevel . 3)
                                 (org-agenda-files :maxlevel . 3)))
      org-refile-use-outline-path t

which allows me to type some of the 'path' name (e.g. outline heading or
org file name) and it shows me appropriate candidates.

I don't know if there is some spacemacs helm/ivy setup which plays a
part here - it just works, so I've not looked any further.

org version reports 9.4.4

--
Tim Cross


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-refile and ivy
  2021-01-22 15:49 org-refile and ivy Eric S Fraga
  2021-01-22 17:37 ` Gustavo Barros
  2021-01-22 18:23 ` Pankaj Jangid
@ 2021-01-25  8:29 ` Loris Bennett
  2 siblings, 0 replies; 7+ messages in thread
From: Loris Bennett @ 2021-01-25  8:29 UTC (permalink / raw)
  To: emacs-orgmode

Hi Eric,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Dear all org mode list readers,
>
> I have been trying to get to grips with org-refile.  For some reason,
> the completion mechanism (I use ivy generally but I have no idea what
> org-refile actually tries to do/use) only shows me the current file name
> if I have org-refile-targets set to nil.  It doesn't show any top level
> headlines to choose from which is what I would expect from the
> documentation.  Hitting RET to select the completion target given (file
> name only) refiles to the end of the file which is not what I want.
>
> This is with org updated fairly recently but not quite up to
> date.  However, I've had this problem for a long time and don't use
> org-refile as a result.
>
> Any suggestions welcome.
>
> Thank you,
> eric

Refiling works for me.  I have

  (setq org-refile-targets '(("gtd.org" :regexp . "Task")
                             ("someday.org" :level . 1)
                             ("projects.org" :regexp . "Tasks")
                             (nil :tag . "refile")
                             (org-agenda-files :regexp . "Tasks")
                             (org-agenda-files :regexp . "Appointments")
                             (nil :maxlevel . 3)))

I use IDO, but at some point tried out ivy.  I seem to remember having
some issues with it (I still have commented out ivy stuff in my
init.org).  Unfortunately I can't remember whether the problems were
related to refiling :-/

Cheers,

Loris

-- 
This signature is currently under construction.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-refile and ivy
  2021-01-22 17:37 ` Gustavo Barros
  2021-01-22 19:24   ` Tim Cross
@ 2021-01-25  8:40   ` Eric S Fraga
  2021-01-25 12:12     ` Pankaj Jangid
  1 sibling, 1 reply; 7+ messages in thread
From: Eric S Fraga @ 2021-01-25  8:40 UTC (permalink / raw)
  To: Gustavo Barros; +Cc: Emacs Org mode mailing list

On Friday, 22 Jan 2021 at 14:37, Gustavo Barros wrote:
> I use org-refile with ivy, so I might share.  If I recall correctly,
> the only thing that does not play well between the two is
> `org-outline-path-complete-in-steps`.  My basic setup is the
> following:

Spot on!  Changing the setting of that variable to nil allows refiling
to work properly.  Many thanks!

Why it doesn't work with that variable set to t is, of course, another
question but not one that is urgent (for me) now.

Thanks again,
eric

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-179-g5b5c42


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-refile and ivy
  2021-01-25  8:40   ` Eric S Fraga
@ 2021-01-25 12:12     ` Pankaj Jangid
  0 siblings, 0 replies; 7+ messages in thread
From: Pankaj Jangid @ 2021-01-25 12:12 UTC (permalink / raw)
  To: Gustavo Barros; +Cc: Emacs Org mode mailing list

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Friday, 22 Jan 2021 at 14:37, Gustavo Barros wrote:
>> I use org-refile with ivy, so I might share.  If I recall correctly,
>> the only thing that does not play well between the two is
>> `org-outline-path-complete-in-steps`.  My basic setup is the
>> following:
>
> Spot on!  Changing the setting of that variable to nil allows refiling
> to work properly.  Many thanks!
>
> Why it doesn't work with that variable set to t is, of course, another
> question but not one that is urgent (for me) now.

Although the docstring of this variable also suggests that going in
steps might not be best thing with completion packages like ido etc.,
but it doesn’t say that refiling wont work. So, I guess this is a bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-25 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-22 15:49 org-refile and ivy Eric S Fraga
2021-01-22 17:37 ` Gustavo Barros
2021-01-22 19:24   ` Tim Cross
2021-01-25  8:40   ` Eric S Fraga
2021-01-25 12:12     ` Pankaj Jangid
2021-01-22 18:23 ` Pankaj Jangid
2021-01-25  8:29 ` Loris Bennett

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).