Subject: Re: bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value

From: Mauro Aranda <[email-masked]>
Date: Fri, 10 Jan 2025 12:34:03 -0300

Roland Winkler <[email-masked]> writes:

 > On Fri, Jan 10 2025, Mauro Aranda wrote:
 >> I tend to think that we should fix these problems by giving appropriate
 >> tags to the widgets used for user options, and leaving the cus-edit.el
 >> code as it is.
 >
 > I never understood in full glory how these widgets work with defcustom.
 > What would be a minimal example what the missing tag could look like for
 > bibtex-biblatex-entry-alist?  (Is this documented in the elisp manual?)
 >
 > Thanks.

Since the variable says it's an alist, I'd say:

(define-widget 'bibtex-entry-alist 'lazy
   "Format of `bibtex-BibTeX-entry-alist' and friends."
   :tag "Alist"
   :type '(repeat
           (choice (group :tag "Alias"
                          (string :tag "Entry type")
                          (string :tag "Documentation")
                          (string :tag "Alias"))
                   (group :tag "Entry"
                          (string :tag "Entry type")
                          (string :tag "Documentation")
                          (repeat :tag "Required fields" bibtex-field-list)
                          (repeat :tag "Crossref fields" bibtex-field-list)
                          (repeat :tag "Optional fields" 
bibtex-field-list)))))

And maybe it looks better if you do:
(define-widget 'bibtex-entry-alist 'lazy
   "Format of `bibtex-BibTeX-entry-alist' and friends."
   :tag "Alist"
   :type '(repeat
           :format "\n%v" ;; I think this looks better.
           (choice (group :tag "Alias"
                          (string :tag "Entry type")
                          (string :tag "Documentation")
                          (string :tag "Alias"))
                   (group :tag "Entry"
                          (string :tag "Entry type")
                          (string :tag "Documentation")
                          (repeat :tag "Required fields" bibtex-field-list)
                          (repeat :tag "Crossref fields" bibtex-field-list)
                          (repeat :tag "Optional fields" 
bibtex-field-list)))))

Both :format and :tag keywords are documented under:
15.4.4 Type Keywords