]> git.eshelyaron.com Git - emacs.git/commitdiff
Silence warning with global minor mode :predicate
authorStefan Kangas <stefankangas@gmail.com>
Sat, 29 Jun 2024 12:38:57 +0000 (14:38 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 1 Jul 2024 07:42:44 +0000 (09:42 +0200)
* 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

index b0cf7318d3c2952d18df696fedf0496eb4847d9b..fadaee53ff0ac90e9fd2b227825ff2d58908d9a8 100644 (file)
@@ -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)