all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 35133@debbugs.gnu.org
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	[thread overview]
Message-ID: <CABczVwfDOHXULnC4iqDHWc+Ex59LkTZ8FuCXmCA02BTbUzMfpg@mail.gmail.com> (raw)
In-Reply-To: <87360f2fsp.fsf@gnus.org>

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

> Drew Adams <drew.adams@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?

[-- Attachment #2: Type: text/html, Size: 2604 bytes --]

  reply	other threads:[~2020-12-09 22:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  3:05 bug#35133: 26.1; 1) `:tag' for `restricted-sexp' (not in a choice, set, etc.), 2) Remove `Value Menu' if a no-op Drew Adams
2020-12-09 14:51 ` Lars Ingebrigtsen
2020-12-09 22:27   ` Mauro Aranda [this message]
2020-12-09 23:30     ` Drew Adams
2020-12-11 14:05       ` Mauro Aranda
2020-12-11 17:26         ` Drew Adams
2020-12-11 14:31     ` Lars Ingebrigtsen
2020-12-11 17:06       ` Mauro Aranda
2020-12-12 10:59         ` Lars Ingebrigtsen
2020-12-13 13:50           ` Mauro Aranda

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=CABczVwfDOHXULnC4iqDHWc+Ex59LkTZ8FuCXmCA02BTbUzMfpg@mail.gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=35133@debbugs.gnu.org \
    --cc=larsi@gnus.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.