all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 70589@debbugs.gnu.org
Subject: bug#70589: [PATCH] Refine the Custom type of generated '*-modes' options
Date: Fri, 26 Apr 2024 11:49:19 +0200	[thread overview]
Message-ID: <m11q6sihcw.fsf@eshelyaron.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

Tags: patch

This makes it easier for users to customize generated '*-modes' options,
such as 'global-completion-preview-modes', via the Custom interface.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Refine-the-Custom-type-of-generated-modes-options.patch --]
[-- Type: text/patch, Size: 1873 bytes --]

From f81f30895dd1e54684ed3bd66a49ea76dd9e5cf7 Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@eshelyaron.com>
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


             reply	other threads:[~2024-04-26  9:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  9:49 Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-26 10:56 ` bug#70589: [PATCH] Refine the Custom type of generated '*-modes' options Eli Zaretskii
2024-04-27  6:59   ` Eli Zaretskii
2024-04-27 14:33     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-27 15:35       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-27 15:47         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-27 21:03           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-28 19:07             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 10:58 ` Eli Zaretskii
2024-04-26 11:13   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 11:34     ` Eli Zaretskii
2024-04-26 12:24       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 15:00         ` Eli Zaretskii
2024-04-26 16:34           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 17:15             ` Eli Zaretskii
2024-04-26 17:55               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 18:29                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m11q6sihcw.fsf@eshelyaron.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70589@debbugs.gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.