Hello, Eric Danan <eric.da...@u-cergy.fr> 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