Subject: bug#71814: define-globalized-minor-mode Should predicate variable be defined before?

From: Elijah G <[email-masked]>
Date: Fri, 28 Jun 2024 22:33:25 -0600

El vie., 28 de junio de 2024 9:27 p. m., Stefan Kangas <
[email-masked]> escribió:

> "Elijah G." <[email-masked]> writes:
>
> > Hello, i've noticed when defining a globalized minor mode using the
> > define-globalized-minor-mode macro, gives a byte-compile warning about
> > the auto-generated :predicate variable not being defined.
>
> Thanks for the bug report and proposed fix.
>
> Could you please provide a recipe to reproduce the problem?
>

Sure.

1. create a .el file
2. insert this snippet into to file:
```
(define-minor-mode test-mode "")
(define-globalized-minor-mode global-test-mode
  test-mode #'ignore
  :group 'test
  :predicate '(prog-mode text-mode))
```
3. byte-compile the file
4. in the compile log buffer should appear this warning:
`Warning: reference to free variable ‘global-test-modes’`
which is the variable generated by the macro.