unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32799: 26; `(mouse-)tear-off-window'
@ 2018-09-21 21:06 Drew Adams
  2018-09-22 10:34 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2018-09-21 21:06 UTC (permalink / raw)
  To: 32799

In Emacs 24.4 apparently (though there was nothing in NEWS about it)
command `mouse-tear-off-window' was renamed to `tear-off-window'.

Why?  There are lots of commands whose prefix is `mouse-' and that can
be bound only to a mouse event - like this one.

Please either: (1) make it possible to bind this command also or
alternatively to a keyboard key sequence or (2) rename this mouse-only
command back to `mouse-tear-off-window' and create a new command
`tear-off-window' that can be bound to keyboard keys.

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.16299
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32799: 26; `(mouse-)tear-off-window'
  2018-09-21 21:06 bug#32799: 26; `(mouse-)tear-off-window' Drew Adams
@ 2018-09-22 10:34 ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2018-09-22 10:34 UTC (permalink / raw)
  To: Drew Adams, Stefan Monnier; +Cc: 32799

> Date: Fri, 21 Sep 2018 14:06:36 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> In Emacs 24.4 apparently (though there was nothing in NEWS about it)
> command `mouse-tear-off-window' was renamed to `tear-off-window'.
> 
> Why?

The comment to the change (made in July 2014) says:

  Rename from mouse-tear-off-window since it also makes sense to bind
  it to a non-mouse event.

> There are lots of commands whose prefix is `mouse-' and that can
> be bound only to a mouse event - like this one.

The alias mouse-tear-off-window is still there, no?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32799: 26; `(mouse-)tear-off-window'
       [not found] ` <<83fty1ddmh.fsf@gnu.org>
@ 2018-09-22 15:56   ` Drew Adams
  2018-09-22 19:12     ` Stefan Monnier
       [not found]   ` <<c2ee91ad-2c3e-4a49-b167-e44d1068b508@default>
  1 sibling, 1 reply; 8+ messages in thread
From: Drew Adams @ 2018-09-22 15:56 UTC (permalink / raw)
  To: Eli Zaretskii, Drew Adams, Stefan Monnier; +Cc: 32799

> The comment to the change (made in July 2014) says:
>   Rename from mouse-tear-off-window since it also makes sense to bind
>   it to a non-mouse event.

Can it in fact be bound to a non-mouse event?
If I thought it could then I would not have filed this bug.

emacs -Q

Evaluate (global-set-key "\C-o" 'tear-off-window), then try C-o.
I get this error:

command-execute: tear-off-window must be bound to an event with parameters

Same thing (naturally) if I bind a keyboard key to the alias.

If I'm missing something and this can be bound to keyboard keys then please let me know how and close the ticket.

GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32799: 26; `(mouse-)tear-off-window'
  2018-09-22 15:56   ` Drew Adams
@ 2018-09-22 19:12     ` Stefan Monnier
  2018-09-22 22:47       ` Drew Adams
  2020-08-21 11:41       ` Stefan Kangas
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2018-09-22 19:12 UTC (permalink / raw)
  To: Drew Adams; +Cc: 32799

> Evaluate (global-set-key "\C-o" 'tear-off-window), then try C-o.
> I get this error:
>
> command-execute: tear-off-window must be bound to an event with parameters

Fixed with the patch below,


        Stefan


diff --git a/lisp/mouse.el b/lisp/mouse.el
index 0fe4932085..d3c953e68e 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -333,7 +333,7 @@ mouse-select-window
 (define-obsolete-function-alias 'mouse-tear-off-window 'tear-off-window "24.4")
 (defun tear-off-window (click)
   "Delete the selected window, and create a new frame displaying its buffer."
-  (interactive "e")
+  (interactive (list last-nonmenu-event))
   (mouse-minibuffer-check click)
   (let* ((window (posn-window (event-start click)))
 	 (buf (window-buffer window))





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#32799: 26; `(mouse-)tear-off-window'
  2018-09-22 19:12     ` Stefan Monnier
@ 2018-09-22 22:47       ` Drew Adams
  2018-09-23  5:59         ` Eli Zaretskii
  2020-08-21 11:41       ` Stefan Kangas
  1 sibling, 1 reply; 8+ messages in thread
From: Drew Adams @ 2018-09-22 22:47 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 32799

> > Evaluate (global-set-key "\C-o" 'tear-off-window), then try C-o.
> > I get this error:
> >
> > command-execute: tear-off-window must be bound to an event with
> parameters
> 
> Fixed with the patch below,

Thanks. What Emacs release will this fix be in, so I can adjust my code accordingly?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32799: 26; `(mouse-)tear-off-window'
  2018-09-22 22:47       ` Drew Adams
@ 2018-09-23  5:59         ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2018-09-23  5:59 UTC (permalink / raw)
  To: Drew Adams; +Cc: monnier, 32799

> Date: Sat, 22 Sep 2018 15:47:24 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, 32799@debbugs.gnu.org
> 
> > Fixed with the patch below,
> 
> Thanks. What Emacs release will this fix be in, so I can adjust my code accordingly?

Emacs 26.2.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32799: 26; `(mouse-)tear-off-window'
       [not found]         ` <<834legda9u.fsf@gnu.org>
@ 2018-09-23 15:32           ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2018-09-23 15:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, 32799

> > > Fixed with the patch below,
> >
> > Thanks. What Emacs release will this fix be in, so I can adjust my code
> > accordingly?
> 
> Emacs 26.2.

Thanks. Actually, I decided to keep my version anyway,
even for later releases. The only difference is that it does
this at the end: It doesn't try to delete WINDOW if it is
alone in its frame. This just avoids the message "Attempt
to delete minibuffer or sole ordinary window". Minor
difference. I also have a variant which, instead of doing
nothing in that case, shows the message "Sole window
in frame".

I mention this only in case Emacs might want to do
something similar.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32799: 26; `(mouse-)tear-off-window'
  2018-09-22 19:12     ` Stefan Monnier
  2018-09-22 22:47       ` Drew Adams
@ 2020-08-21 11:41       ` Stefan Kangas
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-21 11:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 32799

close 32799 26.2
thanks

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> Evaluate (global-set-key "\C-o" 'tear-off-window), then try C-o.
>> I get this error:
>>
>> command-execute: tear-off-window must be bound to an event with parameters
>
> Fixed with the patch below,

The patch which fixed this issue was installed and shipped in 26.2, but
the bug was never closed.  I'm therefore closing this bug report.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-08-21 11:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-21 21:06 bug#32799: 26; `(mouse-)tear-off-window' Drew Adams
2018-09-22 10:34 ` Eli Zaretskii
     [not found] <<9dce52eb-7982-4c75-9c7c-c06e8f69dd52@default>
     [not found] ` <<83fty1ddmh.fsf@gnu.org>
2018-09-22 15:56   ` Drew Adams
2018-09-22 19:12     ` Stefan Monnier
2018-09-22 22:47       ` Drew Adams
2018-09-23  5:59         ` Eli Zaretskii
2020-08-21 11:41       ` Stefan Kangas
     [not found]   ` <<c2ee91ad-2c3e-4a49-b167-e44d1068b508@default>
     [not found]     ` <<jwvd0t58hzy.fsf-monnier+emacsbugs@gnu.org>
     [not found]       ` <<ada9f7a9-44d8-44e2-aed3-856269a7f0b3@default>
     [not found]         ` <<834legda9u.fsf@gnu.org>
2018-09-23 15:32           ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).