1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-25 07:27:57 +00:00

org-bibtex-headline-format-function: Factor out lambda default value

* lisp/ol-bibtex.el (org-bibtex-headline-format-default): New function
to be used as the default value of
`org-bibtex-headline-format-function'.
(org-bibtex-headline-format-function): Update the default value.

Link: https://orgmode.org/list/87edl71tyu.fsf@localhost
This commit is contained in:
Ihor Radchenko 2023-07-25 13:50:09 +03:00
parent 39de4a1848
commit ac0042184e
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -266,7 +266,7 @@ a missing title field."
:type 'boolean) :type 'boolean)
(defcustom org-bibtex-headline-format-function (defcustom org-bibtex-headline-format-function
(lambda (entry) (cdr (assq :title entry))) #'org-bibtex-headline-format-default
"Function returning the headline text for `org-bibtex-write'. "Function returning the headline text for `org-bibtex-write'.
It should take a single argument, the bibtex entry (an alist as It should take a single argument, the bibtex entry (an alist as
returned by `org-bibtex-read'). The default value simply returns returned by `org-bibtex-read'). The default value simply returns
@ -636,6 +636,10 @@ With prefix argument OPTIONAL also prompt for optional fields."
With prefix argument OPTIONAL also prompt for optional fields." With prefix argument OPTIONAL also prompt for optional fields."
(interactive) (org-map-entries (lambda () (org-bibtex-check optional)))) (interactive) (org-map-entries (lambda () (org-bibtex-check optional))))
(defun org-bibtex-headline-format-default (entry)
"Return headline text according to ENTRY title."
(cdr (assq :title entry)))
(defun org-bibtex-create (&optional arg nonew) (defun org-bibtex-create (&optional arg nonew)
"Create a new entry at the given level. "Create a new entry at the given level.
With a prefix arg, query for optional fields as well. With a prefix arg, query for optional fields as well.