GNU bug report logs - #76700
31.0.50; find-func.el: incorrect use of minor mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Madhu <enometh@HIDDEN>; dated Mon, 3 Mar 2025 03:07:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 76700 <at> debbugs.gnu.org:


Received: (at 76700) by debbugs.gnu.org; 9 Mar 2025 10:11:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 09 06:11:34 2025
Received: from localhost ([127.0.0.1]:58474 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trDd7-0006at-Gu
	for submit <at> debbugs.gnu.org; Sun, 09 Mar 2025 06:11:33 -0400
Received: from smtp5.ctinetworks.com ([205.166.61.198]:51806)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <enometh@HIDDEN>) id 1trDd4-0006ag-NP
 for 76700 <at> debbugs.gnu.org; Sun, 09 Mar 2025 06:11:31 -0400
X-ctinetworks-Watermark: 1742379089.95491@zSTWfTFJBNmyXnla2I8JCA
X-ctinetworks-Envelope-From: enometh@HIDDEN
X-ctinetworks-SpamCheck: 
X-ctinetworks-VirusCheck: Found to be clean
X-ctinetworks-Message-ID: B80FF2064EE9.A3D1D
Received: from localhost (unknown [117.254.36.7])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: enometh@HIDDEN)
 by smtp5.ctinetworks.com (Postfix) with ESMTPSA id B80FF2064EE9;
 Sun,  9 Mar 2025 06:11:27 -0400 (EDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp5.ctinetworks.com B80FF2064EE9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meer.net;
 s=ctidkims1; t=1741515089;
 bh=RXTiwDT6nZzfgWPCp3qwsIrUxyTJ738R3pjnoS/8r0g=;
 h=Date:To:Cc:Subject:From:In-Reply-To:References:From;
 b=noIpflAhI5jL5szlPz9MC96e4H0eVcAArfHlZ5UdPOMwDzxXFOJPFmf1F6XsCbr/d
 uNal3fL5qmTZWx/yJbYsrhvVCHglFdfio4HR+DasSVmhoiISuW0KZExUJpkYzMzoI/
 9rliZCtGQv8Mh65Y0aiwZ/7I31Ur2sXnNB2lNkzQ=
Date: Sun, 09 Mar 2025 15:41:52 +0530 (IST)
Message-Id: <20250309.154152.872204160771607664.enometh@HIDDEN>
To: spwhitton@HIDDEN
Subject: Re: bug#76700: 31.0.50; find-func.el: incorrect use of minor mode
From: Madhu <enometh@HIDDEN>
In-Reply-To: <87zfhuhh49.fsf@HIDDEN>
References: <20250303.083632.1827656174320200580.enometh@HIDDEN>
 <87zfhuhh49.fsf@HIDDEN>
X-Mailer: Mew version 6.9 on Emacs 31.0.50
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76700
Cc: 76700 <at> debbugs.gnu.org, me@HIDDEN, rms@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

*  Sean Whitton <87zfhuhh49.fsf@HIDDEN>
Wrote on Sun, 09 Mar 2025 14:07:18 +0800

> A couple of preliminaries:
> (1) Madhu, you make various claims about how you think a minor mode must
>     work, but I don't believe you are correct.
>     There aren't hard rules in this area, as you seem to think.

Sorry Sean, I've tried to explain how the modes are supposed to work,
I believe you were making a mistake out of ignorance of how emacs
works but if you insist on doubling down on your position...

> (2) Your comments don't cover the actual reasons why I made this change.
>     These were, primarily,
>     (i)     so that the bindings can be toggled on and off, not just
>             turned on
>     (ii)    so that the bindings can be turned on and off using the
>             customization interface, instead of by manually calling a
>             particular function; and

You are using the wrong tool for the job.

>     (iii)   for most people, standard minor mode bindings (i.e. the
>             original version of the patch before Eshel commented) are
>             more useful.

It violates the principle of emacs modes which is a conceptual
regression.

I'm cc'ing RMS who authored the original code, perhaps he can review
the earlier messages and confirm this is a wrong use for minor modes
and why he didn't use a minor mode in the first place.


> I think, though, that everyone can have what they want.  I propose to
> add a new defcustom which can be used to switch between my original
> version of the patch and the one after Eshel's requested changes.

Please remember If you have a minor mode the bindings should be on
keymap. the minor mode should not be mucking with global
bindings. Maintainers should be expected to stick to this principle.

> Eshel -- I would like the default to be my original version of the
> patch, so you would need to toggle a defcustom.  This is because I think
> your workflow is probably the more unusual one.

What's wrong with the patch I supplied?  Eshel and his users (me
included) can continue using the original function which is backward
compatible to turn on global bindings. turning find-func mode on and
off will turn the minor mode keymap on and off, as minor modes are
suppose to work.







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76700; Package emacs. Full text available.

