* org-capture: file to top level with prepend
@ 2010-10-03 4:01 Thomas Fuchs
2010-10-15 19:51 ` David Maus
2010-10-16 5:17 ` Carsten Dominik
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Fuchs @ 2010-10-03 4:01 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 757 bytes --]
Hi!
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.
The appended patch fixes this problem by checking if we are on a headline
and then skips jumping to next headline.
Regards
Thomas
[-- Attachment #1.2: Type: text/html, Size: 926 bytes --]
[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 408 bytes --]
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 6ce9cdd..4143f7b 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))
+ (if (not (org-at-heading-p))
+ (outline-next-heading)))
(goto-char (point-max))
(or (bolp) (insert "\n"))))
(t
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: org-capture: file to top level with prepend
2010-10-03 4:01 org-capture: file to top level with prepend Thomas Fuchs
@ 2010-10-15 19:51 ` David Maus
2010-10-16 5:17 ` Carsten Dominik
1 sibling, 0 replies; 3+ messages in thread
From: David Maus @ 2010-10-15 19:51 UTC (permalink / raw)
To: Thomas Fuchs; +Cc: emacs-orgmode
[-- Attachment #1.1.1: Type: text/plain, Size: 1135 bytes --]
At Sun, 3 Oct 2010 06:01:38 +0200,
Thomas Fuchs wrote:
>
> [1 <multipart/alternative (7bit)>]
> [1.1 <text/plain; ISO-8859-1 (7bit)>]
> Hi!
>
> 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.
>
> The appended patch fixes this problem by checking if we are on a headline
> and then skips jumping to next headline.
Just resending the patch: The patchtracker[1] didn't catch it because
it was attached as application/octet-stream.
Best,
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de
[-- Attachment #1.1.2: patch --]
[-- Type: text/plain, Size: 408 bytes --]
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 6ce9cdd..4143f7b 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))
+ (if (not (org-at-heading-p))
+ (outline-next-heading)))
(goto-char (point-max))
(or (bolp) (insert "\n"))))
(t
[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: org-capture: file to top level with prepend
2010-10-03 4:01 org-capture: file to top level with prepend Thomas Fuchs
2010-10-15 19:51 ` David Maus
@ 2010-10-16 5:17 ` Carsten Dominik
1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-10-16 5:17 UTC (permalink / raw)
To: Thomas Fuchs; +Cc: emacs-orgmode
Applied, thanks.
- Carsten
On Oct 3, 2010, at 6:01 AM, Thomas Fuchs wrote:
> Hi!
>
> 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.
>
> The appended patch fixes this problem by checking if we are on a
> headline
> and then skips jumping to next headline.
>
> Regards
> Thomas
>
>
>
> <patch>_______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-16 5:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-03 4:01 org-capture: file to top level with prepend Thomas Fuchs
2010-10-15 19:51 ` David Maus
2010-10-16 5:17 ` Carsten Dominik
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.