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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Jan 2022 22:09:44 +0200

> From: Philip Kaludercic <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Sat, 08 Jan 2022 19:39:41 +0000
> 
> >> No, the Man functions can be used anywhere you want to read a man page.
> >> It checks if the user clicked on something like "emacs(1)", then inserts
> >> a entry into the context menu to open the man page at point.
> >
> > So it will suggest to show a man page when text like this one from the
> > ELisp manual is displayed:
> >
> >      To conserve memory, Emacs does not hold fixed-length 22-bit numbers
> >   that are codepoints of text characters within buffers and strings.
> >   Rather, Emacs uses a variable-length internal representation of
> >   characters, that stores each character as a sequence of 1 to 5 8-bit
> >   bytes, depending on the magnitude of its codepoint(1).
> >
> > When the user displays a man page, the probability that "foo(1)"
> > references a man page is very high.  
> 
> Yes, but in that case Man-mode should have already inserted a link that
> you can just click on, without the need for a context-menu.

So let me step back a notch and ask: how else can we cause the context
menus to be automatically populated in a given buffer, once
context-menu-mode is turned on?  It must be some buffer-local feature,
because different buffers should in principle show different context
menus.  That's why I thought about modes -- those are always
buffer-local, and mode initialization code runs in every buffer where
the mode is turned on, so we have a place to produce the context
menus.

If you want to have context menus populated regardless of the modes,
what other buffer-specific mechanism can we employ?  IOW, what would
be the trigger for populating the context menus?  It cannot be the
user, because that makes no sense to me: the user already told us
he/she wants those menus when he/she turned on the context-menu-mode.