diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-16 07:17:00 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-16 07:17:00 +0200 |
commit | a2c342308d83f10f38af184a87fd961123629b3d (patch) | |
tree | 8dc1c2347cbb2583a433020ccc974dc343561787 | |
parent | 00171622f20183b56cad7caacbb5be89d03e37f5 (diff) | |
download | org-mode-a2c342308d83f10f38af184a87fd961123629b3d.tar.gz |
Fix placing capture items at beginning of buffer.
* lisp/org-capture.el (org-capture-place-entry): If the first
line is already a headline, just stay there.
Patch by THomas Fuchs.
TINYCHANGE
> I'm trying to capture and file an entry as an top-level entry as first entry
> in an org file without config at the beginning (no "#+").
> This leads to filing the entry as _second_ headline in the org file.
> The template is:
> ("z" "test" entry (file "~/Data/z.org") "* %^{Note} %t :NOTE:\n %?"
> :prepend t)
>
> I think this is due to jumping over lines starting with "#+" at the
> beginning of the org file
> (line 715 in org-capture.el (org-capture-place-entry)).
> My file has no config header and starts with the first headline. Calling
> outline-next-heading
> in this situation leads to jumping to the second headline in the file.
-rw-r--r-- | lisp/org-capture.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index bd5e329..7915f7f 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -712,7 +712,8 @@ already gone." (setq level 1) (if reversed (progn (goto-char (point-min)) - (outline-next-heading)) + (or (org-at-heading-p) + (outline-next-heading))) (goto-char (point-max)) (or (bolp) (insert "\n")))) (t |