bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22456: 24.5; Have \\[...] handle mouse commands differently


From: Lars Ingebrigtsen
Subject: bug#22456: 24.5; Have \\[...] handle mouse commands differently
Date: Thu, 12 May 2022 14:45:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> writes:

> If a command that can only be bound to a mouse event is mentioned in a
> doc string, and if that command is not bound currently, the mention is
> inappropriate (unhelpful).
>
> (defun foo (event)
>   "..."
>   (interactive "e")
>   (message "foo"))
>
> (defun bar ()
>   "... mouse command \\[foo] is ..."
>   (interactive)
>   (message "bar"))
>
> C-h f bar
>
>   bar is an interactive Lisp function.
>
>   (bar)
>
>   ... mouse command `M-x foo' is ...
>
> This is quite wrong: `foo' *cannot* be invoked using `M-x'.
>
> The request is for Emacs to do something better for this case.  It
> should just write "... mouse command `foo' is ...", for example, leaving
> off the "M-x " part.

When you write \\[...] in your doc string, you've asked Emacs to display
the key binding to execute the command.  In this case there is no key
binding that can execute that command, so you've asked Emacs to do
something paradoxical.

Changing the output here would be easy enough, but I don't see that
saying "mouse command `foo'" is much better -- it's still not expanding
to a key sequence.

So I think this is a "don't do that, then" thing, and I'm closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]