1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

New user option bibtex-entry-ask-for-key

This commit is contained in:
Roland Winkler 2024-11-14 23:26:23 -06:00
parent df288d2e41
commit cc9188b190
2 changed files with 14 additions and 1 deletions

View File

@ -618,6 +618,12 @@ functionality of the standard 'xref' commands in TeX buffers. You can
restore the standard 'etags' backend with the 'M-x xref-etags-mode'
toggle.
** BibTeX mode
---
*** New user option 'bibtex-entry-ask-for-key'.
When enabled, 'bibtex-entry' asks for a key.
** Midnight mode
---

View File

@ -1377,6 +1377,12 @@ and must return a string (the key to use)."
:version "28.1"
:type 'function)
(defcustom bibtex-entry-ask-for-key t
"If non-nil, `bibtex-entry' asks for a key."
:group 'bibtex
:version "31.1"
:type 'boolean)
(defcustom bibtex-entry-offset 0
"Offset for BibTeX entries.
Added to the value of all other variables which determine columns."
@ -3852,7 +3858,8 @@ is non-nil."
(let ((completion-ignore-case t))
(list (completing-read "Entry Type: " bibtex-entry-alist
nil t nil 'bibtex-entry-type-history))))
(let ((key (if bibtex-maintain-sorted-entries
(let ((key (if (and bibtex-maintain-sorted-entries
bibtex-entry-ask-for-key)
(bibtex-read-key (format "%s key: " entry-type))))
(field-list (bibtex-field-list entry-type)))
(unless (bibtex-prepare-new-entry (list key nil entry-type))