* Viewing the default capture template
@ 2024-12-24 23:47 Christopher Howard
2024-12-25 19:49 ` Michael Heerdegen via Users list for the GNU Emacs text editor
0 siblings, 1 reply; 6+ messages in thread
From: Christopher Howard @ 2024-12-24 23:47 UTC (permalink / raw)
To: Help Gnu Emacs Mailing List
Hi, I want to make a an org capture template that is a little different from the default one used when in an EWW buffer. Can I see what that default template is through some interactive command, or do I have to search through EWW source code to find it?
--
📛 Christopher Howard
🚀 gemini://gem.librehacker.com
🌐 http://gem.librehacker.com
בראשית ברא אלהים את השמים ואת הארץ
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Viewing the default capture template
2024-12-24 23:47 Viewing the default capture template Christopher Howard
@ 2024-12-25 19:49 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-26 16:14 ` Christopher Howard
0 siblings, 1 reply; 6+ messages in thread
From: Michael Heerdegen via Users list for the GNU Emacs text editor @ 2024-12-25 19:49 UTC (permalink / raw)
To: help-gnu-emacs
Christopher Howard <christopher@librehacker.com> writes:
> Hi, I want to make a an org capture template that is a little
> different from the default one used when in an EWW buffer. Can I see
> what that default template is through some interactive command, or do
> I have to search through EWW source code to find it?
Does eww have an associated separate org capture template? I don't see
anything like that defined in eww.el...
We have ol-eww.el which makes "`org-store-link' (often on key C-c l) in
an EWW buffer store a link to the current url of the eww buffer." - but
I guess you don't mean that.
Michael.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Viewing the default capture template
2024-12-25 19:49 ` Michael Heerdegen via Users list for the GNU Emacs text editor
@ 2024-12-26 16:14 ` Christopher Howard
2024-12-26 22:35 ` Michael Heerdegen via Users list for the GNU Emacs text editor
0 siblings, 1 reply; 6+ messages in thread
From: Christopher Howard @ 2024-12-26 16:14 UTC (permalink / raw)
To: Michael Heerdegen via Users list for the GNU Emacs text editor
Cc: Michael Heerdegen
Michael Heerdegen via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:
> Does eww have an associated separate org capture template? I don't see
> anything like that defined in eww.el...
I think this is basically the question I'm asking. If I don't pass a template in for the org-capture-templates list entry, whatever is used by default somehow works in EWW buffers, generating a proper org link with title. I want to see what that template is, so I can make something similar.
>
> We have ol-eww.el which makes "`org-store-link' (often on key C-c l) in
> an EWW buffer store a link to the current url of the eww buffer." - but
> I guess you don't mean that.
Perhaps the capture system calls org-store-link at some point. Not sure.
--
Christopher Howard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Viewing the default capture template
@ 2024-12-26 22:19 Christopher Howard
2024-12-26 22:45 ` Michael Heerdegen via Users list for the GNU Emacs text editor
0 siblings, 1 reply; 6+ messages in thread
From: Christopher Howard @ 2024-12-26 22:19 UTC (permalink / raw)
To: Michael Heerdegen via Users list for the GNU Emacs text editor
Cc: Michael Heerdegen
For posterity: the same default template string is used for all captures, if you don't specify one. The docstring for org-capture-templates indicates it is...
```
\"* %?\n %a\"
```
The %a refers to the annotation:
```
%a Annotation, normally the link created with `org-store-link'.
```
--
Christopher Howard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Viewing the default capture template
2024-12-26 16:14 ` Christopher Howard
@ 2024-12-26 22:35 ` Michael Heerdegen via Users list for the GNU Emacs text editor
0 siblings, 0 replies; 6+ messages in thread
From: Michael Heerdegen via Users list for the GNU Emacs text editor @ 2024-12-26 22:35 UTC (permalink / raw)
To: help-gnu-emacs
Christopher Howard <christopher@librehacker.com> writes:
> > Does eww have an associated separate org capture template? I don't see
> > anything like that defined in eww.el...
>
> I think this is basically the question I'm asking. If I don't pass a
> template in for the org-capture-templates list entry, whatever is used
> by default somehow works in EWW buffers, generating a proper org link
> with title. I want to see what that template is, so I can make
> something similar.
Did you bind or customize `org-capture-templates'? The default is nil.
With the default of nil `org-capture' offers only one template as far as
I understand, which is hardcoded in `org-capture-select-template' - this
one:
#+begin_src emacs-lisp
("t" "Task" entry (file+headline "" "Tasks")
"* TODO %?\n %u\n %a")
#+end_src
Is this the template you are using?
Michael.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Viewing the default capture template
2024-12-26 22:19 Christopher Howard
@ 2024-12-26 22:45 ` Michael Heerdegen via Users list for the GNU Emacs text editor
0 siblings, 0 replies; 6+ messages in thread
From: Michael Heerdegen via Users list for the GNU Emacs text editor @ 2024-12-26 22:45 UTC (permalink / raw)
To: help-gnu-emacs
Christopher Howard <christopher@librehacker.com> writes:
> For posterity: the same default template string is used for all
> captures, if you don't specify one. The docstring for
> org-capture-templates indicates it is...
>
> ```
> \"* %?\n %a\"
> ```
>
> The %a refers to the annotation:
>
> ```
> %a Annotation, normally the link created with `org-store-link'.
> ```
Oh - you already had found that, good.
If you are even more curious: the code that fills the template is in -
surprise! - `org-capture-fill-template'. "%a" gets expanded to the
value of this expression:
#+begin_src emacs-lisp
(let ((a (or (plist-get org-store-link-plist :annotation)
annotation
(org-capture-get :annotation)
"")))
;; Is the link empty? Then we do not want it...
(if (equal a "[[]]") "" a))
#+end_src
look for a helper var named `v-a' in that defun.
Michael.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-26 22:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-24 23:47 Viewing the default capture template Christopher Howard
2024-12-25 19:49 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-26 16:14 ` Christopher Howard
2024-12-26 22:35 ` Michael Heerdegen via Users list for the GNU Emacs text editor
-- strict thread matches above, loose matches on Subject: below --
2024-12-26 22:19 Christopher Howard
2024-12-26 22:45 ` Michael Heerdegen via Users list for the GNU Emacs text editor
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.