* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
@ 2024-11-17 22:42 Roland Winkler
2024-11-24 10:40 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Roland Winkler @ 2024-11-17 22:42 UTC (permalink / raw)
To: 74409
In emacs -Q load BibTeX mode and run
M-x customize-variable RET
bibtex-biblatex-entry-alist RET
The top of the customize buffer is clogged with the unformatted
variable value that hides the actual customization buffer.
I do not know whether this is related to bug #53606. Like bug #53606,
the problem did not exist in earlier version of emacs (say, emacs 26.3).
But it started some time ago (confirmed with emacs 28.2).
Nothing changed on the side of BibTeX mode back then.
In GNU Emacs 30.0.92 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.16.0) of 2024-11-01 built on regnitz
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
2024-11-17 22:42 bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value Roland Winkler
@ 2024-11-24 10:40 ` Eli Zaretskii
2025-01-10 14:31 ` Mauro Aranda
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-11-24 10:40 UTC (permalink / raw)
To: Roland Winkler; +Cc: 74409
> From: Roland Winkler <winkler@gnu.org>
> Date: Sun, 17 Nov 2024 16:42:10 -0600
>
>
> In emacs -Q load BibTeX mode and run
>
> M-x customize-variable RET
> bibtex-biblatex-entry-alist RET
>
> The top of the customize buffer is clogged with the unformatted
> variable value that hides the actual customization buffer.
>
> I do not know whether this is related to bug #53606. Like bug #53606,
> the problem did not exist in earlier version of emacs (say, emacs 26.3).
> But it started some time ago (confirmed with emacs 28.2).
> Nothing changed on the side of BibTeX mode back then.
It looks like the value of the variable was not shown in Emacs 26, but
is shown now. Bisecting to find the offending commit would be highly
appreciated.
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
2024-11-24 10:40 ` Eli Zaretskii
@ 2025-01-10 14:31 ` Mauro Aranda
2025-01-10 14:48 ` Eli Zaretskii
2025-01-10 15:08 ` Roland Winkler
0 siblings, 2 replies; 8+ messages in thread
From: Mauro Aranda @ 2025-01-10 14:31 UTC (permalink / raw)
To: Eli Zaretskii, Roland Winkler; +Cc: 74409
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Roland Winkler <winkler@gnu.org>
>> Date: Sun, 17 Nov 2024 16:42:10 -0600
>>
>>
>> In emacs -Q load BibTeX mode and run
>>
>> M-x customize-variable RET
>> bibtex-biblatex-entry-alist RET
>>
>> The top of the customize buffer is clogged with the unformatted
>> variable value that hides the actual customization buffer.
>>
>> I do not know whether this is related to bug #53606. Like bug #53606,
>> the problem did not exist in earlier version of emacs (say, emacs 26.3).
>> But it started some time ago (confirmed with emacs 28.2).
>> Nothing changed on the side of BibTeX mode back then.
>
> It looks like the value of the variable was not shown in Emacs 26, but
> is shown now. Bisecting to find the offending commit would be highly
> appreciated.
>
> Thanks.
I can't build Emacs 26 for some reason, but it's very likely that this
is a result of my change for Bug#35133:
commit 897b8561cdc856fb40b2a3c6f29230849aaf4a34
Author: Mauro Aranda <maurooaranda@gmail.com>
Date: Sun Dec 13 10:44:30 2020 -0300
Stop dropping the tag when creating the custom-variable widget
* lisp/cus-edit.el (custom-variable-value-create): Obey the specified
tag format when creating the variable tag, but stop dropping the tag
format for the variable's type widget, since the tag can be used to
give useful information to the user about the variable. (Bug#35133)
The lazy widget (from which the widget bibtex-entry-alist derives),
prints its :tag. Since there's no explicit :tag in bibtex-entry-alist,
and neither in the definition of the lazy widget, all of the widget
value gets printed.
Before my change, we dropped the tag (so no value printing for
bibtex-biblatex-entry-alist), but that wasn't a very good idea (see
Bug#35133), since we were overriding valuable info the defcustom writer
could have given to the Customize user.
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
2025-01-10 14:31 ` Mauro Aranda
@ 2025-01-10 14:48 ` Eli Zaretskii
2025-01-10 15:08 ` Roland Winkler
1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2025-01-10 14:48 UTC (permalink / raw)
To: Mauro Aranda; +Cc: 74409, winkler
> Date: Fri, 10 Jan 2025 11:31:28 -0300
> Cc: 74409@debbugs.gnu.org
> From: Mauro Aranda <maurooaranda@gmail.com>
>
> 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.
Such a solution would be fine with me, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
2025-01-10 14:31 ` Mauro Aranda
2025-01-10 14:48 ` Eli Zaretskii
@ 2025-01-10 15:08 ` Roland Winkler
2025-01-10 15:34 ` Mauro Aranda
1 sibling, 1 reply; 8+ messages in thread
From: Roland Winkler @ 2025-01-10 15:08 UTC (permalink / raw)
To: Mauro Aranda; +Cc: 74409, Eli Zaretskii
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
2025-01-10 15:08 ` Roland Winkler
@ 2025-01-10 15:34 ` Mauro Aranda
2025-01-10 16:01 ` Roland Winkler
0 siblings, 1 reply; 8+ messages in thread
From: Mauro Aranda @ 2025-01-10 15:34 UTC (permalink / raw)
To: Roland Winkler; +Cc: 74409, Eli Zaretskii
Roland Winkler <winkler@gnu.org> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
2025-01-10 15:34 ` Mauro Aranda
@ 2025-01-10 16:01 ` Roland Winkler
2025-01-10 17:32 ` Mauro Aranda
0 siblings, 1 reply; 8+ messages in thread
From: Roland Winkler @ 2025-01-10 16:01 UTC (permalink / raw)
To: Mauro Aranda; +Cc: 74409, Eli Zaretskii
On Fri, Jan 10 2025, Mauro Aranda wrote:
> Since the variable says it's an alist, I'd say:
Thanks, these real-world examples are very helpful, I'll try this out.
> Both :format and :tag keywords are documented under: 15.4.4 Type
> Keywords
My understanding of what is documented there has been that these
keywords are certainly useful, but always optional. But this bug report
shows that not having the :tag keyword can have rather undesirable side
effects. So I was wondering whether the documentation could gently
indicate that not having a :tag keyword should be avoided (in what
context?). -- But I do not understand enough details whether the fairly
complex customization declarations for bibtex-biblatex-entry-alist that
triggered this bug report are too specific a use case to justify this.
What you say suggests to me that the present bug report #74409 has
nothing to do with #53606. The latter has bothered me yet more. If you
happen to be able to shine light on that one, too, that would be great.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value
2025-01-10 16:01 ` Roland Winkler
@ 2025-01-10 17:32 ` Mauro Aranda
0 siblings, 0 replies; 8+ messages in thread
From: Mauro Aranda @ 2025-01-10 17:32 UTC (permalink / raw)
To: Roland Winkler; +Cc: 74409, Eli Zaretskii
Roland Winkler <winkler@gnu.org> writes:
> On Fri, Jan 10 2025, Mauro Aranda wrote:
>> Both :format and :tag keywords are documented under: 15.4.4 Type
>> Keywords
>
> My understanding of what is documented there has been that these
> keywords are certainly useful, but always optional. But this bug report
> shows that not having the :tag keyword can have rather undesirable side
> effects. So I was wondering whether the documentation could gently
> indicate that not having a :tag keyword should be avoided (in what
> context?). -- But I do not understand enough details whether the fairly
> complex customization declarations for bibtex-biblatex-entry-alist that
> triggered this bug report are too specific a use case to justify this.
I see, yes. Docs could be improved here. Not having a :tag, is almost
never a good idea. This would be specific to the section Defining New
Types.
> What you say suggests to me that the present bug report #74409 has
> nothing to do with #53606. The latter has bothered me yet more. If you
> happen to be able to shine light on that one, too, that would be great.
Yes, nothing to do with it. I think the patch to wid-edit.el I posted
back in 2023 is the right approach to improving that situation.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-01-10 17:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-17 22:42 bug#74409: 30.0.92; customize buffer for bibtex-biblatex-entry-alist also shows unformatted variable value Roland Winkler
2024-11-24 10:40 ` Eli Zaretskii
2025-01-10 14:31 ` Mauro Aranda
2025-01-10 14:48 ` Eli Zaretskii
2025-01-10 15:08 ` Roland Winkler
2025-01-10 15:34 ` Mauro Aranda
2025-01-10 16:01 ` Roland Winkler
2025-01-10 17:32 ` Mauro Aranda
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.