emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] Refactor refiling code


From: Bernt Hansen
Subject: [Orgmode] [PATCH] Refactor refiling code
Date: Sun, 28 Mar 2010 22:16:45 -0400

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]