sorry, I accidentally sent my previous patch. This is the one that belongs
here.


On Thu, May 1, 2014 at 7:00 PM, Alex Kosorukoff <a...@3form.com> wrote:

> Hello:
>
> this is another small patch to org-capture.el to make sure that after
> completion it returns to the same place from where it was invoked. This way
> users won't loose track of where they were before capturing something. The
> minimal setup to reproduce the case where capture fails to return to the
> place of its invocation is attached.
>
> Best,
> Alex
>
From cf97dd81aa94510e5dcd5be478b515c732cd93d4 Mon Sep 17 00:00:00 2001
From: Alex Kosorukoff <a...@3form.com>
Date: Thu, 1 May 2014 18:50:43 -0700
Subject: [PATCH] org-capture: fix org-capture to make it save the point position

* lisp/org-capture.el (org-capture-fill template) can change the point
  position in the buffer where capture was invoked, so user may not return
  to the same place after capture completion
---
 lisp/org-capture.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index c053640..1e3ae5b 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -584,7 +584,9 @@ of the day at point (if any) or the current HH:MM time."
 			     (org-current-time)))
 	(org-capture-set-target-location)
 	(condition-case error
-	    (org-capture-put :template (org-capture-fill-template))
+	    (org-capture-put :template
+			     (save-excursion
+			       (org-capture-fill-template)))
 	  ((error quit)
 	   (if (get-buffer "*Capture*") (kill-buffer "*Capture*"))
 	   (error "Capture abort: %s" error)))
-- 
1.7.0.4

Reply via email to