On 2014-12-15 09:31, Samuel Loury <[email protected]> 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
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
signature.asc
Description: PGP signature
