emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix goto last refile location
@ 2010-02-20 17:50 Bernt Hansen
  2010-02-20 17:55 ` Bernt Hansen
  2010-02-20 19:37 ` Carsten Dominik
  0 siblings, 2 replies; 3+ messages in thread
From: Bernt Hansen @ 2010-02-20 17:50 UTC (permalink / raw)
  To: emacs-orgmode; +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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix goto last refile location
  2010-02-20 17:50 [PATCH] Fix goto last refile location Bernt Hansen
@ 2010-02-20 17:55 ` Bernt Hansen
  2010-02-20 19:37 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Bernt Hansen @ 2010-02-20 17:55 UTC (permalink / raw)
  To: emacs-orgmode

This commit is available at git://git.norang.ca/org-mode for-carsten

-Bernt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix goto last refile location
  2010-02-20 17:50 [PATCH] Fix goto last refile location Bernt Hansen
  2010-02-20 17:55 ` Bernt Hansen
@ 2010-02-20 19:37 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-02-20 19:37 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On Feb 20, 2010, at 6:50 PM, Bernt Hansen wrote:

> 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
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-20 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-20 17:50 [PATCH] Fix goto last refile location Bernt Hansen
2010-02-20 17:55 ` Bernt Hansen
2010-02-20 19:37 ` Carsten Dominik

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).