From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Refactor refiling code Date: Sun, 28 Mar 2010 22:16:45 -0400 Message-ID: <1269829005-25254-5-git-send-email-bernt@norang.ca> References: <1269829005-25254-1-git-send-email-bernt@norang.ca> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nw4XW-0001qa-3T for emacs-orgmode@gnu.org; Sun, 28 Mar 2010 22:17:18 -0400 Received: from [140.186.70.92] (port=33722 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nw4XU-0001q3-Rq for emacs-orgmode@gnu.org; Sun, 28 Mar 2010 22:17:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nw4XT-0001TS-Cf for emacs-orgmode@gnu.org; Sun, 28 Mar 2010 22:17:16 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:62715) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nw4XT-0001TO-8q for emacs-orgmode@gnu.org; Sun, 28 Mar 2010 22:17:15 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1Nw4XT-0002vK-08 for emacs-orgmode@gnu.org; Mon, 29 Mar 2010 02:17:15 +0000 In-Reply-To: <1269829005-25254-1-git-send-email-bernt@norang.ca> 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 Allow C-2 C-c C-w to work in the agenda. Update agenda after refiling This rebuilds the agenda buffer after the refile operation completes. It was removing the to-be-refiled task before prompting for the location which felt a little strange. While on the prompt you can't see the task you are refiling anymore since it was just removed from the agenda list and if you aborted from the refile operation with C-g then the task to be refiled has already been removed. --- lisp/org-agenda.el | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 797728b..adcefad 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6207,18 +6207,15 @@ If this information is not given, the function uses the tree at point." (let* ((marker (or (org-get-at-bol '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)))) + (pos (marker-position marker))) (with-current-buffer buffer (save-excursion (save-restriction (widen) (goto-char marker) - (org-remove-subtree-entries-from-agenda) - (org-refile goto buffer rfloc))))))) + (org-refile goto buffer rfloc) + (with-current-buffer "*Org Agenda*" + (org-agenda-redo)))))))) (defun org-agenda-open-link (&optional arg) "Follow the link in the current line, if any. -- 1.7.0.2.279.gf1ba1c