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

Previous Next

Package: emacs;

Reported by: Madhu <enometh <at> meer.net>

Date: Mon, 3 Mar 2025 03:07:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Madhu <enometh <at> meer.net>
To: spwhitton <at> spwhitton.name
Cc: 76700 <at> debbugs.gnu.org, me <at> eshelyaron.com, rms <at> gnu.org
Subject: bug#76700: 31.0.50; find-func.el: incorrect use of minor mode
Date: Sun, 09 Mar 2025 15:41:52 +0530 (IST)
*  Sean Whitton <87zfhuhh49.fsf <at> melete.silentflame.com>
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.







This bug report was last modified 72 days ago.

Previous Next


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