[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: org-capture-templates constructed from three distinct functions
From: |
Christopher Dimech |
Subject: |
Re: org-capture-templates constructed from three distinct functions |
Date: |
Sat, 12 Dec 2020 04:58:24 +0100 |
> 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.
>
>
>
- Re: org-capture-templates constructed from three distinct functions, (continued)
- Re: org-capture-templates constructed from three distinct functions, Michael Heerdegen, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Christopher Dimech, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Michael Heerdegen, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Christopher Dimech, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Christopher Dimech, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Christopher Dimech, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Christopher Dimech, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Christopher Dimech, 2020/12/11
- Re: org-capture-templates constructed from three distinct functions, Michael Heerdegen, 2020/12/12
- Re: org-capture-templates constructed from three distinct functions, Christopher Dimech, 2020/12/12
- Re: org-capture-templates constructed from three distinct functions,
Christopher Dimech <=
- Re: org-capture-templates constructed from three distinct functions, Michael Heerdegen, 2020/12/12