GNU bug report logs - #52143
29.0.50; Customize type `group' displays a hanging colon

Previous Next

Package: emacs;

Reported by: Brahimi Saifullah <brahimi.saifullah <at> gmail.com>

Date: Sat, 27 Nov 2021 13:11:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Brahimi Saifullah <brahimi.saifullah <at> gmail.com>
To: 52143 <at> debbugs.gnu.org
Subject: bug#52143: 29.0.50; Customize type `group' displays a hanging colon
Date: Sat, 27 Nov 2021 10:10:26 -0300
[Message part 1 (text/plain, inline)]
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

[group-1.jpg (image/jpeg, inline)]
[Message part 3 (text/plain, inline)]
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")

[group-2.jpg (image/jpeg, inline)]
[Message part 5 (text/plain, inline)]
Or with a newline:

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

[group-3.jpg (image/jpeg, inline)]
[Message part 7 (text/plain, inline)]
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.



This bug report was last modified 3 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.