From unknown Mon Sep 15 01:44:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#79412 <79412@debbugs.gnu.org> To: bug#79412 <79412@debbugs.gnu.org> Subject: Status: 30.2; `define-globalized-minor-mode' does not respect `:variable' Reply-To: bug#79412 <79412@debbugs.gnu.org> Date: Mon, 15 Sep 2025 08:44:17 +0000 retitle 79412 30.2; `define-globalized-minor-mode' does not respect `:varia= ble' reassign 79412 emacs submitter 79412 inet0@qq.com severity 79412 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 08 22:00:59 2025 Received: (at submit) by debbugs.gnu.org; 9 Sep 2025 02:00:59 +0000 Received: from localhost ([127.0.0.1]:54265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvnfA-00048r-Ba for submit@debbugs.gnu.org; Mon, 08 Sep 2025 22:00:59 -0400 Received: from lists.gnu.org ([2001:470:142::17]:57242) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvi08-00020H-RB for submit@debbugs.gnu.org; Mon, 08 Sep 2025 15:58:15 -0400 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 1uvi02-0000wR-UX for bug-gnu-emacs@gnu.org; Mon, 08 Sep 2025 15:58:02 -0400 Received: from out162-62-57-210.mail.qq.com ([162.62.57.210]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvhyd-0004x8-Vc for bug-gnu-emacs@gnu.org; Mon, 08 Sep 2025 15:56:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1757361379; bh=aTCgpoL7F4gKgkyCsp0H+9aIgMU4LX+BoSaLByKSfCg=; h=From:To:Subject:Date; b=wegZd5z65RgwxIMmPRFqX4lsghr9dEMm+HnLhHIL5H2C1FCqbw4pdz6FLzKQIDnpb uSgNN/0MXonHuD2Y6Y/3cGLVAe9bhWn+pA7zOxpc5CF0WB14Y2d1mRR0LRcc9754TJ c3AgX30/DuDiPEYLEJk7lhqV/6ZSN6LBbtWElODE= Received: from localhost ([240e:3ba:30d5:fe50:1940:bb23:2136:fc53]) by newxmesmtplogicsvrszb20-0.qq.com (NewEsmtp) with SMTP id A248DECB; Tue, 09 Sep 2025 03:40:36 +0800 X-QQ-mid: xmsmtpt1757360436ti7l68pjk Message-ID: X-QQ-XMAILINFO: OS/DC+cG4NoC8ts0cBDPSjslTJdm9RKbPSgx2ux51qCZldB99rZDhQiRK5K0kC EYLtKTCibbW2eT14jXQ2urhxLIMuYoVYNoVRKtc1XZWHXBP2SxQ/qnXY4cPJerHXUYwBSm408Qci Xd8L/WMEb94rtjCZ2srUJlW/xgjZh3M7tAZTi9Z78sT3yDwOAc2rB4SwhRpsXcTpf+j5cG9HqaQi tTg/PEgSffO/Zt5MBGUJsL0IF0BPzcu1+sl2/YsAKR/EOARDhLHh03Yh+LdatxppD5m8nZNtGjzw +YJpYEYg0h8RvhhBXKmXswdmwiksnY5oLxdkHM56h6p12L22m4diqwpSf49H6v02q20A+yXiNuEz ceypxp2w7P5+CeJ1iSEpGAKNbIIg7oVVR13rav0yQM30K5rwNBjK8sqemZigSu1T/1/8P9KNNVFx LxB+nmh1X55NnrgH+3YW0RJLK3huh19FhZpYWORbiQivdx4iC/+eQxCm5Uw+3BzhX7yUmf6pmd4J 7kQbnYI/I+Wbs6dCinBbjmSviX+kBm+PNUkl3BL/ZUKqunRTcFysRe3+57mp5wiDL9bsQv4kCzHs vRDuL4aME/g6X/7BlHJHu+wGVhFli4eVFpS3IvcDhKseVVo0h33jCoQZdMcMFkVrOwh3eonuadOo F9XYFuJYcxlBzBGQdAcJSVcikTDri4DUyVD18RGdO1d8uF+EUpyn8G2lV2xOpB8iPg3pCt5Dpy9W I+lg+asCsiawge1+35z+wcfmOSwmmsWOUsCzFHCyMb8vGspTzlfILq1uc3PDcyvFGnMZ1gl/O2SX E4UXP/8yiU9aNIsyKtmMfp7WTCBO2bR0vbUT4phi31+wUUTpGVmM78uFkvtnuwwPn1768BaG0j5j NdmNLe+ZKKOcD/pxXh1cUmyaxrV35eBdtW6rfHIXtReid1JuttkbAtyid1dcTmxwBX83BHXhYmUv G8sYtIWAa5B9Q+3WrBEdDy1gzNumQOmMszf2JAOD12986UbPgQyQ== X-QQ-XMRINFO: M/715EihBoGSf6IYSX1iLFg= From: inet0@qq.com To: bug-gnu-emacs@gnu.org Subject: 30.2; `define-globalized-minor-mode' does not respect `:variable' X-Debbugs-Cc: Date: Tue, 09 Sep 2025 03:40:36 +0800 X-OQ-MSGID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=162.62.57.210; envelope-from=inet0@qq.com; helo=out162-62-57-210.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 08 Sep 2025 22:00:51 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Hi there, I am using Emacs as a GUI application on Android (distributed by F-Droid if that matters) so `emacs -Q' is not an option, but the symptoms should be reproduced by (1) evaluating the program segments below, then (2) typing `C-c b' twice. (define-minor-mode bidi-display-reordering-mode nil :variable bidi-display-reordering) (define-globalized-minor-mode global-bidi-display-reordering-mode bidi-display-reordering-mode (lambda () (bidi-display-reordering-mode 1)) :variable bidi-display-reordering) (keymap-global-set "C-c b" 'global-bidi-display-reordering-mode) Buffer *Messages*: Loading gnus...done For information about GNU Emacs and the GNU system, type C-h C-a. Global Bidi-Display-Reordering mode enabled if: Symbol=E2=80=99s value as variable is void: bidi-display-reordering-mode Buffer *Backtrace*: Debugger entered--Lisp error: (void-variable bidi-display-reordering-mode) (if bidi-display-reordering-mode (progn (bidi-display-reordering-mode -1)= )) (if global-bidi-display-reordering-mode (bidi-display-reordering-mode 1) = (if bidi-display-reordering-mode (progn (bidi-display-reordering-mode -1)))) (save-current-buffer (set-buffer buf) (if global-bidi-display-reordering-= mode (bidi-display-reordering-mode 1) (if bidi-display-reordering-mode (pro= gn (bidi-display-reordering-mode -1))))) (let ((buf (car tail))) (save-current-buffer (set-buffer buf) (if global-= bidi-display-reordering-mode (bidi-display-reordering-mode 1) (if bidi-disp= lay-reordering-mode (progn (bidi-display-reordering-mode -1))))) (setq tail= (cdr tail))) (while tail (let ((buf (car tail))) (save-current-buffer (set-buffer buf)= (if global-bidi-display-reordering-mode (bidi-display-reordering-mode 1) (= if bidi-display-reordering-mode (progn (bidi-display-reordering-mode -1))))= ) (setq tail (cdr tail)))) (let ((tail (buffer-list))) (while tail (let ((buf (car tail))) (save-cur= rent-buffer (set-buffer buf) (if global-bidi-display-reordering-mode (bidi-= display-reordering-mode 1) (if bidi-display-reordering-mode (progn (bidi-di= splay-reordering-mode -1))))) (setq tail (cdr tail))))) (let ((last-message (current-message))) (progn (set-default 'global-bidi-= display-reordering-mode (cond ((eq arg 'toggle) (not (default-value 'global= -bidi-display-reordering-mode))) ((and (numberp arg) (< arg 1)) nil) (t t))= )) (if (boundp 'global-minor-modes) (progn (setq global-minor-modes (delq '= global-bidi-display-reordering-mode global-minor-modes)) (if (default-value= 'global-bidi-display-reordering-mode) (progn (setq global-minor-modes (con= s 'global-bidi-display-reordering-mode global-minor-modes)))))) (if global-= bidi-display-reordering-mode (add-hook 'after-change-major-mode-hook #'glob= al-bidi-display-reordering-mode-enable-in-buffer) (remove-hook 'after-chang= e-major-mode-hook #'global-bidi-display-reordering-mode-enable-in-buffer)) = (let ((tail (buffer-list))) (while tail (let ((buf (car tail))) (save-curre= nt-buffer (set-buffer buf) (if global-bidi-display-reordering-mode (bidi-di= splay-reordering-mode 1) (if bidi-display-reordering-mode (progn (bidi-disp= lay-reordering-mode -1))))) (setq tail (cdr tail))))) (run-hooks 'global-bi= di-display-reordering-mode-hook (if (default-value 'global-bidi-display-reo= rdering-mode) 'global-bidi-display-reordering-mode-on-hook 'global-bidi-dis= play-reordering-mode-off-hook)) (if (called-interactively-p 'any) (progn (c= ustomize-mark-as-set 'global-bidi-display-reordering-mode) (if (and (curren= t-message) (not (equal last-message (current-message)))) nil (let ((local "= ")) (message "%s %sabled%s" "Global Bidi-Display-Reordering mode" (if (defa= ult-value 'global-bidi-display-reordering-mode) "en" "dis") local)))))) global-bidi-display-reordering-mode(toggle) funcall-interactively(global-bidi-display-reordering-mode toggle) call-interactively(global-bidi-display-reordering-mode nil nil) command-execute(global-bidi-display-reordering-mode) One would expect a line `Global Glyphless-Display mode disabled' in buffer *Messages*, but Emacs only complains about the variable `bidi-display-reordering-mode' being void, and the corresponding buffer-local mode is not disabled either. After searching on the Internet and on the GNU Bug Tracker, I came across this related bug report: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D29081 Notice the use of keyword `:variable' in the form `define-globalized-minor-mode' whose paired value, according to info node `(elisp)Defining Minor Modes', should match that of the same keyword in the corresponding form `define-minor-mode'. With that in mind, I suspect that the buffer-local mode name is mistakenly referenced instead of the name specified by keyword `:variable', thus causing a void-variable error. I have found something suspicious at source code `lisp/emacs-lisp/easy-mmode.el:569:23': ;; Go through existing buffers. (dolist (buf (buffer-list)) (with-current-buffer buf (if ,global-mode (funcall ,turn-on-function) (when ,mode (,mode -1))))) It seems that `mode' at the predicate position of `when' should really be `MODE-variable'! As an aside, the docstring of `define-globalized-minor-mode' is a bit off the description in the ELisp manual. (Jumping between `C-h f' and `C-h i m el i' is annoying, isn't it?) The manual says: By default, the buffer-local minor mode variable that says whether the mode is switched on or off is the same as the name of the mode itself. Use =E2=80=98:variable VARIABLE=E2=80=99 if that=E2=80=99s no= t the case=E2=80=93some minor modes use a different variable to store this state information. While in docstring: Other keywords have the same meaning as in =E2=80=98define-minor-mode=E2=80= =99, which see. Clearly, `:variable' in `define-globalized-minor-mode' does not have the same meaning as in `define-minor-mode', otherwise you would be specifying the mode variable of the global mode, which is not the case. In GNU Emacs 30.2 (build 1, aarch64-unknown-linux-android22) of 2025-08-18 built on bookworm Repository revision: 636f166cfc86aa90d63f592fd99f3fdd9ef95ebd Repository branch: HEAD Windowing system distributor 'Xiaomi', version 33.0.0 System Description: Redmi/alioth/alioth:13/TKQ1.220829.002/V14.0.8.0.TKHCNX= M:user/release-keys Configured using: 'configure --with-png=3Dyes --with-webp=3Dyes --with-gif=3Dyes --with-jpeg=3Dyes --with-xml2=3Dyes --with-sqlite3=3Dyes --with-gnutls=3Dy= es --with-tiff=3Dyes --with-selinux=3Dyes --with-modules=3Dyes --with-tree-sitter=3Dyes --with-imagemagick=3Dno --with-lcms2=3Dyes --with-mailutils=3D --with-pop=3Dno-by-default --with-harfbuzz=3Dyes --with-threads=3Dyes --with-rsvg=3Dyes --enable-check-lisp-object-type=3D 'CFLAGS=3D -Werror=3Dimplicit-function-declaration'' Configured features: GIF GMP GNUTLS HARFBUZZ JPEG LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP THREADS TIFF TREE_SITTER WEBP ZLIB Important settings: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Group Minor modes in effect: cursor-sensor-mode: t gnus-undo-mode: t server-mode: t glyphless-display-mode: t global-glyphless-display-mode: t bidi-display-reordering: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t buffer-read-only: t size-indication-mode: t column-number-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort gnus-cite mail-extr emacsbug cursor-sensor nndraft nnmh utf-7 network-stream nsm nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig nntp gnus-cache gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core json map byte-opt bytecomp byte-compile url-vars mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win noutline outline server cl-macs message sendmail mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus nnheader gnus-util text-property-search time-date subr-x mail-utils range mm-util mail-prsvr cus-edit pp cus-load icons wid-edit cl-loaddefs cl-lib disp-table glyphless-mode gv easy-mmode china-util rmc iso-transl tooltip cus-start cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel android-win term/common-win touch-screen ls-lisp tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads inotify android multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 142708 12432) (symbols 48 15036 1) (strings 32 43127 1451) (string-bytes 1 1143115) (vectors 16 25917) (vector-slots 8 306696 18106) (floats 8 210 4) (intervals 56 578 0) (buffers 992 16)) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 09 05:31:19 2025 Received: (at 79412) by debbugs.gnu.org; 9 Sep 2025 09:31:20 +0000 Received: from localhost ([127.0.0.1]:57526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvuh5-0006VB-3r for submit@debbugs.gnu.org; Tue, 09 Sep 2025 05:31:19 -0400 Received: from out203-205-221-239.mail.qq.com ([203.205.221.239]:50923) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvugv-0006Th-T9 for 79412@debbugs.gnu.org; Tue, 09 Sep 2025 05:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1757410259; bh=8QtL6lPi4WiE8KCZ9JWoLWGoJiRZWPv7yF9hNRbj6Oc=; h=From:To:Subject:In-Reply-To:References:Date; b=Ke0oDilz8S5r2JET8zW56ZNT59KACs7vmXorKsZjjdJoLSUZzmp8QCijIYtsE5YGF oIQqCHX+rIUT8gTrAElUsopkkA5nT6/2eCwHFIgunZy34+6EPCB+BwG5CXilqfc6yw Vriohh/UC4EFbUgUlk944DIj9UDJlnUOWYxudlu0= Received: from localhost ([240e:3ba:30d5:fe50:1940:bb23:2136:fc53]) by newxmesmtplogicsvrsza56-0.qq.com (NewEsmtp) with SMTP id 7BA226C8; Tue, 09 Sep 2025 17:30:58 +0800 X-QQ-mid: xmsmtpt1757410258tf3smyqye Message-ID: X-QQ-XMAILINFO: MyirvGjpKb1j05exmlFy3g98JlcafcVyyIiWKeKkenw5BfxLEOsamSVDaRe36R qv0lyf9owgrKOKK58zL2F/s3AN9GXmZf7AOMDQdcvbBz9KRJYFy529VjcJ3bowwb/YLumchU+UlO WBdv0/Dzk5PniL42qTBH2y12/40+41DdZr7PsY8o+VV9ZiNuruhbr71k6ZdE07PNR710FcT3YTi+ wSkrVC1ueeOcW+GeKGXcKewI0UM80A7I8SjziB+CG5EIWut7327OYhHPuDIv9KEM/+nFLPLmXgie YqodRBZve6bLkAFmfADJYPYuZFZNRLUvFXLAILmbRWBSkImki89Il/fJ7mTp5TvU/NYxPGafYt2b JIdVp1YgSbva9/JAdUo9w+Wuzdn1dGbaOa0YH3nRI+XSI44fdz23ZUZiNpmAM6Z7vzchMSR6/pOA CBDwoKvgwxtYP/Pr6MBVh55Pp8jec17Ki4kJvb4w4y7LknURV0vtDu6m/hxHqSjniTmkz0L7+2ra Sceb+8xP7b/I60vIPicy86c2C39UtXzQM34VEiXzyBLNOx48tstKmldwPaTsLO6Y2L4Ci/ncy7qB TuDTwR07rwa38su5je23/4AKVcqEVaGpMGXpCrxoPTbC38TBUziK5uoAzjmx4MDhhIhIKMLud8yw 3IVnaeberLQW60unJ9awCtXRZ43ee0panuXx6Uvf2GRuqVdMA5cwHLv9t6RDpB7QYvf1QADFZA+F JcXmmGeZGnt7l9Uyt/PVg/sLY2bL3AGdSDf7vIrZj0Pn9DplFUKgPQN0pk1eVAOKObk+OUeVG38E +Ys78/dw239W36Jpie1iHwrAacSRzqFXtjbZG5gnxOZF9/rN/4c9YVwMQN6bL+2w4YK+lwlLmdC3 3L5lWq8qW2M3QQsrtgNLYYx6rE4D2W6BoBb/3YbL/xj5s2/IonYAotZTUsWX/A3OgKp2Dbvrg+Hu fg+/1/7hFqBFycCNH11rS3P0ZgeXkKhdfNDSS6ATs= X-QQ-XMRINFO: NS+P29fieYNw95Bth2bWPxk= From: inet0@qq.com To: 79412@debbugs.gnu.org Subject: Re: 30.2; `define-globalized-minor-mode' does not respect `:variable' In-Reply-To: (inet0@qq.com's message of "Tue, 09 Sep 2025 03:40:36 +0800") References: Date: Tue, 09 Sep 2025 17:30:57 +0800 X-OQ-MSGID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I forgot to mention that it is not working too when the paired value of keyword `:variable' takes the form `(GET . SET)': (define-minor-mode text-conversion-mode nil :variable (text-conversion-style . set-text-conversion-style)) Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [203.205.221.239 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [203.205.221.239 listed in bl.score.senderscore.com] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [203.205.221.239 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.239 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (inet0[at]qq.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (inet0[at]qq.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 79412 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I forgot to mention that it is not working too when the paired value of keyword `:variable' takes the form `(GET . SET)': (define-minor-mode text-conversion-mode nil :variable (text-conversion-style . set-text-conversion-style)) Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [203.205.221.239 listed in wl.mailspike.net] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [203.205.221.239 listed in sa-trusted.bondedsender.org] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.239 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [203.205.221.239 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (inet0[at]qq.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (inet0[at]qq.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager I forgot to mention that it is not working too when the paired value of keyword `:variable' takes the form `(GET . SET)': (define-minor-mode text-conversion-mode nil :variable (text-conversion-style . set-text-conversion-style)) (define-globalized-minor-mode global-text-conversion-mode text-conversion-mode (lambda () (text-conversion-mode 1)) :variable text-conversion-style) (keymap-global-set "C-c a" 'global-text-conversion-mode) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 09 08:03:12 2025 Received: (at 79412) by debbugs.gnu.org; 9 Sep 2025 12:03:13 +0000 Received: from localhost ([127.0.0.1]:58271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvx44-00027e-5a for submit@debbugs.gnu.org; Tue, 09 Sep 2025 08:03:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54416) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvx40-00027P-SK for 79412@debbugs.gnu.org; Tue, 09 Sep 2025 08:03:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvx3t-00036v-AN; Tue, 09 Sep 2025 08:03:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qPYq4F6SEUwGne7aJsuACukRTY0/2t2Xtlfbq3W/698=; b=OIAysix+wSvvWvCUyBZ/ u6q25ag46dr13tAKX7+eosdGBNHw7nljCzSEhoEs2kEONQ7j2wzhI7sm4vDumMkUeauvRj0leLDHP lGmmcezOK/ywajCSaiHQVrOBIRBSWKekNDKE0lDTdj808DpCi8wq8jaYV056EVHZRraqXUFeyYDEq GLHG74zf/jAxQRNmuhROiCdxgLZG2EPGrTVpmC8vHg8XEOqPDPElskdC24jvYvjZoKNJ18D0kY+vL lKp8qci2Rn7pWgRJPA1SinSx0Qf6YfNUAcWtyFPAv3mhlmO2apLas5xOBgTY1qf4bjpUFnPfrah8y uuzIzOGW3fm6cA==; Date: Tue, 09 Sep 2025 15:02:56 +0300 Message-Id: <86frcvdea7.fsf@gnu.org> From: Eli Zaretskii To: inet0@qq.com, Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412 Cc: 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 09 Sep 2025 03:40:36 +0800 > From: inet0--- via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I am using Emacs as a GUI application on Android (distributed by F-Droid > if that matters) so `emacs -Q' is not an option, but the symptoms should > be reproduced by > > (1) evaluating the program segments below, then > > (2) typing `C-c b' twice. > > (define-minor-mode bidi-display-reordering-mode > nil > :variable bidi-display-reordering) > > (define-globalized-minor-mode global-bidi-display-reordering-mode > bidi-display-reordering-mode > (lambda () (bidi-display-reordering-mode 1)) > :variable bidi-display-reordering) > > (keymap-global-set "C-c b" 'global-bidi-display-reordering-mode) > > Buffer *Messages*: > > Loading gnus...done > For information about GNU Emacs and the GNU system, type C-h C-a. > Global Bidi-Display-Reordering mode enabled > if: Symbol’s value as variable is void: bidi-display-reordering-mode The ELisp manual says about ':variable': ‘:variable PLACE’ This replaces the default variable MODE, used to store the state of the mode. If you specify this, the MODE variable is not defined, and any INIT-VALUE argument is unused. What this means is that using :variable leaves the mode variable, in this case bidi-display-reordering-mode, undefined. Therefore, I think you must define some non-trivial BODY for your minor mode, because the default body will try to reference bidi-display-reordering-mode, and will fail, as this backtrace shows: > Buffer *Backtrace*: > > Debugger entered--Lisp error: (void-variable bidi-display-reordering-mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > With that in mind, I suspect that the buffer-local mode name is > mistakenly referenced instead of the name specified by keyword > `:variable', thus causing a void-variable error. I don't think this is accurate. A globalized minor mode works by walking the list of all the buffers and turning on the local minor mode in each one of them. > I have found something suspicious at source code > `lisp/emacs-lisp/easy-mmode.el:569:23': > > ;; Go through existing buffers. > (dolist (buf (buffer-list)) > (with-current-buffer buf > (if ,global-mode (funcall ,turn-on-function) > (when ,mode (,mode -1))))) > > It seems that `mode' at the predicate position of `when' should really > be `MODE-variable'! Adding Stefan in case he has some insights. > As an aside, the docstring of `define-globalized-minor-mode' is a bit > off the description in the ELisp manual. (Jumping between `C-h f' and > `C-h i m el i' is annoying, isn't it?) > > The manual says: > > By default, the buffer-local minor mode variable that says whether > the mode is switched on or off is the same as the name of the mode > itself. Use ‘:variable VARIABLE’ if that’s not the case–some minor > modes use a different variable to store this state information. > > While in docstring: > > Other keywords have the same meaning as in ‘define-minor-mode’, > which see. > > Clearly, `:variable' in `define-globalized-minor-mode' does not have the > same meaning as in `define-minor-mode', otherwise you would be > specifying the mode variable of the global mode, which is not the case. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 09 18:16:54 2025 Received: (at 79412) by debbugs.gnu.org; 9 Sep 2025 22:16:54 +0000 Received: from localhost ([127.0.0.1]:34016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uw6dx-0006TS-Ov for submit@debbugs.gnu.org; Tue, 09 Sep 2025 18:16:54 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:1954) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uw6dr-0006T7-6R for 79412@debbugs.gnu.org; Tue, 09 Sep 2025 18:16:50 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EAB9844168D; Tue, 9 Sep 2025 18:16:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757456199; bh=iGfdOBu4jw6ZAQATFQfBw5KOvUD8EntGrdBPVuhMvUI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UIfU7CapUuB/Fffb8gOuT6YA8qm8OyqYP3N299dNeCmyHa6PeJbW/qcl9Js/CA+rY y5knb74vWOJJIjwTeft85tCzX3QNXeg1HQmXRznLnNb3FiR4D8R0D+y15BulxkGpK6 ssZCAYM79DqLsygUALrA5dHg+gtFTQ9B7jFJYVYgACk0dwqU1bjFxzKd86FXrT0yuw InQgm+TpRD5w+rEDsrz0k/PdlqXuX0k4obS/ky/l9nP0kRl0SUX4RjqtPutLIGYRzh MPEizhe8oxZ/Cs6fqTQqGhMHArAIaWreo57gT7zPRoMWd5Un5MLwOOw3kjMPRz6LWk 8K0Au7jJRO4vA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2139C441681; Tue, 9 Sep 2025 18:16:39 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0B8DB12065C; Tue, 9 Sep 2025 18:16:39 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' In-Reply-To: <86frcvdea7.fsf@gnu.org> Message-ID: References: <86frcvdea7.fsf@gnu.org> Date: Tue, 09 Sep 2025 18:16:38 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.550 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412 Cc: inet0@qq.com, 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I have found something suspicious at source code >> `lisp/emacs-lisp/easy-mmode.el:569:23': >> >> ;; Go through existing buffers. >> (dolist (buf (buffer-list)) >> (with-current-buffer buf >> (if ,global-mode (funcall ,turn-on-function) >> (when ,mode (,mode -1))))) >> >> It seems that `mode' at the predicate position of `when' should really >> be `MODE-variable'! > > Adding Stefan in case he has some insights. I agree with "inet0@qq.com", here. It looks like an oversight in commit e1d54bb638df. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 11 11:29:40 2025 Received: (at 79412) by debbugs.gnu.org; 11 Sep 2025 15:29:40 +0000 Received: from localhost ([127.0.0.1]:44423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uwjEx-0005Wg-UG for submit@debbugs.gnu.org; Thu, 11 Sep 2025 11:29:40 -0400 Received: from xmbghk7.mail.qq.com ([43.163.128.54]:33685) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uwjEs-0005WD-N5 for 79412@debbugs.gnu.org; Thu, 11 Sep 2025 11:29:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1757604559; bh=jo77VXTh3gwgwVWxOtteDGxT+BDDqAbA5EcceYHaktE=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=EVMgz6DlKGuWANe12GRxLL40v7Xof84rIdflvdyAI+R+5rg081f/H4g/MzdYcDjnw mDh+AcMiP4927OrKy15U+HeFDPRNZSS1WS2UL6+66lSDdOqoIs4saoSK1JxKuWxPkD jZNuAuuQCPMJHM4zvT3gV9sYzKvpJDA1moQMGZ7A= Received: from localhost ([14.155.190.203]) by newxmesmtplogicsvrsza56-0.qq.com (NewEsmtp) with SMTP id 752ABCBB; Thu, 11 Sep 2025 23:29:18 +0800 X-QQ-mid: xmsmtpt1757604558ta3u1n6bo Message-ID: X-QQ-XMAILINFO: NQR8mRxMnur9i6KtBik01NE7mxbOT+ch6kseGSPuVqrITyLrsj/5enndjomBqF 7uBaGNWFZE6yOEEr3bahWE8uDDA78Qznhr0a70hwSDF058FuZ/DB86Tyyqz+GN9jPiBd4iWtrGNt GZ4B9qBL5CKLCQQ3T5DZGEQuSZEvSmtu/90EtofReVzlTUyDRRc9xzxWIRrlshtNsEuB9Zeei10q LpJAFiaod/+79d4DTQBdjFlUnE4lv/CwSAnUGH+oOiOiQidEmDQqG0XJrKCJba4RAdkWr2Re0oGb xCrTbQtqyOMrD5PmNIoQnTXQRTPN5K0EILji6IAH9unRO/hh9QgBmOziN2a1qs8iM3h7E9yWvkne wa+BnCtD0JdJt4Sfd9w+z0g2o+VKxIyBtJbKzYWCfloR6Q5oOF/R/P4kkFCy7aA5UVUtIEqdDq34 n6gYa1I2j9EI0GkLa9rvxJGf+yvI00q8PzGCX1hAzRoc2EuEC4KEflvUOrxhn68ewSaRDaHy+lnd 9cUEea3nMXMrZpjD7Mz90N0V8SJuTguRW4HZTMidXaWDU48+eOOSEYn18TSR2U29Uj0Khiuo1og3 vV6cxUYBDOs5Kr3H1IhRwCTTPeVjRPNhZgDRev2R7XxIkgZhj5SOFv0Yw4xckTwGVECtk82MR/NF 3SEd/OUn0b+riaE9wrI5eSujGoubmEcm+3ljTA+7lNShdraDI3Rwz4VCipQFuE1MlR1uSNFy1mAv jSLXf1KH7tsuVqjy+55SwwX7scZyVmjv74Sfp1U8gCVCBr4CP57T5G8BneU+CC7A2oLcsiOJYieo L46TUZ+7aBIO7ErvbywrBMRRvhjb9kLOxESX9AZm12f1zbkQZXWhULkMJBGt3TodUvogwIHpi/py 9G1Yl+svkFXZvzFltGGSbhDZLH0uvt/CXGH7AY+Fn/eL5ZJo6A8UGGppEoe6N3cwuQuH7ZoU/RBs iQCYm2UMMGd1q1NF3TH9yvopKylzYM X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= From: inet0@qq.com To: Eli Zaretskii Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' In-Reply-To: <86frcvdea7.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 09 Sep 2025 15:02:56 +0300") References: <86frcvdea7.fsf@gnu.org> Date: Thu, 11 Sep 2025 23:29:18 +0800 X-OQ-MSGID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79412 Cc: Stefan Monnier , 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > What this means is that using :variable leaves the mode variable, in > this case bidi-display-reordering-mode, undefined. Therefore, I think > you must define some non-trivial BODY for your minor mode, because the > default body will try to reference bidi-display-reordering-mode, and > will fail, as this backtrace shows: Did you mean to add back the variable `bidi-display-reordering-mode' like this? It does eliminate the bug for now: (define-minor-mode bidi-display-reordering-mode nil :variable bidi-display-reordering (setq-local bidi-display-reordering-mode bidi-display-reordering)) Actually my intention is to "mode-ify" those plain buffer-local variables such that they can be easily toggled on and off (either on a per-buffer basis or globally). I had tried utilizing `define-minor-mode' and `define-globalized-minor-mode' without appealing to `:variable', but as my code got complicated I doubted whether I was on the right track. (defvar-local binding-bidi-display-reordering nil) (define-minor-mode bidi-display-reordering-mode nil :ignored ignored (if (not binding-bidi-display-reordering) (dlet ((binding-bidi-display-reordering t)) (setq bidi-display-reordering bidi-display-reordering-mode)))) (add-variable-watcher 'bidi-display-reordering (lambda (sym val op buf) (if (not (null buf)) (with-current-buffer buf (if (not binding-bidi-display-reordering) (dlet ((binding-bidi-display-reordering t)) (bidi-display-reordering-mode (if val 1 0)))))))) (define-globalized-minor-mode global-bidi-display-reordering-mode bidi-display-reordering-mode (lambda () (bidi-display-reordering-mode 1))) (setq-default bidi-display-reordering nil) (global-bidi-display-reordering-mode 1) (keymap-global-set "C-c b" 'global-bidi-display-reordering-mode) Or should I stop playing with modes and just `set-all' everything? (defun set-all (variable value) (set-default variable value) (dolist (buffer (buffer-list)) (with-current-buffer buffer (if (local-variable-p variable) (set variable value))))) Any thoughts are appreciated! From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 13 05:57:45 2025 Received: (at 79412) by debbugs.gnu.org; 13 Sep 2025 09:57:45 +0000 Received: from localhost ([127.0.0.1]:53649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uxN0r-0005jZ-6G for submit@debbugs.gnu.org; Sat, 13 Sep 2025 05:57:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36638) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uxN0n-0005j4-M4 for 79412@debbugs.gnu.org; Sat, 13 Sep 2025 05:57:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uxN0e-0001Js-8q; Sat, 13 Sep 2025 05:57:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Ps1kKiOnpOpAnPK329KXLkgwnZeIrk3zw2UWn2t7F8Y=; b=kWNI6HmKTjP/ SHUNGfc3kuEiAiDlBZZGcXrEnAEx98H7Fpq0uSoU3faEvzHvq85c2aMLJ0Fioeqd5hKBLbQxSLLEZ a4I0FaOEJ/G5bx0JbM12qMpdiPIo/ihLrRFAS56akUXkypq0GNSVdjpzN8biJ5U4M4DJGwz8qLEWk TkJsAXhWzZH+MoeNnjVw5tQuoj6RoU1jTxdVc5MIyEYK8u5jlgyslqUdXb6js5zH79GIDtW0GPKxs yJpP63NMILsTf6AzPRqrAQOYpLfi2k5+ssNyuYChLFYfiZVwVwWCgdmdpH6e4SK6np3qDoktHEfFT gJibo4AloqvX5+kkwrg1MA==; Date: Sat, 13 Sep 2025 12:57:29 +0300 Message-Id: <86jz22r7xy.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 09 Sep 2025 18:16:38 -0400) Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' References: <86frcvdea7.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412 Cc: inet0@qq.com, 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: inet0@qq.com, 79412@debbugs.gnu.org > Date: Tue, 09 Sep 2025 18:16:38 -0400 > > >> I have found something suspicious at source code > >> `lisp/emacs-lisp/easy-mmode.el:569:23': > >> > >> ;; Go through existing buffers. > >> (dolist (buf (buffer-list)) > >> (with-current-buffer buf > >> (if ,global-mode (funcall ,turn-on-function) > >> (when ,mode (,mode -1))))) > >> > >> It seems that `mode' at the predicate position of `when' should really > >> be `MODE-variable'! > > > > Adding Stefan in case he has some insights. > > I agree with "inet0@qq.com", here. > It looks like an oversight in commit e1d54bb638df. So you mean this: diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index ca92130..de77eb3 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -570,7 +570,7 @@ define-globalized-minor-mode (dolist (buf (buffer-list)) (with-current-buffer buf (if ,global-mode (funcall ,turn-on-function) - (when ,mode (,mode -1))))) + (when ,mode (,MODE-variable -1))))) ,@body) ,(when predicate And what about this fragment: ;; The function that calls TURN-ON in the current buffer. (defun ,MODE-enable-in-buffer () (unless ,MODE-set-explicitly (unless (eq ,MODE-major-mode major-mode) (if ,MODE-variable (progn (,mode -1) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< (funcall ,turn-on-function)) (funcall ,turn-on-function)))) (setq ,MODE-major-mode major-mode)) (put ',MODE-enable-in-buffer 'definition-name ',global-mode)))) And this one: ;; Go through existing buffers. (dolist (buf (buffer-list)) (with-current-buffer buf (if ,global-mode (funcall ,turn-on-function) (when ,mode (,MODE-variable -1))))) ,@body) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 13 12:15:06 2025 Received: (at 79412) by debbugs.gnu.org; 13 Sep 2025 16:15:07 +0000 Received: from localhost ([127.0.0.1]:56214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uxSu1-0006A8-R6 for submit@debbugs.gnu.org; Sat, 13 Sep 2025 12:15:06 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9677) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uxStx-000697-Lu for 79412@debbugs.gnu.org; Sat, 13 Sep 2025 12:15:02 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 43A39440C6D; Sat, 13 Sep 2025 12:14:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757780094; bh=5zn05HS5X6GnUigvynYuQpGFDIHQdbfN2H1BIsErk7c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ph5DppYn35UGrnYoAlJtNt+HDyagpap9UErr9FGKFXeQU59c14KTiVeLS0CXumA6z Wg5eYXSJxzEdVSeBMcQdsti24hxcyGxjTsZ0ogxu1MOKd5W6IfJwdIODjhHEOliHMp gfGcyuR4m+40cb3mxh7v3xdjknsA7ySSlKDtXFf+SwW8wSVM+2Qck4e4UpiXbDqslV ytWj/g8F8dS2ldkSJmbPnTl7CiycjbzHoGECsMhCdnHKhd5GmMt6xSzlGjEq/D9ZWj 5N5rkd5XifTjRIzPjBzvD0MXxS+oSvegvQxZZYWS+wf37S6UG/RF4JRFsHUnkR6wiE oylm1kB7e3nbA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 51630440BE1; Sat, 13 Sep 2025 12:14:54 -0400 (EDT) Received: from pastel (unknown [104.247.225.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1CF851203CA; Sat, 13 Sep 2025 12:14:54 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' In-Reply-To: <86jz22r7xy.fsf@gnu.org> Message-ID: References: <86frcvdea7.fsf@gnu.org> <86jz22r7xy.fsf@gnu.org> Date: Sat, 13 Sep 2025 12:14:53 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.264 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412 Cc: inet0@qq.com, 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > So you mean this: > > diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el > index ca92130..de77eb3 100644 > --- a/lisp/emacs-lisp/easy-mmode.el > +++ b/lisp/emacs-lisp/easy-mmode.el > @@ -570,7 +570,7 @@ define-globalized-minor-mode > (dolist (buf (buffer-list)) > (with-current-buffer buf > (if ,global-mode (funcall ,turn-on-function) > - (when ,mode (,mode -1))))) > + (when ,mode (,MODE-variable -1))))) > ,@body) > > ,(when predicate No, like (when ,MODE-variable (,mode -1)) - Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 13 12:19:02 2025 Received: (at 79412) by debbugs.gnu.org; 13 Sep 2025 16:19:02 +0000 Received: from localhost ([127.0.0.1]:56270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uxSxq-0006gJ-4g for submit@debbugs.gnu.org; Sat, 13 Sep 2025 12:19:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59994) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uxSxm-0006fW-Ng for 79412@debbugs.gnu.org; Sat, 13 Sep 2025 12:19:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uxSxe-0007kR-KU; Sat, 13 Sep 2025 12:18:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ATwnrQ4DGHnBWEzNp4Lv+qAK84tsgA79UCEtaT6cqbs=; b=MrJq6lcsc8Bc Z0j9be5nDT0yyKdjRSaWRl1VvdVdleXoST8h8lgBDxA5tKLR4lT3mzHYOuWneceYmwh+po4ya1adw z11K8SVL83AM5J5p4Z2wWEStNtHpnYWSktyJ5rcMf/ANGrF6gvdlJ36dhxVjwEJeZX4iIUSw9Ysoe wAfFKAFjTqkrtQLTfeRTaBc1nRo4QqzVg63i+EZJ63a0naHSXVh9ZzCAMqHAjxORnL+3F3qLYYa3a vjiEQNXG1D5UscYIWAxHfzlO4pBfmTbTWDowpfcYjDltOWprtzdssz/tz8U4BTbA4AZPBT/0tCjpG m92P3gXF6vCj5GMmuYWTAg==; Date: Sat, 13 Sep 2025 19:18:44 +0300 Message-Id: <86ikhmpbq3.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sat, 13 Sep 2025 12:14:53 -0400) Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' References: <86frcvdea7.fsf@gnu.org> <86jz22r7xy.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412 Cc: inet0@qq.com, 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: inet0@qq.com, 79412@debbugs.gnu.org > Date: Sat, 13 Sep 2025 12:14:53 -0400 > > > So you mean this: > > > > diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el > > index ca92130..de77eb3 100644 > > --- a/lisp/emacs-lisp/easy-mmode.el > > +++ b/lisp/emacs-lisp/easy-mmode.el > > @@ -570,7 +570,7 @@ define-globalized-minor-mode > > (dolist (buf (buffer-list)) > > (with-current-buffer buf > > (if ,global-mode (funcall ,turn-on-function) > > - (when ,mode (,mode -1))))) > > + (when ,mode (,MODE-variable -1))))) > > ,@body) > > > > ,(when predicate > > No, like > > (when ,MODE-variable (,mode -1)) And what about this one: ;; Go through existing buffers. (dolist (buf (buffer-list)) (with-current-buffer buf (if ,global-mode (funcall ,turn-on-function) (when ,mode (,MODE-variable -1))))) ,@body) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 13 13:45:39 2025 Received: (at 79412) by debbugs.gnu.org; 13 Sep 2025 17:45:39 +0000 Received: from localhost ([127.0.0.1]:56836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uxUJf-00067g-Cg for submit@debbugs.gnu.org; Sat, 13 Sep 2025 13:45:39 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33593) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uxUJb-00067F-TC for 79412@debbugs.gnu.org; Sat, 13 Sep 2025 13:45:36 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 12496440C83; Sat, 13 Sep 2025 13:45:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757785527; bh=iw37R9s9zF1QPoKhMrGQuoqGFDCk4LIGCF8GjjOYSTY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=geC7l1gm97P6K6C0VslXvAAy0n6OSoY8ecIo0SgPs5W6W0Plmvrmq+KmTavLb+UmK BQEQ6gbBwopfabs0WGTYGg4MqUovsSJxorCoWZ7KENo7cjI98u/bL2Z+1nP8KNWseL kV5Hx0AEbMuJh+mfIff5LJnAMvz9wRjP3dqcRz1jb8o132e2k8LZlSRdUgPHyZM9Ul 6CmqOXHMfTwDfNExhUoc997cK2An/QcY2DP4SeBLznhlM0Dy+i9k8Rcs61pAoadacr AktX9o+JtsCUxe17rBiQ9vPReJQX2/4Jzla9NNhzfraDNvsEXKYCNeid+A6W989Roz 62YZRQBGxmbOg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 916E6440C30; Sat, 13 Sep 2025 13:45:27 -0400 (EDT) Received: from pastel (unknown [104.247.225.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5D3BD12053B; Sat, 13 Sep 2025 13:45:27 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' In-Reply-To: <86ikhmpbq3.fsf@gnu.org> Message-ID: References: <86frcvdea7.fsf@gnu.org> <86jz22r7xy.fsf@gnu.org> <86ikhmpbq3.fsf@gnu.org> Date: Sat, 13 Sep 2025 13:45:26 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.231 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412 Cc: inet0@qq.com, 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> No, like >> >> (when ,MODE-variable (,mode -1)) > > And what about this one: > > ;; Go through existing buffers. > (dolist (buf (buffer-list)) > (with-current-buffer buf > (if ,global-mode (funcall ,turn-on-function) > (when ,mode (,MODE-variable -1))))) > ,@body) It needs the same change, yes: `mode` should be used only as the name of a function, not as the name of a variable. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 13 13:51:08 2025 Received: (at 79412) by debbugs.gnu.org; 13 Sep 2025 17:51:08 +0000 Received: from localhost ([127.0.0.1]:56844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uxUOx-0006Rr-SP for submit@debbugs.gnu.org; Sat, 13 Sep 2025 13:51:08 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45823) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uxUOt-0006Qz-N1 for 79412@debbugs.gnu.org; Sat, 13 Sep 2025 13:51:04 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C9A931000BC; Sat, 13 Sep 2025 13:50:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757785856; bh=su0ShMvtwvVGI5ZHi8y7/Fz+rZB55VujXv3CC/kqCmo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AeuGPU1vQyzBCxAG/BIaXCnL1dWJNL5yuQdE4G8uWRr0HqzZKrnz/6XhcPUMkAhoL oHDG5on/WInUSz7ZQEkWukl6GCaj5oMTr1aeb+vQ1aIZekDmYoziBltwwqZBunegei NFamGBvGMfHnQ8qVGva0JIv3N/HO63X5ISSBebcCPs66i53Ax2l1ktx4OW2iP0ku5v fSGaP3i0Q6wRtZot9Ad4p2vQBH18BWkndJxo1yVfL0TRQbDx8lTZlZmvRgWngoEqpA 9t4vaW4A0lwrxpFOg30SlYMdQJ4sHbE6OWfiNDvk7PC4SknnOtgOzivsjpr6e3I2ig OqGQINN7aLNCA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E798F100029; Sat, 13 Sep 2025 13:50:56 -0400 (EDT) Received: from pastel (unknown [104.247.225.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B149612034C; Sat, 13 Sep 2025 13:50:56 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' In-Reply-To: <86ikhmpbq3.fsf@gnu.org> Message-ID: References: <86frcvdea7.fsf@gnu.org> <86jz22r7xy.fsf@gnu.org> <86ikhmpbq3.fsf@gnu.org> Date: Sat, 13 Sep 2025 13:50:25 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.254 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412 Cc: inet0@qq.com, 79412@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> > So you mean this: >> > >> > diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el >> > index ca92130..de77eb3 100644 >> > --- a/lisp/emacs-lisp/easy-mmode.el >> > +++ b/lisp/emacs-lisp/easy-mmode.el >> > @@ -570,7 +570,7 @@ define-globalized-minor-mode >> > (dolist (buf (buffer-list)) >> > (with-current-buffer buf >> > (if ,global-mode (funcall ,turn-on-function) >> > - (when ,mode (,mode -1))))) >> > + (when ,mode (,MODE-variable -1))))) >> > ,@body) >> > >> > ,(when predicate >> >> No, like >> >> (when ,MODE-variable (,mode -1)) > > And what about this one: > > ;; Go through existing buffers. > (dolist (buf (buffer-list)) > (with-current-buffer buf > (if ,global-mode (funcall ,turn-on-function) > (when ,mode (,MODE-variable -1))))) > ,@body) Hmm... actually this is the same as the one further above. AFAICT there's only one such piece of code in `easy-mmode.el`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 13 15:24:42 2025 Received: (at 79412-done) by debbugs.gnu.org; 13 Sep 2025 19:24:42 +0000 Received: from localhost ([127.0.0.1]:57171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uxVrV-0005DX-Kl for submit@debbugs.gnu.org; Sat, 13 Sep 2025 15:24:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42768) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uxVrR-0005Cr-Qg for 79412-done@debbugs.gnu.org; Sat, 13 Sep 2025 15:24:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uxVrK-0008Gp-M6; Sat, 13 Sep 2025 15:24:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PFvsM3XC81/27QR5Yzxa9am4ryopzvRQjt/f6BOK6Z8=; b=c6PU/IRmqIrK Bf0IF8JZt3OpZUL+qQWw6HqGtE6DLtibgQaQys4f4PqyEvWBFUyQC0eoCcINOOwDsRSVBqrO8R5oM mZSeu+g3NIHsT06wP+hyTseZE7QPy7g4rJWUOSEnjFIs1IItcojSYZu0CzEEPXnllw48biEECUDkm q5QV0i1kSaMhYjaNHtxtH9e3ha4GvGwSEA9rP/LlRmTMjTIgayM36+F83E5GH0cz1phImLCvQo07L P0LjB7TzsAnZSIegRD6BFS/JWKAo2VmBG4AOp23rx9/+6VHp1ieUClSfQOUUfritiO1kFd6kFA9nw 2CdQTThVfiHue9G2rYliXA==; Date: Sat, 13 Sep 2025 22:24:25 +0300 Message-Id: <86h5x6p34m.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sat, 13 Sep 2025 13:50:25 -0400) Subject: Re: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable' References: <86frcvdea7.fsf@gnu.org> <86jz22r7xy.fsf@gnu.org> <86ikhmpbq3.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79412-done Cc: inet0@qq.com, 79412-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: inet0@qq.com, 79412@debbugs.gnu.org > Date: Sat, 13 Sep 2025 13:50:25 -0400 > > >> > So you mean this: > >> > > >> > diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el > >> > index ca92130..de77eb3 100644 > >> > --- a/lisp/emacs-lisp/easy-mmode.el > >> > +++ b/lisp/emacs-lisp/easy-mmode.el > >> > @@ -570,7 +570,7 @@ define-globalized-minor-mode > >> > (dolist (buf (buffer-list)) > >> > (with-current-buffer buf > >> > (if ,global-mode (funcall ,turn-on-function) > >> > - (when ,mode (,mode -1))))) > >> > + (when ,mode (,MODE-variable -1))))) > >> > ,@body) > >> > > >> > ,(when predicate > >> > >> No, like > >> > >> (when ,MODE-variable (,mode -1)) > > > > And what about this one: > > > > ;; Go through existing buffers. > > (dolist (buf (buffer-list)) > > (with-current-buffer buf > > (if ,global-mode (funcall ,turn-on-function) > > (when ,mode (,MODE-variable -1))))) > > ,@body) > > Hmm... actually this is the same as the one further above. > AFAICT there's only one such piece of code in `easy-mmode.el`. Thanks, I hope I've fixed this now.