* org-capture in the same file from which it was called under certain heading
@ 2011-05-27 10:17 Rainer M Krug
2011-05-28 10:00 ` Memnon Anon
0 siblings, 1 reply; 7+ messages in thread
From: Rainer M Krug @ 2011-05-27 10:17 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 609 bytes --]
Hi
I would like to capture todo items, changes and other things in the file I
am working in (literate programming), but I am struggling: how can I specify
thet the file is the actual file I am working in?
Thanks,
Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax (F): +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer@krugs.de
Skype: RMkrug
[-- Attachment #2: Type: text/html, Size: 803 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: org-capture in the same file from which it was called under certain heading
2011-05-27 10:17 org-capture in the same file from which it was called under certain heading Rainer M Krug
@ 2011-05-28 10:00 ` Memnon Anon
2011-05-28 10:03 ` Rainer M Krug
0 siblings, 1 reply; 7+ messages in thread
From: Memnon Anon @ 2011-05-28 10:00 UTC (permalink / raw)
To: emacs-orgmode
Rainer M Krug <r.m.krug@gmail.com> writes:
> I would like to capture todo items, changes and other things in the
> file I am working in (literate programming), but I am struggling: how
> can I specify thet the file is the actual file I am working in?
Thats fun!
From the info manual on capture templates
to google "org capture "entry (function"" which led
to the mailing list archive (Thread start: http://tinyurl.com/3fj25gq)
to the git log:
,----
| commit 030960559e24b5b364b6237d223429b5050fc2f1
| Author: Bastien Guerry <bzg@altern.org>
| Date: Sun Mar 6 17:31:56 2011 +0100
|
| org-capture.el: remove (currentfile) as a file specification in templates.
|
| You can already use a function like (buffer-file-name) to get the currently
| visited file. So (currentfile) is not necessary.
`----
What a round trip :).
A quick test suggests this should do:
--8<---------------cut here---------------start------------->8---
("w"
"*TEST*: entry function currentfile"
entry
(file+headline (buffer-file-name) "Notes")
"* Eintrag")
--8<---------------cut here---------------end--------------->8---
This should file your capture item "* Eintrag" under the Node "* Notes"
in the buffer you called capture from.
Is that what you had in mind?
hth
Memnon
Tested with:
,----
| (setq org-capture-templates
| `(("w"
| "*TEST*: entry function currentfile"
| entry
| (file+headline (buffer-file-name) "Note")
| "* Eintrag")))
`----
on GNU Emacs 23.3.1 (i486-pc-linux-gnu, GTK+ Version 2.24.3)
of 2011-04-10 on raven, modified by Debian
with
Org-mode version 7.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: org-capture in the same file from which it was called under certain heading
2011-05-28 10:00 ` Memnon Anon
@ 2011-05-28 10:03 ` Rainer M Krug
2011-05-28 11:40 ` Yagnesh Raghava Yakkala
2011-05-28 12:15 ` Memnon Anon
0 siblings, 2 replies; 7+ messages in thread
From: Rainer M Krug @ 2011-05-28 10:03 UTC (permalink / raw)
To: Memnon Anon; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2340 bytes --]
On Sat, May 28, 2011 at 12:00 PM, Memnon Anon <
gegendosenfleisch@googlemail.com> wrote:
> Rainer M Krug <r.m.krug@gmail.com> writes:
>
> > I would like to capture todo items, changes and other things in the
> > file I am working in (literate programming), but I am struggling: how
> > can I specify thet the file is the actual file I am working in?
>
> Thats fun!
> From the info manual on capture templates
> to google "org capture "entry (function"" which led
> to the mailing list archive (Thread start: http://tinyurl.com/3fj25gq)
> to the git log:
>
> ,----
> | commit 030960559e24b5b364b6237d223429b5050fc2f1
> | Author: Bastien Guerry <bzg@altern.org>
> | Date: Sun Mar 6 17:31:56 2011 +0100
> |
> | org-capture.el: remove (currentfile) as a file specification in
> templates.
> |
> | You can already use a function like (buffer-file-name) to get the
> currently
> | visited file. So (currentfile) is not necessary.
> `----
>
> What a round trip :).
>
> A quick test suggests this should do:
>
> --8<---------------cut here---------------start------------->8---
> ("w"
> "*TEST*: entry function currentfile"
> entry
> (file+headline (buffer-file-name) "Notes")
> "* Eintrag")
> --8<---------------cut here---------------end--------------->8---
>
>
> This should file your capture item "* Eintrag" under the Node "* Notes"
> in the buffer you called capture from.
>
> Is that what you had in mind?
>
Yes - exactly that.
Now if this could go into the documentation of org-capture, that would be
great.
Thanks a lot,
Rainer
>
> hth
> Memnon
>
> Tested with:
> ,----
> | (setq org-capture-templates
> | `(("w"
> | "*TEST*: entry function currentfile"
> | entry
> | (file+headline (buffer-file-name) "Note")
> | "* Eintrag")))
> `----
> on GNU Emacs 23.3.1 (i486-pc-linux-gnu, GTK+ Version 2.24.3)
> of 2011-04-10 on raven, modified by Debian
> with
> Org-mode version 7.5
>
>
>
>
>
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax (F): +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer@krugs.de
Skype: RMkrug
[-- Attachment #2: Type: text/html, Size: 3336 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: org-capture in the same file from which it was called under certain heading
2011-05-28 10:03 ` Rainer M Krug
@ 2011-05-28 11:40 ` Yagnesh Raghava Yakkala
2011-05-28 13:15 ` Memnon Anon
2011-05-28 14:50 ` Bernt Hansen
2011-05-28 12:15 ` Memnon Anon
1 sibling, 2 replies; 7+ messages in thread
From: Yagnesh Raghava Yakkala @ 2011-05-28 11:40 UTC (permalink / raw)
To: emacs-orgmode
Rainer M Krug <r.m.krug@gmail.com> writes:
> On Sat, May 28, 2011 at 12:00 PM, Memnon Anon
> <gegendosenfleisch@googlemail.com> wrote:
>
> Rainer M Krug <r.m.krug@gmail.com> writes:
>
> > I would like to capture todo items, changes and other things in
> the
> > file I am working in (literate programming), but I am
> struggling: how
> > can I specify thet the file is the actual file I am working in?
>
>
> Thats fun!
> From the info manual on capture templates
> to google "org capture "entry (function"" which led
> to the mailing list archive (Thread start:
> http://tinyurl.com/3fj25gq)
> to the git log:
>
> ,----
> | commit 030960559e24b5b364b6237d223429b5050fc2f1
> | Author: Bastien Guerry <bzg@altern.org>
> | Date: Sun Mar 6 17:31:56 2011 +0100
> |
> | org-capture.el: remove (currentfile) as a file specification
> in templates.
> |
> | You can already use a function like (buffer-file-name) to
> get the currently
> | visited file. So (currentfile) is not necessary.
> `----
>
> What a round trip :).
>
> A quick test suggests this should do:
>
> --8<---------------cut here---------------start------------->8---
> ("w"
> "*TEST*: entry function currentfile"
> entry
> (file+headline (buffer-file-name) "Notes")
> "* Eintrag")
> --8<---------------cut here---------------end--------------->8---
>
>
> This should file your capture item "* Eintrag" under the Node "*
> Notes"
> in the buffer you called capture from.
>
> Is that what you had in mind?
>
>
> Yes - exactly that.
> Now if this could go into the documentation of org-capture, that would
> be great.
>
to extend the same, I have a similar requirement where I want to capture
subtasks of a TODO item as I am working on it. So the (TODO)node under
which I want to capture changes with the time. It would be good If there is a
way to specify capture destination dynamically(most of the time the
capture destination is under the current clocked item)
Thanks.,
Yagnesh.
<snip>
--
Your business will assume vast proportions.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: org-capture in the same file from which it was called under certain heading
2011-05-28 11:40 ` Yagnesh Raghava Yakkala
@ 2011-05-28 13:15 ` Memnon Anon
2011-05-28 14:50 ` Bernt Hansen
1 sibling, 0 replies; 7+ messages in thread
From: Memnon Anon @ 2011-05-28 13:15 UTC (permalink / raw)
To: emacs-orgmode
Hi,
Yagnesh Raghava Yakkala <yagnesh@live.com> writes:
> to extend the same, I have a similar requirement where I want to
> capture subtasks of a TODO item as I am working on it. So the
> (TODO)node under which I want to capture changes with the time. It
> would be good If there is a way to specify capture destination
> dynamically(most of the time the capture destination is under the
> current clocked item)
I think I now what you want, but to be sure, a simple example outline
would help.
Memnon
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: org-capture in the same file from which it was called under certain heading
2011-05-28 11:40 ` Yagnesh Raghava Yakkala
2011-05-28 13:15 ` Memnon Anon
@ 2011-05-28 14:50 ` Bernt Hansen
1 sibling, 0 replies; 7+ messages in thread
From: Bernt Hansen @ 2011-05-28 14:50 UTC (permalink / raw)
To: Yagnesh Raghava Yakkala; +Cc: emacs-orgmode
Yagnesh Raghava Yakkala <yagnesh@live.com> writes:
> to extend the same, I have a similar requirement where I want to capture
> subtasks of a TODO item as I am working on it. So the (TODO)node under
> which I want to capture changes with the time. It would be good If there is a
> way to specify capture destination dynamically(most of the time the
> capture destination is under the current clocked item)
In your capture buffer you can finish it with C-2 C-c C-w (instead of
C-c C-c) to file to the current clocking task.
Regards,
Bernt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: org-capture in the same file from which it was called under certain heading
2011-05-28 10:03 ` Rainer M Krug
2011-05-28 11:40 ` Yagnesh Raghava Yakkala
@ 2011-05-28 12:15 ` Memnon Anon
1 sibling, 0 replies; 7+ messages in thread
From: Memnon Anon @ 2011-05-28 12:15 UTC (permalink / raw)
To: emacs-orgmode
Rainer M Krug <r.m.krug@gmail.com> writes:
> Yes - exactly that. Now if this could go into the documentation of
> org-capture, that would be great.
The doc string of `org-capture-templates' concisely says:
,----
| A file can also be given as a variable, function, or Emacs Lisp
| form.
`----
So it is documented already.
(Note to self:
"Docstrings deserve closer attention. Do not only skim over them anymore!")
Might be worth a footnote in the manual.
OTOH, this seems to be sort of a corner case;
the manual should not try to encompass everything there is...
Memnon
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-28 14:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 10:17 org-capture in the same file from which it was called under certain heading Rainer M Krug
2011-05-28 10:00 ` Memnon Anon
2011-05-28 10:03 ` Rainer M Krug
2011-05-28 11:40 ` Yagnesh Raghava Yakkala
2011-05-28 13:15 ` Memnon Anon
2011-05-28 14:50 ` Bernt Hansen
2011-05-28 12:15 ` Memnon Anon
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).