From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70589: [PATCH] Refine the Custom type of generated '*-modes' options Date: Sat, 27 Apr 2024 17:35:19 +0200 Message-ID: References: <86h6foz91p.fsf@gnu.org> <867cgjxpd8.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13530"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 70589@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 27 17:35:54 2024 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 1s0k5i-0003IL-Dm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Apr 2024 17:35:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0k5Z-0004ji-6y; Sat, 27 Apr 2024 11:35:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0k5X-0004is-NU for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 11:35:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0k5X-0000jx-Cv for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 11:35:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0k5p-0002ST-LI for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 11:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2024 15:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70589 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70589-submit@debbugs.gnu.org id=B70589.17142321449435 (code B ref 70589); Sat, 27 Apr 2024 15:36:01 +0000 Original-Received: (at 70589) by debbugs.gnu.org; 27 Apr 2024 15:35:44 +0000 Original-Received: from localhost ([127.0.0.1]:49518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0k5X-0002S6-K1 for submit@debbugs.gnu.org; Sat, 27 Apr 2024 11:35:43 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:35590 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0k5V-0002Rx-I4; Sat, 27 Apr 2024 11:35:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1714232122; bh=0dPhN4493c2KDAJt9FcyNagMHNRLeafGo37PAVq+ZmY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YXDn/dcRJJz/ZQZ0u4wsBPdkMA/zk4pxRQtibJewNX3oGDrFVQOILxgJfDw8sL3gw PNlTA3xIbiGrl8VDqiPkUz6+hvuxbHfyU9IyPTbYU7wsNKi78zNGpOnyIdU2PI40Vp 0wKefZvKyiKfk/UjFR2j/yCkQ+15BOoVhkpYNe5F55xf/ewIBzbcvjPQWt/VctCVsp jAaqOs6PMzK4MD9WjFHFfhC6oDvWkVRSHrjlEA3GpY2c/jY6NU7eCk4U39Eduaq2k4 sXXFtwCqhnylvkjxMQ9930QupTkSHx374NXRowV0S8Cqn/00BvNSHc4Ccx2F816AyX 2cJ91m+JZjZew== In-Reply-To: (Stefan Monnier's message of "Sat, 27 Apr 2024 10:33:04 -0400") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284053 Archived-At: close 70589 30.1 quit Stefan Monnier writes: >>> > This makes it easier for users to customize generated '*-modes' optio= ns, >>> > such as 'global-completion-preview-modes', via the Custom interface. >>> >>> This kind of discussion is not useful with Stefan (CC'ed) on board. >> ^^^^ >> Oops, I meant "without", of course. Sorry. > > =F0=9F=99=82 > > FWIW, the latest patch looks fine to me, Thanks, so I've now pushed it to master. I'm not closing the bug yet, in favor of your additional suggestion below. > but really this is Lars's code, so you don't need me "on board", really. > > Also, while I'm here: I think part of the "problem" is in the semantics: > anything after a t or nil is ignored, which is hard to explain via > a "single small line" of text. Agreed. Although it's not such a big problem IMO, since the Customize buffer also shows the docstring of the option, which explains the semantics pretty clearly. > We could imagine extending the semantics so that you can use `((not a) > . t)` instead, in which case this meaning of `t` can be shared with the > "main one" (instead of having two `t` cases and two `nil` cases) in the > sense that the syntax would be: > > PRED can be: > t Always accept > nil Always decline > ((not . MODES) . PRED) Decline if in MODES, otherwise like PRED > (MODE . PRED) Accept if in MODE, otherwise like PRED > That sounds neat. > but then we couldn't use the `repeat` Custom type and instead we'd have > to implement an ad-hoc type for it, I believe. I think that's right.