GNU bug report logs - #35133
26.1; 1) `:tag' for `restricted-sexp' (not in a choice, set, etc.), 2) Remove `Value Menu' if a no-op

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 4 Apr 2019 03:10:01 UTC

Severity: minor

Tags: fixed

Found in version 26.1

Fixed in version 28.1

Done: Mauro Aranda <maurooaranda <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 35133 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: bug#35133: 26.1; 1) `:tag' for `restricted-sexp' (not in a choice, set, etc.), 2) Remove `Value Menu' if a no-op
Date: Wed, 9 Dec 2020 19:27:31 -0300
[Message part 1 (text/plain, inline)]
> Drew Adams <drew.adams <at> oracle.com> writes:
>
> > 1. Use `M-x customize-option' for each of these:
> >
> > (defcustom foo 42
> >   "Foo..."
> >   :type '(restricted-sexp
> >           :tag "Positive integer"
> >           :match-alternatives ((lambda (x) (and (natnump x)  (not
(zerop x)))))
> >           :value ignore))
> >
> > (defcustom bar 42
> >   "Bar..."
> >   :type '(choice (restricted-sexp
> >                   :tag "Positive integer"
> >                   :match-alternatives ((lambda (x) (and (natnump x)
 (not (zerop x)))))
> >                   :value ignore)))
> >
> > The `:tag' has no effect for `foo' - there is no label.  I think that
> > according to the doc it should have the same effect as for `bar'.
>
> I can confirm that this behaviour is still present in Emacs 28.  Mauro,
> if you have time, could you take a look at this?

Not much time until the weekend, I'm afraid.

Dropping the tag is intentional, in custom-variable-value-create:
(push (widget-create-child-and-convert
   widget type
   :format value-format
    ^^^^^^^^^^^^^^^^^^^
   :value value)
  children))

I suppose we could stop overriding the :format property, but for some
widgets overriding it might make sense.  For example, for the choice
widget, deleting the :format value-format line would create the
following:

Foo: Choice: [Value Menu] The-Tag:

Which isn't good, IMO.  Other customization types I can think of that we
should pay attention if we go with this change would be: repeat, set and
radio.

I think that those three, if we print their tag, won't give too much
valuable information about the variable.   I mean, we'd end up with
something like this:

Foo: Repeat:
[INS] [DEL] Something
[INS]

And any user may ask what does "repeat" mean.  Maybe changing the tags
to something slightly more useful is all we need, and with this change
the Custom buffer will show the customization type of the variable to
the user, which looks like a win to me.  What do you think about the
"problematic" tags?
[Message part 2 (text/html, inline)]

This bug report was last modified 4 years and 162 days ago.

Previous Next


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