Message received at 76700 <at> debbugs.gnu.org:


Received: (at 76700) by debbugs.gnu.org; 9 Mar 2025 06:50:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 09 01:50:49 2025
Received: from localhost ([127.0.0.1]:57848 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trAUr-0007gC-B7
	for submit <at> debbugs.gnu.org; Sun, 09 Mar 2025 01:50:49 -0500
Received: from mail.eshelyaron.com ([107.175.124.16]:47552 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1trAUo-0007g4-V8
 for 76700 <at> debbugs.gnu.org; Sun, 09 Mar 2025 01:50:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1741503046;
 bh=F4rM/XHXungWAcH3a6baLQlj5i021Leooo7jiaoUGSo=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=I5jlqopZ8UL95vb5UIM88dlcMtDyyHNYw6TS58hnAZzmqd6WHsJGslUi8/SIjyjHX
 JG6UAaSvkvu3KzPjfhZe8NPH7KEqqyLGVZQzCkWydtOwnp4J+TmxlHcTrjY2lQwyN+
 mdTmAaH7ti026CqnPFneBwFIWzATrAFT/1ZUbQW4riPcn6GcvL2Jl9D1fiW2H/nMFe
 VOz2aYNbssFRp/euOwseUdMqYxUL9Ac3eUJKAuKH/OP2ae/NTalPcJTvsuQj7nNxTh
 rJJovb3dMJr0alg7od6oYgSjkdRf5D8DP6bxkFRpL8TIqlrGNlC4fd2ZRkEbdGioGn
 2I4xZarLJMevA==
From: Eshel Yaron <me@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#76700: 31.0.50; find-func.el: incorrect use of minor mode
In-Reply-To: <87zfhuhh49.fsf@HIDDEN>
References: <20250303.083632.1827656174320200580.enometh@HIDDEN>
 <87zfhuhh49.fsf@HIDDEN>
Date: Sun, 09 Mar 2025 07:50:43 +0100
Message-ID: <m1r036vgsc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76700
Cc: 76700 <at> debbugs.gnu.org, Madhu <enometh@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Sean,

Sean Whitton <spwhitton@HIDDEN> writes:

> I think, though, that everyone can have what they want.  I propose to
> add a new defcustom which can be used to switch between my original
> version of the patch and the one after Eshel's requested changes.
>
> Eshel -- I would like the default to be my original version of the
> patch, so you would need to toggle a defcustom.  This is because I think
> your workflow is probably the more unusual one.
>
> Let me know how this sounds.

Thanks for the heads-up, no objections here.  I'd be happy to review the
patch if you want someone to take a look before you install it.


Best,

Eshel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76700; Package emacs. Full text available.

Message received at 76700 <at> debbugs.gnu.org:


Received: (at 76700) by debbugs.gnu.org; 9 Mar 2025 06:07:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 09 01:07:31 2025
Received: from localhost ([127.0.0.1]:57755 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tr9ox-0005XA-3p
	for submit <at> debbugs.gnu.org; Sun, 09 Mar 2025 01:07:31 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50202)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1tr9ot-0005Wu-Tx
 for 76700 <at> debbugs.gnu.org; Sun, 09 Mar 2025 01:07:29 -0500
DKIM-Signature: a=rsa-sha256;
 b=AjAjCFuOzIKpLFViN1db6SBlDUsCxUIWPdsJ24eQMOUPeEn6Wbrqb4bJk2wOQ1M/Fi/1zAVvjlKCLr+8RqF/1AdJ2OlreJU6bc2sJ+78xoSH8MglGdB/NLC3mTbhxOIwK3D5AmNAOFbVK+aR7cXDAJmnZFgwcCcw0arnPHc1iYekdkCnZHj/b1dbLK62/CnI3bSBHTOJKElwWHuM5Ct5FEIXDfX+vH9YkKn9c7xLdph1HojJIrttl4xHmcQS2+qdeAuZ7dvZyeK3G3TXTE+TVjgOhxqyYkk3g6+o9p81SFKAv48HhDwy7PvCsfoTXwWvNAf3n+KghpwZWp/zOSEpgA==;
 s=purelymail3; d=spwhitton.name; v=1;
 bh=Tu4eglz0Zo1yY72emsRunViv6058I9woBGgYa6GopZI=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=oeYHbO8hF9M6ZpftHBT4tjSF/CGyHvmiyKJR4wURhXHzGNnpIxpeZnYkN4vpgxO/REQK7x4jhsPtBmkGwrp0W3nzFOwMBsjv2yYgrMltQYhquXj+EPm7EIP3hmSk7a/4x5TNYW0FUvJ01Qzv+d9f+yEaslKHuTmH/JYVgWlxgYh/XIUOemfyzr+giTkZv1YZZRjrJ0/2s1/l5aUDPCmrZwR3qSkmzO6Z2JZjMApRzUaMOkGbZDOt545rvIYC4j4uVd6+slabgxE/iDwVw73EW/eD2sjAxq14auATSqbpv5XTVUseJTufZ/6+8dFPbCIFbBakxfr0NNifqL6l0iGztw==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=Tu4eglz0Zo1yY72emsRunViv6058I9woBGgYa6GopZI=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: 76700 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1468609440; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 09 Mar 2025 06:07:21 +0000 (UTC)
Received: by melete.silentflame.com (Postfix, from userid 1000)
 id 96F177E02FD; Sun,  9 Mar 2025 14:07:18 +0800 (CST)
From: Sean Whitton <spwhitton@HIDDEN>
To: Madhu <enometh@HIDDEN>, Eshel Yaron <me@HIDDEN>
Subject: Re: bug#76700: 31.0.50; find-func.el: incorrect use of minor mode
In-Reply-To: <20250303.083632.1827656174320200580.enometh@HIDDEN>
References: <20250303.083632.1827656174320200580.enometh@HIDDEN>
Date: Sun, 09 Mar 2025 14:07:18 +0800
Message-ID: <87zfhuhh49.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76700
Cc: 76700 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello Madhu, Eshel,

A couple of preliminaries:

(1) Madhu, you make various claims about how you think a minor mode must
    work, but I don't believe you are correct.
    There aren't hard rules in this area, as you seem to think.

(2) Your comments don't cover the actual reasons why I made this change.
    These were, primarily,
    (i)     so that the bindings can be toggled on and off, not just
            turned on
    (ii)    so that the bindings can be turned on and off using the
            customization interface, instead of by manually calling a
            particular function; and
    (iii)   for most people, standard minor mode bindings (i.e. the
            original version of the patch before Eshel commented) are
            more useful.

I think, though, that everyone can have what they want.  I propose to
add a new defcustom which can be used to switch between my original
version of the patch and the one after Eshel's requested changes.

Eshel -- I would like the default to be my original version of the
patch, so you would need to toggle a defcustom.  This is because I think
your workflow is probably the more unusual one.

Let me know how this sounds.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76700; Package emacs. Full text available.

Message received at 76700 <at> debbugs.gnu.org:


Received: (at 76700) by debbugs.gnu.org; 3 Mar 2025 03:29:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 02 22:29:24 2025
Received: from localhost ([127.0.0.1]:41697 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1towUe-000767-Bz
	for submit <at> debbugs.gnu.org; Sun, 02 Mar 2025 22:29:24 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:52116)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1towUY-00075U-HE
 for 76700 <at> debbugs.gnu.org; Sun, 02 Mar 2025 22:29:21 -0500
DKIM-Signature: a=rsa-sha256;
 b=xOzJRzyZDH125WHbAnbuAH6elU1HdDp6lttm1TeuqL5qZyebwKKiGdVeOGKaqHl+FYYDfyRz9vOFxyB542wWeyg8718F/CgZCd88d87T7qPbF8mB6WWayS1v/lHgB3j3IUlIJ32g5qTD/FDUz+K9bBcUDe34s/6Xo3Jag7RAT906uiGGJ++5XClm8IbIEYanwYDho29dWQxw1pR+v7uxRjb6+wIL9VruuZ1Z2aNHDhRSDec0Qcc+QkT0uV8iGlfzZ+9ujkh3vcsOCvGym1jNrdrg7Z9feGMzQ4zwUM9uFLOZKW6tog4vSiotjnisJgvA0hj3OfwI4pt/48RjXgwZyw==;
 s=purelymail2; d=spwhitton.name; v=1;
 bh=hZCl6G+fMNxabpWJvuBRuDDAk9qGRi+es5YSPCKnF6Y=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=FmE3h+cjDIwcff1eAe6u+7TuizG1f/K8pr7yEXmo8JoU0pg++52QdnK8NWieXVmpG86Sf0PVZj9XnWl8vbtb8rb38cqhY1mQSe1kjKXQDBGxigYMM1+JdmgKIoB+XNhDLGCvelMV8TbcXFYas4KKqdlBJwA7ry7w9Zs/o50JGCqnEkfAvNPj/R6Xhc330XIbXCyvYbynra4z/wFoxyA/qcGUUOFx9CilxJ8U4qWoeM76UVA86JJZY67lSCNfVIZu8By/gtW/yZUzDvYIKE/9zgEwC38gRy/ghBJ2TeLKH8/ipohe5sdqC5w3WYfTv92kTdhn/JufnWSzXO1XO1TCVQ==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=hZCl6G+fMNxabpWJvuBRuDDAk9qGRi+es5YSPCKnF6Y=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: 76700 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -837243106; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 03 Mar 2025 03:29:11 +0000 (UTC)
Received: by melete.silentflame.com (Postfix, from userid 1000)
 id E9A587EAB61; Mon,  3 Mar 2025 11:29:05 +0800 (CST)
From: Sean Whitton <spwhitton@HIDDEN>
To: Madhu <enometh@HIDDEN>
Subject: Re: bug#76700: 31.0.50; find-func.el: incorrect use of minor mode
In-Reply-To: <20250303.083632.1827656174320200580.enometh@HIDDEN>
References: <20250303.083632.1827656174320200580.enometh@HIDDEN>
Date: Mon, 03 Mar 2025 11:29:05 +0800
Message-ID: <87tt8a7pxa.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76700
Cc: 76700 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

On Mon 03 Mar 2025 at 08:36am +0530, Madhu wrote:

> I brought up this issue on emacs-devel but the discussion did not
> proceed beyond
> https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg01054.html

I'm still intending to reply to you.  Please be patient.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76700; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Mar 2025 03:06:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 02 22:06:44 2025
Received: from localhost ([127.0.0.1]:41422 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tow8h-0004ui-48
	for submit <at> debbugs.gnu.org; Sun, 02 Mar 2025 22:06:44 -0500
Received: from lists.gnu.org ([2001:470:142::17]:39276)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <enometh@HIDDEN>) id 1tow8e-0004tr-C7
 for submit <at> debbugs.gnu.org; Sun, 02 Mar 2025 22:06:41 -0500
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 <enometh@HIDDEN>) id 1tow8Y-00033h-Il
 for bug-gnu-emacs@HIDDEN; Sun, 02 Mar 2025 22:06:34 -0500
Received: from smtp5.ctinetworks.com ([205.166.61.198])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <enometh@HIDDEN>) id 1tow8V-0001ih-RK
 for bug-gnu-emacs@HIDDEN; Sun, 02 Mar 2025 22:06:34 -0500
