emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] org-refile.el: Add org-refile-reverse which toggles org-reve


From: Kyle Meyer
Subject: Re: [PATCH] org-refile.el: Add org-refile-reverse which toggles org-reverse-note-order
Date: Thu, 10 Dec 2020 06:04:19 GMT

Thanks for the patch.

Adam Spiers writes:

> This is useful for prepending to the start of the target headline
> instead of appending to the end, or vice-versa depending on
> org-reverse-note-order.

It sounds like Bastien and Amin would also find this useful.  I would
have liked to see a few more people chime in because I'm lukewarm on it
myself, as I tend to think things like this are better suited for
personal customization.

In any case, I think we should go forward with it.  Could you add a
changelog entry to the commit message?

> diff --git a/doc/org-manual.org b/doc/org-manual.org
> index 3eb745b5d..e499367b7 100644
> --- a/doc/org-manual.org
> +++ b/doc/org-manual.org
> @@ -7190,6 +7190,16 @@ special command:
>    Copying works like refiling, except that the original note is not
>    deleted.
>  
> +- {{{kbd(C-c C-M-w)}}} (~org-refile-reverse~) ::
> +
> +  #+kindex: C-c C-M-w
> +  #+findex: org-refile-reverse
> +  Works like refiling, except that it temporarily toggles how the

It seems a bit odd to say it "works like refiling" when it _is_
refiling.  Perhaps "Works like ~org-refile~ ..." or the common "Like X
but ..." pattern?

> +  value of ~org-reverse-note-order~ applies to the current buffer.  So

I think the "applies to the current buffer" (here and in other spots)
doesn't add anything while possibly confusing the reader into thinking
that the toggling isn't in effect when refiling an entry to another
buffer.

[...]
> +;;;###autoload
> +(defun org-refile-reverse (&optional arg default-buffer rfloc msg)
> +  "Invoke `org-refile', but temporarily toggling how
> +~org-reverse-note-order~ applies to the current buffer.  So if

s/~org-reverse-note-order~/`org-reverse-note-order'/

The first line of the docstring should be self-contained for apropos and
friends.  Perhaps

  Invoke `org-refile' with `org-reverse-note-order' inverted.

However, there's also the question of what toggling means for users that
have configured org-reverse-note-order to a set of regular expressions.
I think it's worth noting in the docstring that this case is treated the
same as t (i.e. any non-nil value is mapped to nil).

> +`org-refile' would append the entry as the last entry under the
> +target heading, ~org-refile-reverse~ will prepend it as the first
> +entry, and vice-versa."

s/~org-refile-reverse~/`org-refile-reverse'/

> +  (interactive "P")
> +  (let ((org-reverse-note-order (not (org-notes-order-reversed-p))))
> +    (org-refile arg default-buffer rfloc msg)))
> +
>  ;;;###autoload
>  (defun org-refile (&optional arg default-buffer rfloc msg)
>    "Move the entry or entries at point to another heading.
> -- 
> 2.27.0



reply via email to

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