From unknown Sun Aug 17 10:17:25 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#29081 <29081@debbugs.gnu.org> To: bug#29081 <29081@debbugs.gnu.org> Subject: Status: 25.1; define-globalized-minor-mode does not respect :variable of original mode Reply-To: bug#29081 <29081@debbugs.gnu.org> Date: Sun, 17 Aug 2025 17:17:25 +0000 retitle 29081 25.1; define-globalized-minor-mode does not respect :variable= of original mode reassign 29081 emacs submitter 29081 k@rdw.se (Chris Stj) severity 29081 normal tag 29081 confirmed easy fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 31 11:40:51 2017 Received: (at submit) by debbugs.gnu.org; 31 Oct 2017 15:40:51 +0000 Received: from localhost ([127.0.0.1]:44384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9Yeo-0005GP-JH for submit@debbugs.gnu.org; Tue, 31 Oct 2017 11:40:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9VgP-00073L-Rh for submit@debbugs.gnu.org; Tue, 31 Oct 2017 08:30:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9VgF-00085w-Si for submit@debbugs.gnu.org; Tue, 31 Oct 2017 08:30:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53665) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e9VgF-00085q-PJ for submit@debbugs.gnu.org; Tue, 31 Oct 2017 08:30:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9VgE-0007JN-FI for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 08:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9Vg8-00081Y-Fp for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 08:30:06 -0400 Received: from shelly.rdw.se ([188.226.220.149]:41832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9Vg8-00080v-9K for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 08:30:00 -0400 Received: from localhost (vps.xkqr.org [109.74.206.55]) by shelly.rdw.se (Postfix) with ESMTPSA id EDE8E400E9 for ; Tue, 31 Oct 2017 13:29:58 +0100 (CET) From: k@rdw.se (Chris Stj) To: bug-gnu-emacs@gnu.org Subject: 25.1; define-globalized-minor-mode does not respect :variable of original mode Date: Tue, 31 Oct 2017 13:29:57 +0100 Message-ID: <87efpjijp6.fsf@rdw.se> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 31 Oct 2017 11:40:49 -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: -4.0 (----) I tried to define a global version of auto-fill mode by evaluating (define-globalized-minor-mode global-auto-fill-mode auto-fill-mode turn-on-auto-fill) The problem is that when the define-globalized-minor-mode macro expands, it defines the function (defun ,MODE-enable-in-buffers () (dolist (buf ,MODE-buffers) (when (buffer-live-p buf) (with-current-buffer buf (unless ,MODE-set-explicitly (unless (eq ,MODE-major-mode major-mode) (if ,mode (progn (,mode -1) (funcall #',turn-on)) (funcall #',turn-on)))) (setq ,MODE-major-mode major-mode))))) The problem lies in the "if ,mode" condition. This assumes the minor mode variable has the same name as the minor mode itself; which is clearly not true when something else is specified with the :variable keyword in the minor mode definition. I noticed this with auto-fill-mode, since it calls its status variable auto-fill-function rather than auto-fill-mode. I guess the best solution may be to allow users of define-globalized-minor-mode to specify the place in which the minor mode stores its state, since I can't find a good, generic way to extract this from the minor mode definition itself, after the fact. Regards, Chris From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 02 14:04:36 2017 Received: (at 29081) by debbugs.gnu.org; 2 Dec 2017 19:04:36 +0000 Received: from localhost ([127.0.0.1]:42195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eLD5X-0003iL-Qs for submit@debbugs.gnu.org; Sat, 02 Dec 2017 14:04:36 -0500 Received: from mail-io0-f178.google.com ([209.85.223.178]:36239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eLD5V-0003i3-V8; Sat, 02 Dec 2017 14:04:34 -0500 Received: by mail-io0-f178.google.com with SMTP id 81so14644893iof.3; Sat, 02 Dec 2017 11:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8Mh3B6RAbhdRAr6ad1YQ12WNzw/q90VGT3kL4iHtrTY=; b=RhOgwnkW43OSRkrIG5Zy6Ax3ns5bKTUg1IfFl006uEfp9O80VmSMthxjfj18qAYijJ XyBzqfI4lnG68+G3qlhXPJFBNC08aebshg5/2kkv3wC1Fjjehb+yJAtyEsI2ym1y7kUr kIUYih4RzscoR39+PvNJPhlNsP9BewNXYvGxZX6JDep8KYzVz9S51e9GTUP0Ir+6X+7q 4E4DoB2AfXPCmgnRWr5I19kyMey+scuKonOenTT5u0OiPWqVjC7gn37tGHgjuaf+aMTo BCvUPIEOImgI3Skl7ywcgXkYGnrqpFebwQ00vuQzLMBZUyMO5kZsA4evgCC6KSd+zxFv 3bCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8Mh3B6RAbhdRAr6ad1YQ12WNzw/q90VGT3kL4iHtrTY=; b=rLXBQvyjyxo5qx99llJtASC+v6xLiOPDXv35wKq72dHPKgvx8MCHQSGLUU+yZeDyY2 /Izf8vWjPovSaKi4S7dIfbiczuO3/nvUX2uS8tckNysg+faw4N81O4YTujBE99wWjz7R in7PXdAA74o0uBzcF/1tn0U+vBmYTVVhp4caxWI2hUr/0+tG/YfEIqI8kNTJP3Zoqgn6 pz/T3qrndKcMomCCXR9EP+NdN61gQ8YKkI1+bSKC49cGtxoUbqBqJOcbkOS/ir8znfWw wi6Mz0pwKq4omrXyS72uJlBj0EFE4Jn4TFwLbw/kEkovoBHBxQ41OspU8AFEcQYEuFpx HNsA== X-Gm-Message-State: AJaThX4rp5IHQXYQK49qsr8im+WT0WqEAtH7FoikPnpK4WvzsUxycvd9 f7EUUq7uawD4ZbzU5KxhwjAKbg== X-Google-Smtp-Source: AGs4zMboxkZ454qWRxcjibmHrjKNu9iL8OrL7sMzWy64aYfp932m5y8lY9CsWuRwpr8iYNi+lhBE1w== X-Received: by 10.107.25.204 with SMTP id 195mr18438706ioz.67.1512241468177; Sat, 02 Dec 2017 11:04:28 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id o73sm2109307ito.4.2017.12.02.11.04.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Dec 2017 11:04:27 -0800 (PST) From: Noam Postavsky To: k@rdw.se (Chris Stj) Subject: Re: bug#29081: 25.1; define-globalized-minor-mode does not respect :variable of original mode References: <87efpjijp6.fsf@rdw.se> Date: Sat, 02 Dec 2017 14:04:26 -0500 In-Reply-To: <87efpjijp6.fsf@rdw.se> (Chris Stj's message of "Tue, 31 Oct 2017 13:29:57 +0100") Message-ID: <874lp9j6it.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29081 Cc: 29081@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.0 (/) tags 29081 + confirmed easy quit k@rdw.se (Chris Stj) writes: > The problem lies in the "if ,mode" condition. This assumes the minor > mode variable has the same name as the minor mode itself; which is > clearly not true when something else is specified with the :variable > keyword in the minor mode definition. > I guess the best solution may be to allow users of > define-globalized-minor-mode to specify the place in which the minor > mode stores its state, since I can't find a good, generic way to extract > this from the minor mode definition itself, after the fact. Makes sense to me. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 04 09:23:24 2021 Received: (at 29081) by debbugs.gnu.org; 4 Feb 2021 14:23:24 +0000 Received: from localhost ([127.0.0.1]:40312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7fXX-0004xl-U7 for submit@debbugs.gnu.org; Thu, 04 Feb 2021 09:23:24 -0500 Received: from quimby.gnus.org ([95.216.78.240]:57818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7fXU-0004xV-Tv for 29081@debbugs.gnu.org; Thu, 04 Feb 2021 09:23:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=46O6xRlU5fnKSuazqn46srnqGfscWyOAovpvXRvjgEI=; b=gwd33nlrDpNuowQxqRscruK+jc S74+NmdEVv4F2/Gc1tbHmovFQRIzNV7NgZPo1//BXfeXdcLC1v5IdEbuzhJAby/GtYt0tg9Ml83AI +SwHrAS3jz46aTmJd6RR8Vqfnhg/jlc22oaNMFuS5XNzDIhGP26lhXgDJyH36HUlKaBk=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7fXG-0008D1-QZ; Thu, 04 Feb 2021 15:23:14 +0100 From: Lars Ingebrigtsen To: Noam Postavsky Subject: Re: bug#29081: 25.1; define-globalized-minor-mode does not respect :variable of original mode References: <87efpjijp6.fsf@rdw.se> <874lp9j6it.fsf@users.sourceforge.net> X-Now-Playing: Black Stereo Faith's _Black Stereo Faith_: "Taking Me High" Date: Thu, 04 Feb 2021 15:23:02 +0100 In-Reply-To: <874lp9j6it.fsf@users.sourceforge.net> (Noam Postavsky's message of "Sat, 02 Dec 2017 14:04:26 -0500") Message-ID: <878s83rjy1.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.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 @@CONTACT_ADDRESS@@ for details. Content preview: Noam Postavsky writes: >> I guess the best solution may be to allow users of >> define-globalized-minor-mode to specify the place in which the minor >> mode stores its state, since I can't find a good, generic way to extrac [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29081 Cc: 29081@debbugs.gnu.org, Chris Stj 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: -1.0 (-) Noam Postavsky writes: >> I guess the best solution may be to allow users of >> define-globalized-minor-mode to specify the place in which the minor >> mode stores its state, since I can't find a good, generic way to extract >> this from the minor mode definition itself, after the fact. > > Makes sense to me. Me too, so I've added this to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 04 09:23:27 2021 Received: (at control) by debbugs.gnu.org; 4 Feb 2021 14:23:27 +0000 Received: from localhost ([127.0.0.1]:40315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7fXb-0004y0-Af for submit@debbugs.gnu.org; Thu, 04 Feb 2021 09:23:27 -0500 Received: from quimby.gnus.org ([95.216.78.240]:57834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7fXZ-0004xc-MU for control@debbugs.gnu.org; Thu, 04 Feb 2021 09:23:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=h6PxIemcjSpmhfL4raTQt71Sz1nB55WQdDVnGkwwLl8=; b=firBXK/6o86OMyqlr6c/N76Vtq u2M5ziXZvQSPxkNmxIDj6pU+xKhIbdUOxrav7NYFYpgH5nIIwQcfa/MWpOUFYSb1jT5CYw4E2VBd2 APSpa9qioQs6xBc3+FVotYeDtq0Se6zDiaxm5WZ15bzTuiI38sZsGmriBYTN0R6i0yJs=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7fXR-0008DC-SD for control@debbugs.gnu.org; Thu, 04 Feb 2021 15:23:20 +0100 Date: Thu, 04 Feb 2021 15:23:16 +0100 Message-Id: <877dnnrjxn.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #29081 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.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 @@CONTACT_ADDRESS@@ for details. Content preview: tags 29081 fixed close 29081 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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: -1.0 (-) tags 29081 fixed close 29081 28.1 quit From unknown Sun Aug 17 10:17:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 05 Mar 2021 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator