all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brahimi Saifullah <brahimi.saifullah@gmail.com>
To: 52143@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	[thread overview]
Message-ID: <84wnkthhh9.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

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


[-- Attachment #2: `group' widget -- current behavior --]
[-- Type: image/jpeg, Size: 8218 bytes --]

[-- Attachment #3: Type: text/plain, Size: 611 bytes --]


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")


[-- Attachment #4: `group' widget -- 1st proposal --]
[-- Type: image/jpeg, Size: 9344 bytes --]

[-- Attachment #5: Type: text/plain, Size: 79 bytes --]


Or with a newline:

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


[-- Attachment #6: `group' widget -- 2nd proposal --]
[-- Type: image/jpeg, Size: 9251 bytes --]

[-- Attachment #7: Type: text/plain, Size: 715 bytes --]


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	other threads:[~2021-11-27 13:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 13:10 Brahimi Saifullah [this message]
2021-11-28 16:16 ` bug#52143: 29.0.50; Customize type `group' displays a hanging colon martin rudalics
2021-11-29 15:53 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84wnkthhh9.fsf@gmail.com \
    --to=brahimi.saifullah@gmail.com \
    --cc=52143@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.