emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Adam Spiers <orgmode@adamspiers.org>
Cc: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87a6ummc2m.fsf@kyleam.com> (raw)
In-Reply-To: <20200830001047.21362-1-orgmode@adamspiers.org>


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


  parent reply	other threads:[~2020-12-10  6:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30  0:10 Adam Spiers
2020-09-04 13:47 ` Bastien
2020-09-06  6:10   ` Amin Bandali
2020-11-10  0:26     ` Adam Spiers
2020-12-10  6:04 ` Kyle Meyer [this message]
2021-04-27 20:54   ` Bastien
2021-05-15 12:08 ` Bastien
2021-05-15 20:23   ` Samuel Wales

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=87a6ummc2m.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=orgmode@adamspiers.org \
    --subject='Re: [PATCH] org-refile.el: Add org-refile-reverse which toggles org-reverse-note-order' \
    /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).