X-ctinetworks-Watermark: 1741835183.08423@oRS2LT++AQlhlfIZud5eow
X-ctinetworks-Envelope-From: enometh@HIDDEN
X-ctinetworks-SpamCheck: 
X-ctinetworks-VirusCheck: Found to be clean
X-ctinetworks-Message-ID: 3D12A2064EED.A4707
Received: from localhost (unknown [117.254.37.115])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: enometh@HIDDEN)
 by smtp5.ctinetworks.com (Postfix) with ESMTPSA id 3D12A2064EED
 for <bug-gnu-emacs@HIDDEN>; Sun,  2 Mar 2025 22:06:21 -0500 (EST)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp5.ctinetworks.com 3D12A2064EED
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meer.net;
 s=ctidkims1; t=1740971182;
 bh=KCIV8cqI2G4JmdVFPiQskXuMO0F0ZOPj6b3jKZRaHbc=;
 h=Date:To:Subject:From:From;
 b=u6/QsmQimP/sTKM31aapeh/qAIrMFij+OlPI8hjiCEYRwQfhWif24JlguL5ZqCy1W
 4yU02EJiiKw9rKsfyDxt+o2qwnp+uyTq9YD+fRygYS8tlj3o5tEmpJggHGNmpgYyGT
 csGEJ15dtVERU8+JNGB+nUXvptfunw/XIBYVHMPo=
