From c76486d4e431bf0c67d371341eb28445e7de4517 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 23 Oct 2018 01:32:55 +0200 Subject: [PATCH] org-capture: Fix off-by-one error * lisp/org-capture.el (org-capture-place-table-line): Fix narrowing. --- lisp/org-capture.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index f327bd0d1..ff8080800 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1279,7 +1279,9 @@ may have been stored before." (point)))) (org-capture-position-for-last-stored 'table-line) (org-capture-mark-kill-region origin end) - (org-capture-narrow beg end) + ;; TEXT is guaranteed to end with a newline character. Ignore + ;; it when narrowing so as to not alter data on the next line. + (org-capture-narrow beg (1- end)) (when (or (search-backward "%?" beg t) (search-forward "%?" end t)) (replace-match ""))) -- 2.11.4.GIT