diff options
author | Bastien Guerry <bzg@altern.org> | 2013-11-06 15:52:15 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-11-06 15:52:15 +0100 |
commit | 17eda87a393d69a47e98d18596e69c75992149d0 (patch) | |
tree | d519acfdb7152bd808bdb3701005edfc5569ec44 | |
parent | 990339ea23a9b220d8eb97f246d94b35fc38c431 (diff) | |
parent | 747f46aa1f94fc8375fddd3620e15b9b0c0ff86e (diff) | |
download | org-mode-17eda87a393d69a47e98d18596e69c75992149d0.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-capture.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 871382d..804539e 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -577,8 +577,9 @@ of the day at point (if any) or the current HH:MM time." (file-name-nondirectory (buffer-file-name orig-buf))) :annotation annotation - :initial initial) - (org-capture-put :default-time + :initial initial + :return-to-wconf (current-window-configuration) + :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) @@ -593,7 +594,8 @@ of the day at point (if any) or the current HH:MM time." ;;insert at point (org-capture-insert-template-here) (condition-case error - (org-capture-place-template) + (org-capture-place-template + (equal (car (org-capture-get :target)) 'function)) ((error quit) (if (and (buffer-base-buffer (current-buffer)) (string-match "\\`CAPTURE-" (buffer-name))) @@ -986,9 +988,12 @@ it. When it is a variable, retrieve the value. Return whatever we get." (ignore-errors (org-set-local (car v) (cdr v)))) (buffer-local-variables buffer))) -(defun org-capture-place-template () - "Insert the template at the target location, and display the buffer." - (org-capture-put :return-to-wconf (current-window-configuration)) +(defun org-capture-place-template (&optional inhibit-wconf-store) + "Insert the template at the target location, and display the buffer. +When `inhibit-wconf-store', don't store the window configuration, as it +may have been stored before." + (unless inhibit-wconf-store + (org-capture-put :return-to-wconf (current-window-configuration))) (delete-other-windows) (org-switch-to-buffer-other-window (org-capture-get-indirect-buffer (org-capture-get :buffer) "CAPTURE")) |