ソースを参照

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.
Bastien 5 年 前
コミット
5fc950a494
2 ファイル変更1 行追加2 行削除
  1. 1 1
      lisp/org-capture.el
  2. 0 1
      testing/lisp/test-org-capture.el

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

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