From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: can I refile or archive from the agenda without rebuilding? Date: Tue, 16 Dec 2014 15:46:46 -0500 Message-ID: <87ppbj5nm1.fsf@kyleam.com> References: <87egs4u7j4.fsf@kyleam.com> <87y4q9tiug.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0z1E-0004ka-FI for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 15:47:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0z18-0000XP-4D for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 15:46:56 -0500 Received: from mail-qc0-f175.google.com ([209.85.216.175]:44714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0z18-0000XD-0O for emacs-orgmode@gnu.org; Tue, 16 Dec 2014 15:46:50 -0500 Received: by mail-qc0-f175.google.com with SMTP id b13so12277301qcw.34 for ; Tue, 16 Dec 2014 12:46:48 -0800 (PST) In-Reply-To: (Alan Schmitt's message of "Tue, 16 Dec 2014 10:17:51 +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: Alan Schmitt Cc: emacs-orgmode , Samuel Loury Alan Schmitt wrote: > On 2014-12-15 09:31, Samuel Loury writes: [...] > 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 You could also use (define-key org-agenda-mode-map [remap org-agenda-refile] 'as/org-agenda-refile-noupdate) > I'm curious: is it better to use an advice or to redefine a function? I usually prefer to define a new function because it allows you to use both the old and new variant. -- Kyle