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:44:41 +0100
commita6bac51c5bfb632d3e8a27ef1f4e00ed31a7c7dc (patch)
tree5bb825f3aa5ae10b3245793552b1e17c2873b25f
parenta6f8460487a559f77e49140ce1b1e1e17cbb8eff (diff)
downloadorg-mode-a6bac51c5bfb632d3e8a27ef1f4e00ed31a7c7dc.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 5822c2f..d0b0f5e 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))))