|
@@ -1128,21 +1128,22 @@ may have been stored before."
|
|
|
(unless (org-at-heading-p) (outline-next-heading)))
|
|
|
;; Otherwise, insert as a top-level entry at the end of the file.
|
|
|
(t (goto-char (point-max))))
|
|
|
- (let ((beg (point))
|
|
|
- (template (org-capture-get :template)))
|
|
|
+ (let ((origin (point)))
|
|
|
(unless (bolp) (insert "\n"))
|
|
|
(org-capture-empty-lines-before)
|
|
|
- (org-capture-verify-tree template)
|
|
|
- (org-paste-subtree level template 'for-yank)
|
|
|
- (org-capture-empty-lines-after)
|
|
|
- (org-capture-position-for-last-stored beg)
|
|
|
- (unless (org-at-heading-p) (outline-next-heading))
|
|
|
- (org-capture-mark-kill-region beg (point))
|
|
|
- (let ((end (if (org-at-heading-p) (line-end-position 0) (point))))
|
|
|
- (org-capture-narrow beg end)
|
|
|
- (when (or (search-backward "%?" beg t)
|
|
|
- (search-forward "%?" end t))
|
|
|
- (replace-match ""))))))
|
|
|
+ (let ((beg (point)))
|
|
|
+ (org-capture-position-for-last-stored beg)
|
|
|
+ (let ((template (org-capture-get :template)))
|
|
|
+ (org-capture-verify-tree template)
|
|
|
+ (org-paste-subtree level template 'for-yank))
|
|
|
+ (let ((end (if (org-at-heading-p) (line-end-position 0) (point))))
|
|
|
+ (org-capture-empty-lines-after)
|
|
|
+ (unless (org-at-heading-p) (outline-next-heading))
|
|
|
+ (org-capture-mark-kill-region origin (point))
|
|
|
+ (org-capture-narrow beg end)
|
|
|
+ (when (or (search-backward "%?" beg t)
|
|
|
+ (search-forward "%?" end t))
|
|
|
+ (replace-match "")))))))
|
|
|
|
|
|
(defun org-capture-place-item ()
|
|
|
"Place the template as a new plain list item."
|