emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Cc: Bernt Hansen <bernt@norang.ca>
Subject: [PATCH] Fix jumping to last refile location in agenda
Date: Tue, 25 Aug 2009 12:17:24 -0400	[thread overview]
Message-ID: <1251217044-29401-1-git-send-email-bernt@norang.ca> (raw)

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

             reply	other threads:[~2009-08-25 16:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25 16:17 Bernt Hansen [this message]
2009-08-26  4:41 ` [PATCH] Fix jumping to last refile location in agenda Carsten Dominik
2009-08-26 13:53   ` Bernt Hansen
2009-08-26 14:11     ` Bernt Hansen
2009-08-26 14:11     ` Carsten Dominik
2009-08-26 14:23       ` Bernt Hansen
2009-08-26 14:35       ` [PATCH] Fix agenda bulk refile bug Bernt Hansen
2009-08-26 14:49         ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251217044-29401-1-git-send-email-bernt@norang.ca \
    --to=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).