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

From: Madhu <[email-masked]>
Date: Sun, 09 Mar 2025 15:41:52 +0530 (IST)

*  Sean Whitton <[email-masked]>
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.