[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] org-bibtex.el: Make headline format costomizable
From: |
Nicolas Goaziou |
Subject: |
Re: [O] [PATCH] org-bibtex.el: Make headline format costomizable |
Date: |
Sat, 03 Dec 2016 08:59:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hello,
Eric Danan <address@hidden> writes:
> When adding an org-bibtex entry with `org-bibtex-write' (or any
> command relying on it), the headline is the title. The patch below
> simply makes the headline customizable through a new variable.
Thank you.
> If you find it worth to incorporate this into org-bibtex I should
> probably add a dosctring for the new variable
Yes, please. Also, an entry in ORG-NEWS is welcome.
> `org-bibtex-headline-format' and I would also have a few questions:
> 1. Should I name this variable differently?
Indeed. It should indicate it represents a function:
`org-bibltex-headline-format-function' is better, IMO, since a "format"
could be a format string.
> 2. Should I use `defcustom' instead of `defvar'?
Correct. Mind the :version and :package-version keywords.
> 3. Should I move the `defvar' / `defcustom' at the beginning of the file?
Yes.
> 4. In the default value of the variable should I make use of the `val'
> function that is let-bound inside `org-bibtex-write'?
I think the default value is fine. Another option is to create a new
`org-bibtex-headline-default' function and bound the variable to that.
> +(defvar org-bibtex-headline-format
> + (lambda (entry)
> + (cdr (assoc :title entry))))
Nitpick
`assoc' -> `assq'
Regards,
--
Nicolas Goaziou
- Re: [O] [PATCH] org-bibtex.el: Make headline format costomizable,
Nicolas Goaziou <=