From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: can I refile or archive from the agenda without rebuilding? Date: Tue, 16 Dec 2014 10:17:51 +0100 Message-ID: References: <87egs4u7j4.fsf@kyleam.com> <87y4q9tiug.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0vxV-0001qe-FJ for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 12:31:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0vxO-0007Um-0Q for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 12:30:53 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]:57840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0vxN-0007UX-Q1 for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 12:30:45 -0500 In-Reply-To: <87y4q9tiug.fsf@konixwork.incubateur.ens-lyon.fr> (Samuel Loury's message of "Mon, 15 Dec 2014 09:31:19 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Samuel Loury Cc: Kyle Meyer , emacs-orgmode --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2014-12-15 09:31, Samuel Loury writes: >>> org-agenda-refile takes a NO-UPDATE argument. To set this >>> interactively, you could advise org-agenda-refile (or wrap it in another >>> command). >> >> This is a great suggestion, thanks! It works perfectly. > > For other readers to take advantage of the code, this is my > implementation of the advise. > > (defun my/org-agenda-refile (orig &optional goto rfloc no-update) > (funcall orig goto rfloc t)) > > (add-function :around > (symbol-function 'org-agenda-refile) > #'my/org-agenda-refile) This is how I did it: #+begin_src emacs-lisp (defun as/org-agenda-refile-noupdate (&optional goto rfloc) "Call `org-agenda-refile' with arguments GOTO, RFLOC, and t." (interactive "P") (org-agenda-refile goto rfloc t)) (add-hook 'org-agenda-mode-hook (lambda () (local-set-key (kbd "C-c C-w") 'as/org-agenda-refile-noupdate))) #+end_src I'm curious: is it better to use an advice or to redefine a function? Thanks, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBCgAGBQJUj/jDAAoJEAQNCjtO0uXHEm8H/1QG5BIU10g8Flp3MoWJhMIS HXm66MzbH3ZGDji5Dr5qZudY7dP0y9Bmy9GwNR26TB9zmEAkXyRFRSZqo/RP5bn+ YxKQXZMnrCR8jXIkh0xiRAPc4JSGd/tzRraIOophAAeI0Qw90cGy3B8OGP75lAZO 7egC8SlOGIxAsjYmzoKZGmge8J5B7SisenOV8LCXKfBL3E5aF/bwSD84uaGguvv1 NsP1yyHMAPbSpfvqfNqjWqqTONRDHNS1zHI6NtLLqmZHAL84rqL4znoMpJ8KBDPV ljJrQNV/D3Jcyekv0sZ4x1oZSSONarrFmCJICsNY5smPig06DDUUIqxLMdLa4uM= =Kgn5 -----END PGP SIGNATURE----- --=-=-=--