From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WPMcH8m60V8xUgAA0tVLHw (envelope-from ) for ; Thu, 10 Dec 2020 06:06:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KCLwGsm60V8XbwAA1q6Kng (envelope-from ) for ; Thu, 10 Dec 2020 06:06:01 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E67239403E8 for ; Thu, 10 Dec 2020 06:06:00 +0000 (UTC) Received: from localhost ([::1]:35178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knF5T-00060i-Gm for larch@yhetil.org; Thu, 10 Dec 2020 01:05:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knF3y-00060Y-Au for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 01:04:26 -0500 Received: from out1.migadu.com ([91.121.223.63]:22104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knF3u-0000R1-89 for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 01:04:26 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1607580259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=DgyIFRzN/SeyUC3iLYP19YBWrR3aiusO/pmcYFifBEQ=; b=QesSXvtyW33ojeWW3OWVdTA14VlHSg6yPhPTar2/wwtdOXu5aisrRK63g4QK5sQr36pD2p CV/LQc2cH86/e56VAdyYdAzrb1ixufP/gdmI7QMLJdwVwVZphpc+YkkzW3nfx82+W9487v 1mOHlrqRIau28LuW7AANOtQ+dQuUoJBULiJAmDhMqLUOaJvqJk63PhKFZsbUtSHRFuDbtz Qqk/DSY8m9Kebj8kBOsy14N9ElhEDmtdGl41G2wRMWFj4wtlDdLcdlYYqlq73mih55+IgD FIQvex0260e9PHCWOqkoYVcJLGElj/QcMESdYCPUjIB71TV/u/Zj7ogeSVWivQ== From: Kyle Meyer To: Adam Spiers Subject: Re: [PATCH] org-refile.el: Add org-refile-reverse which toggles org-reverse-note-order In-Reply-To: <20200830001047.21362-1-orgmode@adamspiers.org> Message-ID: <87a6ummc2m.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Auth-User: kyle@kyleam.com Date: Thu, 10 Dec 2020 06:04:19 GMT Received-SPF: pass client-ip=91.121.223.63; envelope-from=kyle@kyleam.com; helo=out1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=QesSXvty; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: E67239403E8 X-Spam-Score: -1.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: EpwRRWPFkmmK 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