GNU bug report logs - #22456
24.5; Have \\[...] handle mouse commands differently

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 24 Jan 2016 16:15:02 UTC

Severity: wishlist

Tags: wontfix

Found in version 24.5

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22456 in the body.
You can then email your comments to 22456 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22456; Package emacs. (Sun, 24 Jan 2016 16:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 24 Jan 2016 16:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; Have \\[...] handle mouse commands differently
Date: Sun, 24 Jan 2016 08:14:19 -0800 (PST)
Enhancement request:

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.

Maybe these are some possible approaches (?):

* Check the `interactive' spec for "e" or an argument that is
  `mouse-event-p'.

* Allow for "mouse command" in a doc string to indicate that the command
  name that follows it is to be considered a mouse command.


In either case, if a command is indicated to be a mouse command, render
its use within "\\[...]" without the prefix "M-x ".


In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22456; Package emacs. (Thu, 12 May 2022 12:46:01 GMT) Full text and rfc822 format available.

Message #8 received at 22456 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 22456 <at> debbugs.gnu.org
Subject: Re: bug#22456: 24.5; Have \\[...] handle mouse commands differently
Date: Thu, 12 May 2022 14:45:24 +0200
Drew Adams <drew.adams <at> 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




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 12 May 2022 12:46:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 22456 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 12 May 2022 12:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Jun 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 319 days ago.

Previous Next


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