Date: Mon, 03 Mar 2025 08:36:32 +0530 (IST)
Message-Id: <20250303.083632.1827656174320200580.enometh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; find-func.el: incorrect use of minor mode
From: Madhu <enometh@HIDDEN>
X-Mailer: Mew version 6.9 on Emacs 31.0.50
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Mon_Mar__3_08_36_32_2025_874)--"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=205.166.61.198; envelope-from=enometh@HIDDEN;
 helo=smtp5.ctinetworks.com
X-Spam_score_int: 12
X-Spam_score: 1.2
X-Spam_bar: +
X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 4.5 (++++)
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 brought up this issue on emacs-devel but the discussion
 did not proceed beyond
 https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg01054.html
 for decades find-func.el had used `find-function-setup-keys' to set up global
 bindings to functions in find-func.el. Since these are global bindings these
 did not require a minor mode. 
 Content analysis details:   (4.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [117.254.37.115 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;
 id=enometh%40meer.net; ip=2001%3A470%3A142%3A%3A17; r=debbugs.gnu.org]
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 3.5 (+++)
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 brought up this issue on emacs-devel but the discussion
   did not proceed beyond https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg01054.html
    for decades find-func.el had used `find-function-setup-keys' to set up global
    bindings to functions in find-func.el. Since these are global bindings these
    did not require a minor mode. 
 
 Content analysis details:   (3.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2001:470:142:0:0:0:0:17 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [117.254.37.115 listed in zen.spamhaus.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=enometh%40meer.net;ip=2001%3A470%3A142%3A%3A17;r=debbugs.gnu.org]
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

----Next_Part(Mon_Mar__3_08_36_32_2025_874)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I brought up this issue on emacs-devel but the discussion did not
proceed beyond
https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg01054.html

for decades find-func.el had used `find-function-setup-keys' to set up
global bindings to functions in find-func.el.  Since these are global
bindings these did not require a minor mode.

The minor-mode was introduced in c3e989ca9d7, "New minor mode
find-function-mode replaces find-function-setup-keys" which introduced
a keymap via new features.

This was objected to on the emacs-devel list by Eshel in
+message-id:<m1ed4wfaym.fsf@HIDDEN> (sorry lists.gnu.org
namazu apparently websearch by mid does not work or provide 
a link to the html mailing list) on "Fri, 04 Oct 2024 11:56:17 +0200"

and the commit 1094c3f914 "find-function-mode: Define keys at a low
precedence level" was introduced to restore "backward compatibility".


However this is an incorrect use of define-minor-mode, The use of
define-minor-mode is to explicitly use a keymap to shadow global
bindings and using it to modify global bindings is a basic category
error a thinko and should not be promoted in the code base.

as the functions in find-func.el are always available for binding, a
minor mode does not make sense, if only to mutate global bindings.

global bindings set by the user when the mode is in effect are undone
when the mode is removed. Emacs should not be doing this.

I believe The original function find-function-setup-keys' introduced
by rms explicitly avoided using a minor mode precisely for these reasons. Introducing a minor mode is a conceptual regression.

If a local keymap is not desired, the minor mode should be removed and
the original function undeprecated.

The attached patch however restores the local keymap but sets up global
bindings via the original find-function-setup-keys.

----Next_Part(Mon_Mar__3_08_36_32_2025_874)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="f.patch"

From 1279279580f7f15e63da9624cdefa4c842f8b24f Mon Sep 17 00:00:00 2001
From: Madhu <enometh@HIDDEN>
Date: Mon, 24 Feb 2025 07:48:54 +0530
Subject: [PATCH] lisp/emacs-lisp/find-func.el: restore local keymap

* lisp/emacs-lisp/find-func.el: find-function-mode-map. (restored from
commit 1094c3f9147), (find-function-setup-keys), restored from commit
c3e989ca9, but modified to operate on global-keymap to maintain
compatibility).

 commit message 1094c9147 uses "low precedence level" instead of "global"
---
 lisp/emacs-lisp/find-func.el | 60 +++++++++++++++++++++---------------
 1 file changed, 36 insertions(+), 24 deletions(-)

diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 6b7b5083620..b08b8c41aa2 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -812,36 +812,48 @@ find-variable-at-point
     (when (and symb (not (equal symb 0)))
       (find-variable-other-window symb))))
 
+(defvar-keymap find-function-mode-map
+  "C-x F"   #'find-function
+  "C-x 4 F" #'find-function-other-window
+  "C-x 5 F" #'find-function-other-frame
+
+  "C-x K"   #'find-function-on-key
+  "C-x 4 K" #'find-function-on-key-other-window
+  "C-x 5 K" #'find-function-on-key-other-frame
+
+  "C-x V"   #'find-variable
+  "C-x 4 V" #'find-variable-other-window
+  "C-x 5 V" #'find-variable-other-frame
+
+  "C-x L"   #'find-library
+  "C-x 4 L" #'find-library-other-window
+  "C-x 5 L" #'find-library-other-frame)
+
 ;;;###autoload
 (define-minor-mode find-function-mode
   "Enable some key bindings for the `find-function' family of functions."
-  :group 'find-function :version "31.1" :global t :lighter nil
-  ;; For compatibility with the historical behavior of the old
-  ;; `find-function-setup-keys', define our bindings at the precedence
-  ;; level of the global map.
-  :keymap nil
-  (pcase-dolist (`(,map ,key ,cmd)
-                 `((,ctl-x-map   "F" find-function)
-                   (,ctl-x-4-map "F" find-function-other-window)
-                   (,ctl-x-5-map "F" find-function-other-frame)
-                   (,ctl-x-map   "K" find-function-on-key)
-                   (,ctl-x-4-map "K" find-function-on-key-other-window)
-                   (,ctl-x-5-map "K" find-function-on-key-other-frame)
-                   (,ctl-x-map   "V" find-variable)
-                   (,ctl-x-4-map "V" find-variable-other-window)
-                   (,ctl-x-5-map "V" find-variable-other-frame)
-                   (,ctl-x-map   "L" find-library)
-                   (,ctl-x-4-map "L" find-library-other-window)
-                   (,ctl-x-5-map "L" find-library-other-frame)))
-    (if find-function-mode
-        (keymap-set map key cmd)
-      (keymap-unset map key t))))
+  :global t :lighter nil   ; compat. with old `find-function-setup-keys'
+  :group 'find-function :version "31.1")
 
 ;;;###autoload
 (defun find-function-setup-keys ()
-  "Turn on `find-function-mode', which see."
-  (find-function-mode 1))
-(make-obsolete 'find-function-setup-keys 'find-function-mode "31.1")
+  "Define some key bindings for the `find-function' family of functions.
+and also define the keys globally"
+  (find-function-mode 1)
+  (define-key ctl-x-map "F" 'find-function)
+  (define-key ctl-x-4-map "F" 'find-function-other-window)
+  (define-key ctl-x-5-map "F" 'find-function-other-frame)
+  (define-key ctl-x-map "K" 'find-function-on-key)
+  (define-key ctl-x-4-map "K" 'find-function-on-key-other-window)
+  (define-key ctl-x-5-map "K" 'find-function-on-key-other-frame)
+  (define-key ctl-x-map "V" 'find-variable)
+  (define-key ctl-x-4-map "V" 'find-variable-other-window)
+  (define-key ctl-x-5-map "V" 'find-variable-other-frame)
+  (define-key ctl-x-map "L" 'find-library)
+  (define-key ctl-x-4-map "L" 'find-library-other-window)
+  (define-key ctl-x-5-map "L" 'find-library-other-frame))
+
+;;(make-obsolete 'find-function-setup-keys 'find-function-mode "31.1")
 
 (provide 'find-func)
 
-- 
2.46.0.27.gfa3b914457


----Next_Part(Mon_Mar__3_08_36_32_2025_874)----




Acknowledgement sent to Madhu <enometh@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76700; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 9 Mar 2025 10:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.