From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier 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 10:33:04 -0400 Message-ID: References: <86h6foz91p.fsf@gnu.org> <867cgjxpd8.fsf@gnu.org> Reply-To: Stefan Monnier 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="36820"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 70589@debbugs.gnu.org, me@eshelyaron.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 27 16:34:05 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 1s0j7t-0009Md-0I for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Apr 2024 16:34:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0j7b-0006jo-Uw; Sat, 27 Apr 2024 10:33:47 -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 1s0j7X-0006jM-G1 for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 10:33: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 1s0j7X-0005Rk-7X for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 10:33:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0j7p-0001X8-QU for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 10:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2024 14:34: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.17142284155888 (code B ref 70589); Sat, 27 Apr 2024 14:34:01 +0000 Original-Received: (at 70589) by debbugs.gnu.org; 27 Apr 2024 14:33:35 +0000 Original-Received: from localhost ([127.0.0.1]:49480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0j7O-0001Wu-PF for submit@debbugs.gnu.org; Sat, 27 Apr 2024 10:33:35 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0j7M-0001Wo-Gq for 70589@debbugs.gnu.org; Sat, 27 Apr 2024 10:33:32 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 55C4480A68; Sat, 27 Apr 2024 10:33:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1714228385; bh=hqTTAEoJp7+7pdyo8NprCmro/fMdCJR0bTub41hd7l0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mdU5ekbDo3ktoq/B2kkuUTBkPgZgBouqItVdtWjaZGO+6CiUzsrt/XFMQ4Z5IU3la t2cTIEFHUjs5imTFK+unfEXwoG8nY+oYqz/7/zpnWcE/5AyQaSWGMvO3hDkdbnP9a+ 4iPKEOzBHnxANteWCKZcl6QQSivjf/Z3uSSt7mGyA4z3xKTun8wqplRJOT5vFN4djw +nrWEsdpftx/M8Lx3v7TCnik0nbM7H9MvdBXUCdekpFwLCkcNwmzxk8rj+4eeSWw+C ywsjW1HRKUHyDxu77hqn8iinjL7D5/nTkh17KxvKyAutPmvS8hTWlSsTrdC2b4he9s PZHoGgQ8WcqKw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E84D280348; Sat, 27 Apr 2024 10:33:05 -0400 (EDT) Original-Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BB6211201A9; Sat, 27 Apr 2024 10:33:05 -0400 (EDT) In-Reply-To: <867cgjxpd8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Apr 2024 09:59:31 +0300") 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:284048 Archived-At: >> > This makes it easier for users to customize generated '*-modes' option= s, >> > such as 'global-completion-preview-modes', via the Custom interface. >>=20 >> 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, 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. 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 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. Stefan