From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Fix jumping to last refile location in agenda Date: Tue, 25 Aug 2009 12:17:24 -0400 Message-ID: <1251217044-29401-1-git-send-email-bernt@norang.ca> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfyiL-0001WX-Cc for emacs-orgmode@gnu.org; Tue, 25 Aug 2009 12:17:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfyiH-0001Q2-51 for emacs-orgmode@gnu.org; Tue, 25 Aug 2009 12:17:40 -0400 Received: from [199.232.76.173] (port=49733 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfyiG-0001PV-Td for emacs-orgmode@gnu.org; Tue, 25 Aug 2009 12:17:36 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:55389) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MfyiG-0003B2-LJ for emacs-orgmode@gnu.org; Tue, 25 Aug 2009 12:17:36 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1MfyiF-0000M0-5p for emacs-orgmode@gnu.org; Tue, 25 Aug 2009 16:17:35 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Bernt Hansen C-u C-u C-c C-w now goes to the last refile location in the agenda. This is the same behaviour as org-refile (when used in an org file) --- Carsten, This patch allows C-u C-u C-c C-w on any line in the agenda. The goto function (C-u C-c C-w) could possibly work the same way - now you need to put the point on a task first - it won't work on the date or the Day-agenda line. This patch is available at git://git.norang.ca/org-mode for-carsten. lisp/org-agenda.el | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 073e668..83e8dd6 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5475,14 +5475,17 @@ If this information is not given, the function uses the tree at point." (defun org-agenda-refile (&optional goto rfloc) "Refile the item at point." (interactive "P") - (let* ((marker (or (get-text-property (point) 'org-hd-marker) - (org-agenda-error))) - (buffer (marker-buffer marker)) - (pos (marker-position marker)) - (rfloc (or rfloc - (org-refile-get-location - (if goto "Goto: " "Refile to: ") buffer - org-refile-allow-creating-parent-nodes)))) + (if (equal goto '(16)) + (org-refile-goto-last-stored) + (let* ((marker (or (get-text-property (point) 'org-hd-marker) + (org-agenda-error))) + (buffer (marker-buffer marker)) + (pos (marker-position marker)) + (rfloc)) + (setq rfloc (or rfloc + (org-refile-get-location + (if goto "Goto: " "Refile to: ") buffer + org-refile-allow-creating-parent-nodes)))) (with-current-buffer buffer (save-excursion (save-restriction @@ -5491,9 +5494,6 @@ If this information is not given, the function uses the tree at point." (org-remove-subtree-entries-from-agenda) (org-refile goto buffer rfloc)))))) - - - (defun org-agenda-open-link () "Follow the link in the current line, if any." (interactive) -- 1.6.4