From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs 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: Fri, 11 Dec 2020 14:06:00 -0300 Message-ID: <5fd3a6fb.1c69fb81.a2b39.49ef@mx.google.com> References: <4bd9e603-0d75-4de4-9bd3-6fa94a96e8a4@default> <87360f2fsp.fsf@gnus.org> <875z58bei5.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1781"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux) Cc: 35133@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 11 18:23:19 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knm8U-0000Ki-EI for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Dec 2020 18:23:18 +0100 Original-Received: from localhost ([::1]:35126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knm8T-0003NU-F3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Dec 2020 12:23:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knlsl-00025y-1d for bug-gnu-emacs@gnu.org; Fri, 11 Dec 2020 12:07:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knlsj-0001Zn-Rf for bug-gnu-emacs@gnu.org; Fri, 11 Dec 2020 12:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1knlsj-0004Vh-Mw for bug-gnu-emacs@gnu.org; Fri, 11 Dec 2020 12:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Dec 2020 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35133 X-GNU-PR-Package: emacs Original-Received: via spool by 35133-submit@debbugs.gnu.org id=B35133.160770637817279 (code B ref 35133); Fri, 11 Dec 2020 17:07:01 +0000 Original-Received: (at 35133) by debbugs.gnu.org; 11 Dec 2020 17:06:18 +0000 Original-Received: from localhost ([127.0.0.1]:42808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knls1-0004Ud-OM for submit@debbugs.gnu.org; Fri, 11 Dec 2020 12:06:18 -0500 Original-Received: from mail-qk1-f175.google.com ([209.85.222.175]:36416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knlrt-0004UC-U4 for 35133@debbugs.gnu.org; Fri, 11 Dec 2020 12:06:15 -0500 Original-Received: by mail-qk1-f175.google.com with SMTP id 186so9067909qkj.3 for <35133@debbugs.gnu.org>; Fri, 11 Dec 2020 09:06:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:cc:subject:references:date:in-reply-to :user-agent:mime-version; bh=b1AjasSt29V1GqqXsgJDptEjQILPdyaYJBco+fkPLSk=; b=onMAQo2IgNmlSKP1iRf9BAA1cKDiiDtdilbn/JNCf/daMPMOMm23RN8f6QCmW3Y1uc PELYG259MffA0c590d6yuaWhR4XjPEzMQBxZxG+LUonlZAXvAQUYXLGgqjfBxv2YGJao Wtqio2SCAfNsrPgx9f2Spv6df9tAi7RW2zJ9H5NBpzxyXRI/H+e1Nx79lwieQ9udb/gK C+ZgjH0cNy6my8IalwRSPo23Sq9rdrrDrFS7QZQra1me+tEjgfNbbklGieIUIMUTH1uh lE1DwOYesRXzIaL6xuZrnq5sksLrWBToBfI5zJ4GGr43iFk/4zWpXJ33SUStH4ase0cP QSiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:to:cc:subject:references:date :in-reply-to:user-agent:mime-version; bh=b1AjasSt29V1GqqXsgJDptEjQILPdyaYJBco+fkPLSk=; b=eopgWR5ds+3fqLqvkRLO5W2fmwJX/OPQWvoITJV0JUVnbb27zcDFlUXCERUSV26SA8 aTTk6DCGm4CgeMFmUaiJnYQ4dcy5jS4/R3PXGUN24t4dZkzuhPMcPbrPM13XyypceGX2 xksuGkUpNbbPsHlaI8RFCiokGZwHDkWJ+WpjI9IYGqQf0XOU6sqIJ318JQq9UJV51PWs 4B3zz0CvEDnXmApL3hThlxUVJf2GHb/u7jWszOcHULNQjUdpQLLneNBACWT9NZJ19jXV P17GwhbxJIBqjPuZvzi0jBlDavWJir+ih/Mn8Hu5SIYQolkekSU0FljckuxHkqpXLd9H ofcg== X-Gm-Message-State: AOAM5315QkpS9ap+qATmWMCEkReQXFJ21kXFZj4qqEwfEJWii+O/Q0oM rwSlN8SKFYswJ7f+8QbDPgC9GD1mowHVbg== X-Google-Smtp-Source: ABdhPJxz8eKXjqz8b0MfcI4F3QIosEpfsS4HXNOwJ5TKZukCqBz8JjK86paVMYfGPVm9XOLXAxaeGQ== X-Received: by 2002:a05:620a:788:: with SMTP id 8mr836514qka.224.1607706364009; Fri, 11 Dec 2020 09:06:04 -0800 (PST) Original-Received: from tbb-desktop ([201.213.132.172]) by smtp.gmail.com with ESMTPSA id k188sm7417430qkd.98.2020.12.11.09.06.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Dec 2020 09:06:03 -0800 (PST) X-Google-Original-Message-ID: <87k0to6znr.fsf@maurooaranda@gmail.com> In-Reply-To: <875z58bei5.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 11 Dec 2020 15:31:46 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:195790 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Mauro Aranda writes: > >> 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. > > Yeah, that doesn't look optimal... Earlier today I sent a message saying we already show it that way when the choice widget is part of another grouping widget. And I can't figure out a nice way to show it, while being backward compatible... So I suggest the attached patch, and if the Choice: [Value Menu] text turns out to be really annoying, we can explore some other way of fixing it. (If you want, I can send a tentative untested example of how a less backward compatible change would look like). >> 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. > > Sounds good to me, if I understand you correctly (which I may very well > not do). Similarly to the choice widget, we already show "Repeat" and such things in other situations, so I'd say my initial worries should not be taken into account. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Stop-dropping-the-tag-when-creating-the-custom-varia.patch Content-Description: Bug35133 patch >From f0d69b47349fd23fd06a8f1c5f54ca3bfcfc6522 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Fri, 11 Dec 2020 13:07:21 -0300 Subject: [PATCH] Stop dropping the tag when creating the custom-variable widget * lisp/cus-edit.el (custom-variable-value-create): Obey the specified tag format when creating the variable tag, but stop dropping the tag format for the variable's type widget, since the tag can be used to give useful information to the user about the variable. (Bug#35133) --- lisp/cus-edit.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 3a36cb0237..041f13b420 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2734,11 +2734,15 @@ custom-variable-value-create buttons) (insert " ") (let* ((format (widget-get type :format)) - tag-format value-format) - (unless (string-match ":" format) + tag-format) + ;; We used to drop the widget tag when creating TYPE, passing + ;; everything after the colon (including whitespace characters + ;; after it) as the :format for TYPE. We don't drop the tag + ;; anymore, but we should keep an immediate whitespace character, + ;; if present, and it's easier to do it here. + (unless (string-match ":\\s-?" format) (error "Bad format")) (setq tag-format (substring format 0 (match-end 0))) - (setq value-format (substring format (match-end 0))) (push (widget-create-child-and-convert widget 'item :format tag-format @@ -2753,7 +2757,6 @@ custom-variable-value-create buttons) (push (widget-create-child-and-convert widget type - :format value-format :value value) children)))) (unless (eq custom-buffer-style 'tree) -- 2.29.2 --=-=-=--