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: Juri Linkov <juri <at> linkov.net>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 52973 <at> debbugs.gnu.org
Subject: bug#52973: Adding a few context-menu-mode commands
Date: Mon, 03 Jan 2022 23:12:53 +0200
> I am attaching a few patches adding a few features for
> context-menu-mode, that I mentioned and explained here:
> https://ruzkuku.com/texts/emacs-mouse.html.
>
> Would it be OK to add these to Emacs itself?

Thanks, it would be beneficial to enrich the packages with the
context-menus.  Man-context-menu is a good addition to the package
man.el, and hi-lock-context-menu to hi-lock.el.  However,
mouse-online-search-at-point looks out of place in mouse.el.
Since it relies on eww, wouldn't the right place for it be
in eww.el?

> +(defun Man-at-mouse (e)
> ...
> +(defun Man-context-menu (menu click)
> +  "Populate MENU with commands that open a man page at point."
> +  (save-excursion
> +    (mouse-set-point click)
> +    (when (save-excursion

It seems the second 'save-excursion' is superfluous?

> +            (skip-syntax-backward "^ ")
> +            (and (looking-at
> +                  "[[:space:]]*\\([[:alnum:]_-]+([[:alnum:]]+)\\)")
> +                  (match-string 1)))
> +      (define-key-after menu [man-separator] menu-bar-separator)
> +      (define-key-after menu [man-at-mouse]
> +    '(menu-item "Open man page" man-at-mouse

Typo: the command name is capitalized 'Man-at-mouse'.

> +    (mouse-set-point click)
> +    (when (symbol-at-point)

This can be simplified to:

       (thing-at-mouse click 'symbol)




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

Previous Next


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