Subject: Re: bug#52973: Adding a few context-menu-mode commands

From: Juri Linkov <[email-masked]>
Date: Wed, 12 Jan 2022 19:16:22 +0200

>> Ah, I see.  I misunderstood how the context menu machinery works -- I
>> thought it contained mode-specific stuff, and in addition, things that
>> are relevant at the point.  That is, if you're over a text like
>> "foo(1)", then there'd be a predicate to say that this might be a
>> manual reference, and then you'd get the Man context menu.
>
> How do we make sure stuff like "foo(1)" doesn't cause a lot of false
> positives when applied in modes whose idea of what that means is very
> different from Man-mode?

For example, today while editing a shell script I needed to consult the
man page about the arguments of the command `zenity` used in the script.
It takes too many keystrokes to type `M-x man RET zenity RET'
or first to move point to this command, then to type `M-x man RET RET'.

With the context menu, it's just one click: press the right mouse button
on the command name, select the item "Open man page", and release the
mouse button.

As you can see, there is no special syntax "foo(1)" used in the script.
The context menu item "Open man page" might be useful on any word
that can show a man page for any command or function.

This means that the item "Open man page" can't be added to the
context menu by default, because it makes no sense most of the time.

But when a user can tolerate this mostly useless menu item,
then the user could customize the context-menu-functions
and add the item that is used occasionally.