GNU bug report logs - #52973
Adding a few context-menu-mode commands

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Mon, 3 Jan 2022 08:38:02 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: larsi <at> gnus.org, 52973 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#52973: Adding a few context-menu-mode commands
Date: Sat, 08 Jan 2022 21:10:41 +0200
> From: Philip Kaludercic <philipk <at> posteo.net>
> Cc: Juri Linkov <juri <at> linkov.net>,  larsi <at> gnus.org,  52973 <at> debbugs.gnu.org
> Date: Sat, 08 Jan 2022 19:01:46 +0000
> 
> > The way I see it, the functions in man.el are for Man-mode, and those
> > in hi-lock.el are for hi-lock-mode.
> 
> 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.  In any other major mode, it is
likely to be a false positive.  For example, it could be an array
reference in Fortran or Matlab, or a function call in C or C++.  I
fail to see how this kind of guesswork can be a good idea if it mostly
fails.

> The hi-lock functions can be used to highlight a symbol, just like with
> `M-s h .'.  Requiring hi-lock-mode to be enabled beforehand would be
> counterproductive.

Why is it counterproductive, if you are going to activate it anyway,
the first time the user clicks?

> >> When the global value of context-menu-functions
> >> contains one of the proposed functions, right-clicking anywhere
> >> will autoload every package where such context functions are defined.
> >
> > This is over-engineered, IMO.  There should be no need for such
> > complexity.
> 
> What would you suggest to simplify this?

See above.




This bug report was last modified 3 years and 116 days ago.

Previous Next


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