From 6b574c2a55b15cc30021f78638e249c04b6a0dfb Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 29 Jun 2024 14:38:57 +0200 Subject: [PATCH] Silence warning with global minor mode :predicate * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Silence byte-compiler warning when :predicate is used. (cherry picked from commit a65b6aac6b59b2d9f28892d2a4e7426507035610) --- lisp/emacs-lisp/easy-mmode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index b0cf7318d3c..fadaee53ff0 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -524,7 +524,8 @@ on if the hook has explicitly disabled it. (progn (put ',global-mode 'globalized-minor-mode t) :autoload-end - (defvar-local ,MODE-major-mode nil)) + (defvar-local ,MODE-major-mode nil) + ,@(when predicate `((defvar ,MODE-predicate)))) ;; The actual global minor-mode (define-minor-mode ,global-mode ,(concat (format "Toggle %s in all buffers.\n" pretty-name) -- 2.39.2