From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Fix goto last refile location Date: Sat, 20 Feb 2010 12:50:05 -0500 Message-ID: <1266688205-28536-1-git-send-email-bernt@norang.ca> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NitT4-0005e2-9w for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 12:50:14 -0500 Received: from [140.186.70.92] (port=40877 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NitT3-0005ci-AF for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 12:50:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NitT2-0007dq-9J for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 12:50:13 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:53594) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NitT2-0007dc-34 for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 12:50:12 -0500 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 1NitT1-000JeT-9P for emacs-orgmode@gnu.org; Sat, 20 Feb 2010 17:50:11 +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 Move the marker for the last refile location to the heading instead of at the end of the entry. This was causing C-u C-u C-c C-w to end up on the heading following the newly refiled entry. --- This uses the same mechanism that remember mode uses for bookmarking the last stored location. I originally had a save-excursion and org-back-to-heading call before setting the bookmark but this seems to work probably due to a side-effect. lisp/org.el | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index e5b2f56..8ba782a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9399,8 +9399,9 @@ See also `org-refile-use-outline-path' and `org-completion-use-ido'" (goto-char (point-min)) (or (outline-next-heading) (goto-char (point-max))))) (if (not (bolp)) (newline)) - (bookmark-set "org-refile-last-stored") (org-paste-subtree level) + (and org-auto-align-tags (org-set-tags nil t)) + (bookmark-set "org-refile-last-stored") (if (fboundp 'deactivate-mark) (deactivate-mark)) (run-hooks 'org-after-refile-insert-hook)))) (if regionp -- 1.7.0.14.g7e948