Explorar o código

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.
Bastien Guerry %!s(int64=11) %!d(string=hai) anos
pai
achega
94f104ad5c
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lisp/org-capture.el

+ 2 - 1
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))))