bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52143: 29.0.50; Customize type `group' displays a hanging colon


From: Brahimi Saifullah
Subject: bug#52143: 29.0.50; Customize type `group' displays a hanging colon
Date: Sat, 27 Nov 2021 10:10:26 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)

Using a `group' widget type inside a `defcustom' form will result in a rather
ugly hanging colon when displayed in the Customize buffer: 

    (defcustom foo '(1 2 3) ""
      :type '(group integer integer integer))

    M-x customize-option foo

JPEG image

After some digging, I found related bugs #31309 and #33566, the latter which
introduced the current `:format' as a workaround to an error.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31309
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33566

>From what I gather: a colon is necessary, for whatever reason.  So having a
tag-less type, as `group' claims to be, is not possible through normal means.

What *is* possible, however, is hiding the colon with a display text property
(The following should go in `group's `define-widget' form, at wid-edit.el):

    :format (concat (propertize ":" 'display "") "%v")

JPEG image

Or with a newline:

    :format (concat (propertize ":" 'display "") "\n%v")

JPEG image

Since the actual text remains unchanged, this should be harmless.  WDYT?

--------------------------------------------------------------------------------

This, of course, is merely polishing the workaround, the problem at its core
remains unchanged.  Though I am not yet privy to the inner working of Customize
and its widgets, all of this seems to stem from some questionable decisions at
`custom-variable-value-create'.

As someone mentioned in one of the linked bug reports that the widget code is
convoluted, I wonder, how well is this code understood? Or perhaps discussing
its behavior is pointless, if nobody can truly understand what the consequences
of righting these questionable decisions would be.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]