diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-23 01:53:18 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-23 01:53:18 +0200 |
commit | 9dbd2993f6d412b8ef92fc020ffef327ac5c48d6 (patch) | |
tree | 827c0fe8876938c6cf26a81e81590b67f1072ca3 | |
parent | b46d4e7b1c1245fbe0c52531e18a566c6eb2e45d (diff) | |
download | org-mode-9dbd2993f6d412b8ef92fc020ffef327ac5c48d6.tar.gz |
org-capture: Tiny refactoring
* lisp/org-capture.el (org-capture-place-entry): Tiny refactoring.
-rw-r--r-- | lisp/org-capture.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index c4d5d1c..153b17f 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1111,8 +1111,10 @@ may have been stored before." (defun org-capture-place-entry () "Place the template as a new Org entry." - (let ((reversed? (org-capture-get :prepend)) + (let ((template (org-capture-get :template)) + (reversed? (org-capture-get :prepend)) (level 1)) + (org-capture-verify-tree template) (when (org-capture-get :exact-position) (goto-char (org-capture-get :exact-position))) (cond @@ -1131,11 +1133,9 @@ may have been stored before." (let ((origin (point))) (unless (bolp) (insert "\n")) (org-capture-empty-lines-before) + (org-capture-position-for-last-stored (point)) (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)) + (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)) |