From: Christopher Dimech <dimech@gmx.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: org-capture-templates constructed from three distinct functions
Date: Sat, 12 Dec 2020 04:58:24 +0100 [thread overview]
Message-ID: <trinity-7a1d2868-a654-4fb1-b84e-488579958e7c-1607745504926@3c-app-mailcom-bs06> (raw)
In-Reply-To: <87o8izzo2l.fsf@web.de>
> Sent: Saturday, December 12, 2020 at 4:43 AM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: org-capture-templates constructed from three distinct functions
>
> Christopher Dimech <dimech@gmx.com> writes:
>
> > (defun captr-tdr ()
> > (interactive)
> > (setq org-capture-templates 'captr-templ-tdr))
> ^
> You want the binding of the variable, that quote is wrong.
>
> Appending template lists has the problem that you get copies added if
> you accidentally reevalute your code.
>
> You might want to consider to use `add-to-list' or `cl-pushnew' to avoid
> this problem, or, alternatively, interpret and handle
> `org-capture-templates' as an association list (with the key binding as
> key and the definition as value).
How would an association list look like for this one book template, if I may ask?
> Then you could use `setf' with
> `alist-get' to add or even modify or delete entries. This is a very
> clean and convenient but more learning involving way to achieve this.
>
> BTW, it should be possible to use buffer local `org-capture-templates'
> binding.
>
> > (global-set-key (kbd "H-c") #'captr-tdr)
>
> Why do you want to use a key for this (instead of just evaluating the
> code directly in your init file)?
>
>
> Regards,
>
> Michael.
>
>
>
next prev parent reply other threads:[~2020-12-12 3:58 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-12 1:14 org-capture-templates constructed from three distinct functions Christopher Dimech
2020-12-12 1:48 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-12 2:05 ` Christopher Dimech
2020-12-12 2:14 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-12 2:17 ` Christopher Dimech
2020-12-12 2:21 ` Christopher Dimech
2020-12-12 2:30 ` Christopher Dimech
2020-12-12 2:38 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-12 2:43 ` Christopher Dimech
2020-12-12 2:56 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-12 3:00 ` Christopher Dimech
2020-12-12 3:34 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-12 9:02 ` tomas
2020-12-12 9:43 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-12 2:09 ` Christopher Dimech
2020-12-12 3:16 ` Michael Heerdegen
2020-12-12 3:24 ` Christopher Dimech
2020-12-12 3:43 ` Michael Heerdegen
2020-12-12 3:51 ` Christopher Dimech
2020-12-12 3:57 ` Michael Heerdegen
2020-12-12 4:02 ` Christopher Dimech
2020-12-12 4:14 ` Christopher Dimech
2020-12-12 4:18 ` Christopher Dimech
2020-12-12 4:31 ` Christopher Dimech
2020-12-12 4:54 ` Christopher Dimech
2020-12-12 22:47 ` Michael Heerdegen
2020-12-12 22:55 ` Christopher Dimech
2020-12-12 3:58 ` Christopher Dimech [this message]
2020-12-12 22:51 ` Michael Heerdegen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-7a1d2868-a654-4fb1-b84e-488579958e7c-1607745504926@3c-app-mailcom-bs06 \
--to=dimech@gmx.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).