org-capture.el (org-capture-steal-local-variables): Don't steal `mark-active'

* org-capture.el (org-capture-steal-local-variables): Don't
steal `mark-active', which should be nil in the target buffer.

Thanks to Alex Kosorukoff for raising this issue.
This commit is contained in:
Bastien Guerry 2014-05-23 14:01:39 +02:00
parent 1d57e1ac9a
commit ee5a88cd01
1 changed files with 5 additions and 4 deletions

View File

@ -984,10 +984,11 @@ it. When it is a variable, retrieve the value. Return whatever we get."
(find-file-noselect (expand-file-name file org-directory)))))
(defun org-capture-steal-local-variables (buffer)
"Install Org-mode local variables of BUFFER."
(mapc (lambda (v)
(ignore-errors (org-set-local (car v) (cdr v))))
(buffer-local-variables buffer)))
"Install Org-mode local variables of BUFFER in the capture target buffer.
Take care of not installing `mark-active', which should be nil."
(mapc (lambda (v) (ignore-errors (org-set-local (car v) (cdr v))))
(org-remove-if (lambda(e) (eq (car e) 'mark-active))
(buffer-local-variables buffer))))
(defun org-capture-place-template (&optional inhibit-wconf-store)
"Insert the template at the target location, and display the buffer.