From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#33566: 26; `group' :type for defcustom Date: Sat, 1 Dec 2018 16:31:39 -0800 (PST) Message-ID: References: <09947acd-9d28-44c8-9fa0-c5cd4a4ee569@default> <1df4e5f4-4410-d907-0fbb-82453e73f74b@orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1543710608 31531 195.159.176.226 (2 Dec 2018 00:30:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2018 00:30:08 +0000 (UTC) To: Phil Sainty , 33566@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 01:30:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTFe7-00084T-BA for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 01:30:03 +0100 Original-Received: from localhost ([::1]:42996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTFgD-0005rW-TA for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Dec 2018 19:32:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTFg5-0005rR-FF for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 19:32:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTFg2-0003pK-Az for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 19:32:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTFg2-0003pG-4B for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 19:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gTFg1-0004Rq-LX for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 19:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Dec 2018 00:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33566-submit@debbugs.gnu.org id=B33566.154371071017080 (code B ref 33566); Sun, 02 Dec 2018 00:32:01 +0000 Original-Received: (at 33566) by debbugs.gnu.org; 2 Dec 2018 00:31:50 +0000 Original-Received: from localhost ([127.0.0.1]:57399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTFfq-0004RQ-2k for submit@debbugs.gnu.org; Sat, 01 Dec 2018 19:31:50 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:39542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTFfo-0004R8-4M for 33566@debbugs.gnu.org; Sat, 01 Dec 2018 19:31:48 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB20U69d140772; Sun, 2 Dec 2018 00:31:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=gWfMqLNkbgT4EOd5DxgaXIYYdq/Cn83Ce6mfuzpl99s=; b=GhDvOE+WBATfHih/wMXQS/jHr+WVl3Wj3azkLkhobCxoIrVs5Ma9lQZWLdF+b5KydPnQ dzFUGMTJgozw7dd8LrEs2ozEQNkFjoqx05vvWVt1Gmfs81CrNraWaOHnX2LmwsEQDJqC VlyqUrGObaA08BAzSIa90/Fx2E/FWHKg26oQT+nmxyHRBNvKQ8oLU6rQFaXYX3vaeP4x qLhzfRsOBpl6CGQ0J+ixKou1/WphQPD38Y/Sctw7M9iAZDGl8H3EpDwg6DjgkhdZUEgR jF2BnHKanvvf+QEyugiqdUxS4tx9qawoZFBX5FhbXq1U05DkTsQJBKLz3YKya/JPnelg TQ== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2p3hqthtd6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 02 Dec 2018 00:31:41 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wB20Ve6Q023604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 2 Dec 2018 00:31:40 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wB20VesW010893; Sun, 2 Dec 2018 00:31:40 GMT In-Reply-To: <1df4e5f4-4410-d907-0fbb-82453e73f74b@orcon.net.nz> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4771.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9094 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812020003 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152980 Archived-At: > This appears to be the same issue as bug #31309 >=20 > https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > 3A__debbugs.gnu.org_cgi_bugreport.cgi-3Fbug- > 3D31309&d=3DDwIDaQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DkI= 3P6l > jGv6CTHIKju0jqInF6AOwMCYRDQUmqX22rJ98&m=3Dq_aD3h6_uQ5XqacM7h8h0yyr4bJrYed > Kx_CcGGTUXRU&s=3DBlmxwvxgNdZTq6QqgdDRglwd0qa8LpG-SLOp13SLoV4&e=3D >=20 >=20 > At present in wid-edit.el we see: >=20 > (define-widget 'group 'default > [...] > :format "%v" >=20 > And that format of "%v" is triggering the error. >=20 > In #31309 I noted that: >=20 > > the parent `editable-field' widget says: > > "Note: In an =E2=80=98editable-field=E2=80=99 widget, the =E2=80=98%v= =E2=80=99 escape must be > preceded > > by some other text in the =E2=80=98:format=E2=80=99 string (if specifie= d)." >=20 > And so I copied the :format "%{%t%}: %v" used by the 'string type. >=20 > If we make that same change here: >=20 > (define-widget 'group 'default > [...] > :format "%{%t%}: %v" >=20 > Then the example code from this new bug works. >=20 >=20 > Possibly there are other such bugs here as well? >=20 > 8 matches for ":format "%v"" in buffer: wid-edit.el > 594: :type '(repeat (cons :format "%v" > 597:=09=09=09 (string :format "%v"))))) > 1870: :format "%v" > 2214: :format "%v" > 2392: :format "%v" > 2749: :format "%v" > 2905: :format "%v" > 3565:=09=09=09=09(cons :format "%v" Great. Good catch and follow-up. A couple things: This (e.g. the recipe in bug #33566) has apparently been broken since at le= ast Emacs 20. But in Emacs 20 the message in *Messages* is just "Bad forma= t". But :group is supposed to not show any :tag. So I think this is what we sh= ould use: (define-widget 'group 'default "A widget which groups other widgets inside." :convert-widget 'widget-types-convert-widget :copy 'widget-types-copy :format ":\n%v" ; <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D :value-create 'widget-group-value-create :value-get 'widget-editable-list-value-get :default-get 'widget-group-default-get :validate 'widget-children-validate :match 'widget-group-match :match-inline 'widget-group-match-inline) There doesn't seem to be any way to eliminate the `:' altogether, though. I think the doc needs to be corrected in (widget) Editable Text Fields. Th= is is not correct/sufficient; *Warning:* In an =E2=80=98editable-field=E2=80=99 widget, the =E2=80=98%v= =E2=80=99 escape must be preceded by some other text in the =E2=80=98:format=E2=80=99 string (if specified). It's not sufficient that just any old text precede the `%v'. There must be a colon, AFAICT. It should instead say something like this: *Warning:* In an =E2=80=98editable-field=E2=80=99 widget, the =E2=80=98%v= =E2=80=99 escape must be preceded by a colon (`:') in the =E2=80=98:format=E2=80=99 string (if specified). No tag name need precede the colon, but the colon must be present. (Additional text can follow the colon and precede the =E2=80=98%v=E2=80=99.) (Perhaps more testing or checking of just what can precede the %v needs to be done.) I'd also drop the "*Warning:*", personally, and instead say that this is necessary or you get a bad format message (or some such).