From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Adding customization types Date: Tue, 19 Sep 2017 17:01:56 -0700 (PDT) Message-ID: References: <87zi9vn019.fsf@x230.lts> 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 1505865730 6820 195.159.176.226 (20 Sep 2017 00:02:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 20 Sep 2017 00:02:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: John Wiegley , =?utf-8?B?RXRpZW5uZSBQcnVk4oCZaG9tbWU=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 20 02:02:03 2017 Return-path: Envelope-to: ged-emacs-devel@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 1duSSo-0001LE-QK for ged-emacs-devel@m.gmane.org; Wed, 20 Sep 2017 02:02:02 +0200 Original-Received: from localhost ([::1]:45940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duSSw-0005EX-79 for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2017 20:02:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duSSq-0005EL-Fr for emacs-devel@gnu.org; Tue, 19 Sep 2017 20:02:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duSSn-0000kK-U7 for emacs-devel@gnu.org; Tue, 19 Sep 2017 20:02:04 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:26852) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duSSn-0000jj-Ll for emacs-devel@gnu.org; Tue, 19 Sep 2017 20:02:01 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v8K01w6J006520 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Sep 2017 00:01:59 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v8K01w1F022756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Sep 2017 00:01:58 GMT Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v8K01v9M015274; Wed, 20 Sep 2017 00:01:58 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6776.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218557 Archived-At: > PE> One of the widget (or type), I would like to get is major-mode and > PE> probably minor-mode too. Is there any reason why it was never include= d? >=20 > EP> Given we could know if a symbol is a major-mode, would it be okay if = I > PE> made a patch for that (to be included in `wid-edit.el`)? >=20 > This sounds useful to me. >=20 > I also briefly looked for a general way to say "symbols matching a > predicate", for one-off types similar to the above request. Is that possi= ble? 1. Do you mean for completion when entering a symbol value for a field? If so, I don't think that has been implemented. (In fact, it seem that if you try using `M-TAB' in such a field you get the inappropriate error message "Not in an editable field", instead of a more appropriate message telling you that completion is not available in that field. That seems like a bug in `widget-complete'.) 2. Do you instead mean a way to restrict a field value to be a symbol that matches a given predicate? If so, yes, you can do that using custom type `restricted-sexp'.