summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien <bzg@gnu.org>2020-02-07 20:43:50 +0100
committerBastien <bzg@gnu.org>2020-02-07 20:43:50 +0100
commit5fc950a494989e39f1735462e4e2e48cfdb2d9db (patch)
treed3aca78c1858f5186c89bffd386bfbda691848c2
parent44e7e34ed34ba53fe8a698d53bff143dff6c3d59 (diff)
downloadorg-mode-5fc950a494989e39f1735462e4e2e48cfdb2d9db.tar.gz
org-capture.el: Fix entry template insertion
* lisp/org-capture.el (org-capture-place-entry): Place point correctly before narrowing the buffer. * testing/lisp/test-org-capture.el (test-org-capture/entry): Fix test. Thanks to Bernt Hansen for reporting this.
-rw-r--r--lisp/org-capture.el2
-rw-r--r--testing/lisp/test-org-capture.el1
2 files changed, 1 insertions, 2 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 2d5e2f1..c4feae7 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1151,7 +1151,7 @@ may have been stored before."
(org-capture-empty-lines-after)
(unless (org-at-heading-p) (outline-next-heading))
(org-capture-mark-kill-region origin (point))
- (org-capture-narrow beg (1- (point)))
+ (org-capture-narrow beg (point))
(when (or (search-backward "%?" beg t)
(search-forward "%?" nil t))
(replace-match ""))))))
diff --git a/testing/lisp/test-org-capture.el b/testing/lisp/test-org-capture.el
index 124ef43..10cfcbf 100644
--- a/testing/lisp/test-org-capture.el
+++ b/testing/lisp/test-org-capture.el
@@ -208,7 +208,6 @@
(org-capture-templates
`(("t" "Todo" entry (file+headline ,file "A") "** H1 %?"))))
(org-capture nil "t")
- (goto-char (point-max))
(insert "Capture text")
(org-capture-finalize))
(buffer-string))))