Better capturing of error when aborting capture

This commit is contained in:
Carsten Dominik 2010-06-27 12:26:08 +02:00
parent 1b2a21fdf7
commit f63d977c8b
1 changed files with 7 additions and 1 deletions

View File

@ -377,7 +377,12 @@ bypassed."
(or org-overriding-default-time
(org-current-time)))
(org-capture-set-target-location)
(org-capture-put :template (org-capture-fill-template))
(condition-case error
(org-capture-put :template (org-capture-fill-template))
((error quit)
(if (get-buffer "*Capture*") (kill-buffer "*Capture*"))
(error "Capture abort: %s" error)))
(if (equal goto 0)
;;insert at point
(org-capture-insert-template-here)
@ -998,6 +1003,7 @@ The template may still contain \"%?\" for cursor positioning."
(save-window-excursion
(delete-other-windows)
(switch-to-buffer (get-buffer-create "*Capture*"))
(erase-buffer)
(insert template)
(goto-char (point-min))
(org-capture-steal-local-variables buffer)