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: Fri, 26 Apr 2024 11:49:19 +0200 Message-ID: Reply-To: Eshel Yaron 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="31917"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 70589@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 26 11:50:18 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 1s0IDh-00088U-Tt for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Apr 2024 11:50:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0IDK-0002nP-F0; Fri, 26 Apr 2024 05:49:54 -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 1s0IDF-0002mm-23 for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 05:49:52 -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 1s0IDE-0005W4-KD for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 05:49:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0IDW-0007rM-62 for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 05:50:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Apr 2024 09:50:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70589 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171412499530087 (code B ref -1); Fri, 26 Apr 2024 09:50:05 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Apr 2024 09:49:55 +0000 Original-Received: from localhost ([127.0.0.1]:33974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0IDJ-0007p6-Ma for submit@debbugs.gnu.org; Fri, 26 Apr 2024 05:49:54 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:54776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0IDF-0007n8-Gt for submit@debbugs.gnu.org; Fri, 26 Apr 2024 05:49:51 -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 1s0ICr-0002ie-3c for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 05:49:25 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0ICo-0005R4-IH for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 05:49:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1714124961; bh=zJqGB4lffmcB1Eg0fefX2MjJOms29zCFRTehDj2OsZY=; h=From:To:Subject:Date:From; b=EaYbY571ySYkqSHQF+Ugl5yjrxtSbgdqxfRLymTQ+NnYf3pvDQ3opEBj6PROaf0dX NI23jWio1DsONqAFtH+GroJeIdwPmDfM87AQB4Q6gI1q/s5qxEUWiQmz172MErQoUq i2c9v+GjpN3NoqmtQyYfnzPHrgVAhzb0mh1LHPcC06nMD+qUUYD8MfsbSnWPYZV5rV ayAIhxl/IIc+UTRz534kYihliOAAQx8VwAUjvs+L7VEo4iSH5KP59PkABiOU/ZJ1NX 0LIJNM5sRKyzikt1kG1dTjR2XHSzBPMu3EmWVAoyuhRAnTF4MgPNdYXIw+/bMhZRgl GdGoEaGBd/DCA== X-Hashcash: 1:20:240426:bug-gnu-emacs@gnu.org::84No6f6dN5JKp0gz:5FgF Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:283972 Archived-At: --=-=-= Content-Type: text/plain Tags: patch This makes it easier for users to customize generated '*-modes' options, such as 'global-completion-preview-modes', via the Custom interface. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Refine-the-Custom-type-of-generated-modes-options.patch >From f81f30895dd1e54684ed3bd66a49ea76dd9e5cf7 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 26 Apr 2024 11:43:29 +0200 Subject: [PATCH] Refine the Custom type of generated '*-modes' options * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Refine the Custom type of the '*-modes' option, generated when this macro is given a ':predicate' argument. --- lisp/emacs-lisp/easy-mmode.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index eaad9646985..72509a24241 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -580,7 +580,19 @@ define-globalized-minor-mode and nil means \"don't use\". There's an implicit nil at the end of the list." mode) - :type '(repeat sexp) + :type '(choice (const :tag "Enable in all major modes" t) + (const :tag "Don't enable in any major mode" nil) + (repeat :tag "Only enable in" + (choice + (const :tag "All major modes" t) + (const :tag "No major mode" nil) + (symbol :value fundamental-mode + :tag "Specific major mode") + (cons :tag "Exclude modes" + (const :tag "Exclude..." not) + (repeat + (symbol :value fundamental-mode + :tag "Major mode")))))) ,@group)) ;; Autoloading define-globalized-minor-mode autoloads everything -- 2.44.0 --=-=-=--