summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-03-13 10:44:41 +0100
committerBastien Guerry <bzg@altern.org>2014-03-13 10:45:08 +0100
commit94f104ad5c9f25e13e9f21b24eb497513646821b (patch)
tree63e503f86167f6352e7fa791d27510847386d1d3
parentf94ed64ffd8941cb919295e6de63ec67b9c00564 (diff)
downloadorg-mode-94f104ad5c9f25e13e9f21b24eb497513646821b.tar.gz
org-capture.el: Fix wrong narrowing with :prepend set to `t'
* org-capture.el (org-capture-finalize): Ensure to widen the buffer when the target buffer is not initially narrowed. Thanks to Adam Spiers and Thomas Proschinger for reporting this bug.
-rw-r--r--lisp/org-capture.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 8eaa313..0433306 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -741,7 +741,8 @@ captured item after finalizing."
(pos (org-capture-get :initial-target-position))
(ipt (org-capture-get :insertion-point))
(size (org-capture-get :captured-entry-size)))
- (when reg
+ (if (not reg)
+ (widen)
(cond ((< ipt (car reg))
;; insertion point is before the narrowed region
(narrow-to-region (+ size (car reg)) (+ size (cdr reg))))