From: Stefan Kangas Date: Sat, 29 Jun 2024 12:38:57 +0000 (+0200) Subject: Silence warning with global minor mode :predicate X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b574c2a55b15cc30021f78638e249c04b6a0dfb;p=emacs.git 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) --- 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)