From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Elijah G Newsgroups: gmane.emacs.bugs Subject: bug#71814: define-globalized-minor-mode Should predicate variable be defined before? Date: Fri, 28 Jun 2024 22:33:25 -0600 Message-ID: References: <864j9d7thm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000049f4dc061bffdeaf" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30113"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71814@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 29 06:35:26 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sNPo6-0007c0-E4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Jun 2024 06:35:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNPnk-0000iB-Ji; Sat, 29 Jun 2024 00:35:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNPnj-0000ho-2A for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 00:35:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNPni-0008GM-O5 for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 00:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sNPnh-0001l7-K1 for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 00:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Elijah G Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2024 04:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71814 X-GNU-PR-Package: emacs Original-Received: via spool by 71814-submit@debbugs.gnu.org id=B71814.17196356876728 (code B ref 71814); Sat, 29 Jun 2024 04:35:01 +0000 Original-Received: (at 71814) by debbugs.gnu.org; 29 Jun 2024 04:34:47 +0000 Original-Received: from localhost ([127.0.0.1]:36650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNPnS-0001kS-Pl for submit@debbugs.gnu.org; Sat, 29 Jun 2024 00:34:47 -0400 Original-Received: from mail-qt1-f194.google.com ([209.85.160.194]:50338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNPnR-0001kE-Ew for 71814@debbugs.gnu.org; Sat, 29 Jun 2024 00:34:46 -0400 Original-Received: by mail-qt1-f194.google.com with SMTP id d75a77b69052e-444fa159caeso11358481cf.0 for <71814@debbugs.gnu.org>; Fri, 28 Jun 2024 21:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719635620; x=1720240420; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VHhtsXdOI5ACnxVmqs00SjGwt1InlUveIPu60sOH4H4=; b=W29QdHNP/WCECgw8qp9Njs8zCpFGHX5mqWMeCI8L+xFQGVZbBqMRV6DpbpYyRycZX7 0C2eYPq3XaFM8Si3wAoW0o+wjgmUgezsGUztrkd3WOBK8R8myV4BA3cscSYSZI7c0st6 7wbqkKqPbdqhN2wheZXF8r7zN8AFX3Os9OzAL0yfIRwB4DA1X0fArTNuzb32KxIRUeGF +eRSCFTCv2mmc3mHyIo1P75K2+lzpX7NYcjEAGBDMEZnmo/yWkqeh2xbphE1NmkT4h+/ 5A60YK/qsftGdB4nvOFPznfS6kNZUZeB6iqFB1RMz36iTMvwkbrWWrvlJXs9tLSJ5OXy fnPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719635620; x=1720240420; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VHhtsXdOI5ACnxVmqs00SjGwt1InlUveIPu60sOH4H4=; b=oBx4g0ol22rN3I1og3qFFy7bWly3Ke0bz2UUWYL8vct7jwhGy0FBhzH5i19rPvX1va kbERiHzDEytU2isTv9ewiMEA2wIPgijSXHdt0bzZOEAAcj0Sbp4WS2f/oXtraWDxvEpX 2TLJmcGe01tc7pmDJd46RaXkp8IChbgvWJPlT0reAivZxB9Vi8GPOAo+Ag02Q6wptnrZ iq7ILxNIHkSOsGYBePE6rt3+NyJrrJKVkn6/aV/yR4qBBW8uQ/J3O1raj+CtrkDI138k hRDbCXTa9ZZ4z+cdIoUzdKX3b71/kqjH4pDdELgOMFHqX8m9TrDfmtufj3owkMxoZR+l bavA== X-Gm-Message-State: AOJu0YxRo4Mc30gXdqu/VTaAN5BwC7I3MOGRWKjWDTjH1MI1N8Gx9KMP XF1zWu1I6etOub0m6k1fabgpz8OUON47SMOeau6vs3qhMlop6dsq4cHyHm2jBNsVSqsksKzK1gn F9FEOVTJKCgh7b60/kSO9PlUlniw= X-Google-Smtp-Source: AGHT+IHOTckf3D6BZ6G7+TOX66L0ZJ5ZgK55FsJkT6HhEF85snIL9yhw0apggjQpMyxD46pn1+rIbOHqmek+WRjJJac= X-Received: by 2002:ac8:5d49:0:b0:446:34e5:a63a with SMTP id d75a77b69052e-44662df2943mr561961cf.22.1719635620261; Fri, 28 Jun 2024 21:33:40 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288096 Archived-At: --00000000000049f4dc061bffdeaf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable El vie., 28 de junio de 2024 9:27 p. m., Stefan Kangas < stefankangas@gmail.com> escribi=C3=B3: > "Elijah G." 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 =E2=80=98global-test-modes=E2=80=99` which is the variable generated by the macro. > --00000000000049f4dc061bffdeaf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
El vie., 28 de junio de 2024 9:27 p. m., Stefan Kangas <stefankangas@gmail.com> escri= bi=C3=B3:
"Elijah G." <= ;eg642616@gmail.com> writes:

> Hello, i've noticed when defining a globalized minor mode using th= e
> 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
=C2=A0 test-mode #'ignore
=C2=A0 :grou= p 'test
=C2=A0 :predicate '(prog-mode text-m= ode))
```
3. byte-compile the= file
4. in the compile log buffer should appear thi= s warning:
`Warning: reference to free variable =E2= =80=98global-test-modes=E2=80=99`
which is the varia= ble generated by the macro.
--00000000000049f4dc061bffdeaf--