unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56198: Request to delete window with mouse event
@ 2022-06-24 15:27 carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-24 17:05 ` Juri Linkov
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-24 15:27 UTC (permalink / raw)
  To: 56198

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]


I frequently split my windows,  I usually kill the buffer using the menu bar.  But this leaves me with the window open with some other buffer.  Would like to request some facility to delete a window (delete-window) using the mouse, as I frequently do for `kill-buffer'.  Perhaps the capability could be inserted in the window mode-line.  Where  one can usually turn off a minor-mode with the mouse.



[-- Attachment #2: Type: text/html, Size: 635 bytes --]

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

* bug#56198: Request to delete window with mouse event
  2022-06-24 15:27 bug#56198: Request to delete window with mouse event carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-24 17:05 ` Juri Linkov
  2022-06-24 17:10 ` Visuwesh
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 19+ messages in thread
From: Juri Linkov @ 2022-06-24 17:05 UTC (permalink / raw)
  To: carlmarcos; +Cc: 56198

> I frequently split my windows,  I usually kill the buffer using the menu
> bar.  But this leaves me with the window open with some other buffer. 
> Would like to request some facility to delete a window (delete-window)
> using the mouse, as I frequently do for `kill-buffer'.  Perhaps the
> capability could be inserted in the window mode-line.  Where  one can
> usually turn off a minor-mode with the mouse.

mouse-3 on the mode line deletes the window.
Also there is the built-in package emacs/lisp/strokes.el
for binding mouse strokes to commands.





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

* bug#56198: Request to delete window with mouse event
  2022-06-24 15:27 bug#56198: Request to delete window with mouse event carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-24 17:05 ` Juri Linkov
@ 2022-06-24 17:10 ` Visuwesh
       [not found] ` <878rpmasxd.fsf@gmail.com-N5LgcGT----2>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 19+ messages in thread
From: Visuwesh @ 2022-06-24 17:10 UTC (permalink / raw)
  To: 56198; +Cc: carlmarcos

[வெள்ளி ஜூன் 24, 2022] carlmarcos--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> I frequently split my windows,  I usually kill the buffer using the
> menu bar.  But this leaves me with the window open with some other
> buffer.  Would like to request some facility to delete a window
> (delete-window) using the mouse, as I frequently do for
> `kill-buffer'.  Perhaps the capability could be inserted in the window
> mode-line.  Where  one can usually turn off a minor-mode with the
> mouse.

I think mouse-3 (i.e., Right Click) on the mode-line does what you want?
However, this does not kill the buffer that shown in the window though
but should be easy enough to change (search for "mouse-delete-window" in
mouse.el).





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

* bug#56198: Request to delete window with mouse event
       [not found] ` <878rpmasxd.fsf@gmail.com-N5LgcGT----2>
@ 2022-06-25  7:35   ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-25  8:14     ` Visuwesh
  2022-06-25  8:24     ` Eli Zaretskii
  0 siblings, 2 replies; 19+ messages in thread
From: carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-25  7:35 UTC (permalink / raw)
  To: Visuwesh; +Cc: 56198

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]



-- 
 Sent with Tutanota, enjoy secure & ad-free emails. 



Jun 24, 2022, 17:10 by visuweshm@gmail.com:

> [வெள்ளி ஜூன் 24, 2022] carlmarcos--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:
>
>> I frequently split my windows,  I usually kill the buffer using the
>> menu bar.  But this leaves me with the window open with some other
>> buffer.  Would like to request some facility to delete a window
>> (delete-window) using the mouse, as I frequently do for
>> `kill-buffer'.  Perhaps the capability could be inserted in the window
>> mode-line.  Where  one can usually turn off a minor-mode with the
>> mouse.
>>
>
> I think mouse-3 (i.e., Right Click) on the mode-line does what you want?
> However, this does not kill the buffer that shown in the window though
> but should be easy enough to change (search for "mouse-delete-window" in
> mouse.el).
>
Was not aware of mouse-3 on mode-line.  Just need to rewove the window, 
without necessarily killing the buffer.

Actually, I have noticed a problem with using mouse-3 on mode-line.  Suppose
you push mouse-3 on mode-line, the window is removed without giving me the 
possibility to net remove it should I change my mind.  

It is different behaviour than for instance the mode-line options for minor-mode,
where you can decide not to take any action.




[-- Attachment #2: Type: text/html, Size: 2248 bytes --]

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

* bug#56198: Request to delete window with mouse event
  2022-06-25  7:35   ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-25  8:14     ` Visuwesh
  2022-06-25  8:24     ` Eli Zaretskii
  1 sibling, 0 replies; 19+ messages in thread
From: Visuwesh @ 2022-06-25  8:14 UTC (permalink / raw)
  To: carlmarcos; +Cc: 56198

[சனி ஜூன் 25, 2022] carlmarcos@tutanota.com wrote:

> Jun 24, 2022, 17:10 by visuweshm@gmail.com:
>
>  [வெள்ளி ஜூன் 24, 2022] carlmarcos--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors"
>  wrote:
>
>  I frequently split my windows,  I usually kill the buffer using the
>  menu bar.  But this leaves me with the window open with some other
>  buffer.  Would like to request some facility to delete a window
>  (delete-window) using the mouse, as I frequently do for
>  `kill-buffer'.  Perhaps the capability could be inserted in the window
>  mode-line.  Where  one can usually turn off a minor-mode with the
>  mouse.
>
>  I think mouse-3 (i.e., Right Click) on the mode-line does what you want?
>  However, this does not kill the buffer that shown in the window though
>  but should be easy enough to change (search for "mouse-delete-window" in
>  mouse.el).
>
> Was not aware of mouse-3 on mode-line.  Just need to rewove the window, 
> without necessarily killing the buffer.
>
> Actually, I have noticed a problem with using mouse-3 on mode-line.  Suppose
> you push mouse-3 on mode-line, the window is removed without giving me the 
> possibility to net remove it should I change my mind.  
>
> It is different behaviour than for instance the mode-line options for minor-mode,
> where you can decide not to take any action.

For this, I have winner-mode enabled.  Should I regret my choice, I
simply say M-x winner-undo RET.  Granted, this requires the keyboard but
this is not a frequent problem for me to care enough.





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

* bug#56198: Request to delete window with mouse event
  2022-06-25  7:35   ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-25  8:14     ` Visuwesh
@ 2022-06-25  8:24     ` Eli Zaretskii
  2022-06-25 12:34       ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2022-06-25  8:24 UTC (permalink / raw)
  To: carlmarcos; +Cc: 56198, visuweshm

> Cc: 56198@debbugs.gnu.org
> Date: Sat, 25 Jun 2022 09:35:21 +0200 (CEST)
> From: carlmarcos--- via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Actually, I have noticed a problem with using mouse-3 on mode-line.  Suppose
> you push mouse-3 on mode-line, the window is removed without giving me the 
> possibility to net remove it should I change my mind.  

Why is that a problem?  Removing a window doesn't lose any important
information, and you can easily restore it with "C-x 4 b" or somesuch.





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

* bug#56198: Request to delete window with mouse event
  2022-06-25  8:24     ` Eli Zaretskii
@ 2022-06-25 12:34       ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-25 14:14         ` Visuwesh
  0 siblings, 1 reply; 19+ messages in thread
From: carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-25 12:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 56198, visuweshm

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]


Jun 25, 2022, 08:24 by eliz@gnu.org:

>> Cc: 56198@debbugs.gnu.org
>> Date: Sat, 25 Jun 2022 09:35:21 +0200 (CEST)
>> From: carlmarcos--- via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> Actually, I have noticed a problem with using mouse-3 on mode-line.  Suppose
>> you push mouse-3 on mode-line, the window is removed without giving me the 
>> possibility to net remove it should I change my mind.
>>
>
> Why is that a problem?  Removing a window doesn't lose any important
> information, and you can easily restore it with "C-x 4 b" or somesuch.
>
If would be neater to activate only when the mouse-3 button release occurs on the mode-line
or window.  If one moves the mouse pointer outside the window or outside emacs, then releasing
the pressed mouse-3 button, would have no effect.  This would be consistent with how menus work. 

[-- Attachment #2: Type: text/html, Size: 1414 bytes --]

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

* bug#56198: Request to delete window with mouse event
  2022-06-25 12:34       ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-25 14:14         ` Visuwesh
  2022-06-26 15:01           ` Lars Ingebrigtsen
       [not found]           ` <87letjeafl.fsf@gnus.org-N5VXCNa--7-2>
  0 siblings, 2 replies; 19+ messages in thread
From: Visuwesh @ 2022-06-25 14:14 UTC (permalink / raw)
  To: 56198; +Cc: eliz, carlmarcos

[சனி ஜூன் 25, 2022] carlmarcos--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> Jun 25, 2022, 08:24 by eliz@gnu.org:
>
>>> Cc: 56198@debbugs.gnu.org
>>> Date: Sat, 25 Jun 2022 09:35:21 +0200 (CEST)
>>> From: carlmarcos--- via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>>
>>> Actually, I have noticed a problem with using mouse-3 on mode-line.  Suppose
>>> you push mouse-3 on mode-line, the window is removed without giving me the 
>>> possibility to net remove it should I change my mind.
>>>
>>
>> Why is that a problem?  Removing a window doesn't lose any important
>> information, and you can easily restore it with "C-x 4 b" or somesuch.
>>
> If would be neater to activate only when the mouse-3 button release occurs on the mode-line
> or window.  If one moves the mouse pointer outside the window or outside emacs, then releasing
> the pressed mouse-3 button, would have no effect.  This would be consistent with how menus work. 

Ah indeed, that would be nice.  The following patch does the job for me
but maybe there's a cleaner way to do this?

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 82c8a14693..1878709113 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -655,7 +655,9 @@ mouse-delete-window
   (interactive "e")
   (unless (one-window-p t)
     (mouse-minibuffer-check click)
-    (delete-window (posn-window (event-start click)))))
+    (when (eq (posn-window (event-end click))
+              (posn-window (event-start click)))
+      (delete-window (posn-window (event-start click))))))
 
 (defun mouse-select-window (click)
   "Select the window clicked on; don't move point."

The same should done for mouse-2 as well.





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

* bug#56198: Request to delete window with mouse event
  2022-06-25 14:14         ` Visuwesh
@ 2022-06-26 15:01           ` Lars Ingebrigtsen
  2022-06-26 15:26             ` Visuwesh
       [not found]           ` <87letjeafl.fsf@gnus.org-N5VXCNa--7-2>
  1 sibling, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-26 15:01 UTC (permalink / raw)
  To: Visuwesh; +Cc: 56198, carlmarcos, eliz

Visuwesh <visuweshm@gmail.com> writes:

> Ah indeed, that would be nice.  The following patch does the job for me
> but maybe there's a cleaner way to do this?

[...]

> -    (delete-window (posn-window (event-start click)))))
> +    (when (eq (posn-window (event-end click))
> +              (posn-window (event-start click)))
> +      (delete-window (posn-window (event-start click))))))

I think it makes sense to change the behaviour here, but this doesn't
seem to do the trick for me?  I.e., <mouse-3> on the mode line, and then
moving the pointer out of the mode line, and then releasing it still
deletes the window.

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





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

* bug#56198: Request to delete window with mouse event
       [not found]           ` <87letjeafl.fsf@gnus.org-N5VXCNa--7-2>
@ 2022-06-26 15:15             ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-26 15:20               ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-26 15:15 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56198, eliz, Visuwesh

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

Jun 26, 2022, 15:01 by larsi@gnus.org:

> Visuwesh <visuweshm@gmail.com> writes:
>
>> Ah indeed, that would be nice.  The following patch does the job for me
>> but maybe there's a cleaner way to do this?
>>
>
> [...]
>
>> -    (delete-window (posn-window (event-start click)))))
>> +    (when (eq (posn-window (event-end click))
>> +              (posn-window (event-start click)))
>> +      (delete-window (posn-window (event-start click))))))
>>
>
> I think it makes sense to change the behaviour here, but this doesn't
> seem to do the trick for me?  I.e., <mouse-3> on the mode line, and then
> moving the pointer out of the mode line, and then releasing it still
> deletes the window.
>

Have made a suggestion to remove the programming or hypertext major-mode name
in the mode-line.  It is usually understood that programming and hypertext files use
the corresponding mode for the language.


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


[-- Attachment #2: Type: text/html, Size: 1809 bytes --]

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

* bug#56198: Request to delete window with mouse event
  2022-06-26 15:15             ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-26 15:20               ` Eli Zaretskii
  0 siblings, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2022-06-26 15:20 UTC (permalink / raw)
  To: carlmarcos; +Cc: larsi, 56198, visuweshm

> Date: Sun, 26 Jun 2022 17:15:02 +0200 (CEST)
> From: carlmarcos@tutanota.com
> Cc: Visuwesh <visuweshm@gmail.com>, 56198@debbugs.gnu.org, eliz@gnu.org
> 
> Have made a suggestion to remove the programming or hypertext major-mode name
> in the mode-line.

Won't happen, sorry.  Emacs always shows the major mode there, and
will continue to do so.





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

* bug#56198: Request to delete window with mouse event
  2022-06-26 15:01           ` Lars Ingebrigtsen
@ 2022-06-26 15:26             ` Visuwesh
  2022-06-26 15:31               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Visuwesh @ 2022-06-26 15:26 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56198, carlmarcos, eliz

[ஞாயிறு ஜூன் 26, 2022] Lars Ingebrigtsen wrote:

> Visuwesh <visuweshm@gmail.com> writes:
>
>> Ah indeed, that would be nice.  The following patch does the job for me
>> but maybe there's a cleaner way to do this?
>
> [...]
>
>> -    (delete-window (posn-window (event-start click)))))
>> +    (when (eq (posn-window (event-end click))
>> +              (posn-window (event-start click)))
>> +      (delete-window (posn-window (event-start click))))))
>
> I think it makes sense to change the behaviour here, but this doesn't
> seem to do the trick for me?  I.e., <mouse-3> on the mode line, and then
> moving the pointer out of the mode line, and then releasing it still
> deletes the window.

I was kind of sloppy with that.  If you move the mouse to another
window, then it won't delete it.  But you're right, it should also bail
out if the end position wasn't the modeline so something like this
maybe?

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 82c8a14693..3dc4e6b76c 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -655,7 +655,11 @@ mouse-delete-window
   (interactive "e")
   (unless (one-window-p t)
     (mouse-minibuffer-check click)
-    (delete-window (posn-window (event-start click)))))
+    (when (and (eq (posn-area (event-end click))
+                   'mode-line)
+               (eq (posn-window (event-end click))
+                   (posn-window (event-start click))))
+      (delete-window (posn-window (event-start click))))))
 
 (defun mouse-select-window (click)
   "Select the window clicked on; don't move point."






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

* bug#56198: Request to delete window with mouse event
  2022-06-26 15:26             ` Visuwesh
@ 2022-06-26 15:31               ` Lars Ingebrigtsen
  2022-06-26 15:40                 ` Visuwesh
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-26 15:31 UTC (permalink / raw)
  To: Visuwesh; +Cc: 56198, carlmarcos, eliz

Visuwesh <visuweshm@gmail.com> writes:

> I was kind of sloppy with that.  If you move the mouse to another
> window, then it won't delete it.  But you're right, it should also bail
> out if the end position wasn't the modeline so something like this
> maybe?

Thanks; that works well for me, too, so I've now pushed your patch to
Emacs 29.

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





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

* bug#56198: Request to delete window with mouse event
  2022-06-26 15:31               ` Lars Ingebrigtsen
@ 2022-06-26 15:40                 ` Visuwesh
  2022-06-26 15:46                   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Visuwesh @ 2022-06-26 15:40 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56198, carlmarcos, eliz

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

[ஞாயிறு ஜூன் 26, 2022] Lars Ingebrigtsen wrote:

> Visuwesh <visuweshm@gmail.com> writes:
>
>> I was kind of sloppy with that.  If you move the mouse to another
>> window, then it won't delete it.  But you're right, it should also bail
>> out if the end position wasn't the modeline so something like this
>> maybe?
>
> Thanks; that works well for me, too, so I've now pushed your patch to
> Emacs 29.

How about doing this as well?  (On hindsight, I should have included
this in the other mail as well but oh well)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-mouse-2-in-mode-line-more-careful-as-well.patch --]
[-- Type: text/x-diff, Size: 1213 bytes --]

From 6dc4f29dbfcf6c40ef0808bf04987d918df98972 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
Date: Sun, 26 Jun 2022 21:10:09 +0530
Subject: [PATCH] Make <mouse-2> in mode line more careful as well

* lisp/mouse.el (mouse-delete-other-windows): Only delete other
windows if the user didn't move the cursor off the mode-line. (bug#56198)
---
 lisp/mouse.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 82c8a14693..f7ada4f1ec 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -681,10 +681,13 @@ tear-off-window
     (switch-to-buffer buf)
     (delete-window window)))
 
-(defun mouse-delete-other-windows ()
+(defun mouse-delete-other-windows (click)
   "Delete all windows except the one you click on."
-  (interactive "@")
-  (delete-other-windows))
+  (interactive "e")
+  (when (and (eq (posn-area (event-end click)) 'mode-line)
+             (eq (posn-window (event-start click))
+                 (posn-window (event-end click))))
+    (delete-other-windows (posn-window (event-start click)))))
 
 (defun mouse-split-window-vertically (click)
   "Select Emacs window mouse is on, then split it vertically in half.
-- 
2.35.1


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

* bug#56198: Request to delete window with mouse event
  2022-06-26 15:40                 ` Visuwesh
@ 2022-06-26 15:46                   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 19+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-26 15:46 UTC (permalink / raw)
  To: Visuwesh; +Cc: 56198, carlmarcos, eliz

Visuwesh <visuweshm@gmail.com> writes:

> How about doing this as well?  (On hindsight, I should have included
> this in the other mail as well but oh well)

Thanks; makes sense to me, so pushed to Emacs 29 as well.

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





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

* bug#56198: Request to delete window with mouse event
  2022-06-24 15:27 bug#56198: Request to delete window with mouse event carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
                   ` (2 preceding siblings ...)
       [not found] ` <878rpmasxd.fsf@gmail.com-N5LgcGT----2>
@ 2022-06-29  0:07 ` Tak Kunihiro
       [not found] ` <m1v8skib7p.fsf@misasa.okayama-u.ac.jp-N5gmMGf--N-2>
  4 siblings, 0 replies; 19+ messages in thread
From: Tak Kunihiro @ 2022-06-29  0:07 UTC (permalink / raw)
  To: 56198; +Cc: carlmarcos, tkk

> I frequently split my windows,  I usually kill the buffer using the
> menu bar.  But this leaves me with the window open with some other
> buffer.  Would like to request some facility to delete a window
> (delete-window) using the mouse, as I frequently do for `kill-buffer'.
>  Perhaps the capability could be inserted in the window mode-line. 
> Where one can usually turn off a minor-mode with the mouse.

How about having `Close' in context menu?

["Close"
    (lambda () (interactive)
      (if (one-window-p)
          (if (> (length (visible-frame-list)) 1)
              (call-interactively 'delete-frame)
            (kill-buffer (window-buffer))) ; (quit-window)
        (delete-window)))
    :help "Remove this window or this frame, or kill this buffer"
    :visible (not (region-active-p))
    :active t]





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

* bug#56198: Request to delete window with mouse event
       [not found] ` <m1v8skib7p.fsf@misasa.okayama-u.ac.jp-N5gmMGf--N-2>
@ 2022-06-29  0:15   ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-29  9:16     ` Tak Kunihiro
       [not found]     ` <m1k08zhlt0.fsf@misasa.okayama-u.ac.jp-N5io4Li----2>
  0 siblings, 2 replies; 19+ messages in thread
From: carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-29  0:15 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: 56198, tkk

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]



Jun 29, 2022, 00:07 by homeros.misasa@gmail.com:

>> I frequently split my windows,  I usually kill the buffer using the
>> menu bar.  But this leaves me with the window open with some other
>> buffer.  Would like to request some facility to delete a window
>> (delete-window) using the mouse, as I frequently do for `kill-buffer'.
>>  Perhaps the capability could be inserted in the window mode-line. 
>> Where one can usually turn off a minor-mode with the mouse.
>>
>
> How about having `Close' in context menu?
>
I cannot understand this terminology.  How does one access the context menu?
What is it?


> ["Close"
>  (lambda () (interactive)
>  (if (one-window-p)
>  (if (> (length (visible-frame-list)) 1)
>  (call-interactively 'delete-frame)
>  (kill-buffer (window-buffer))) ; (quit-window)
>  (delete-window)))
>  :help "Remove this window or this frame, or kill this buffer"
>  :visible (not (region-active-p))
>  :active t]
>


[-- Attachment #2: Type: text/html, Size: 1702 bytes --]

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

* bug#56198: Request to delete window with mouse event
  2022-06-29  0:15   ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-29  9:16     ` Tak Kunihiro
       [not found]     ` <m1k08zhlt0.fsf@misasa.okayama-u.ac.jp-N5io4Li----2>
  1 sibling, 0 replies; 19+ messages in thread
From: Tak Kunihiro @ 2022-06-29  9:16 UTC (permalink / raw)
  To: carlmarcos; +Cc: Tak Kunihiro, tkk, 56198

> I frequently split my windows, I usually kill the buffer using the
> menu bar. But this leaves me with the window open with some other
> buffer. Would like to request some facility to delete a window
> (delete-window) using the mouse

> How about having `Close' in context menu?

> I cannot understand this terminology.  How does one access the context
> menu?

Recent Emacs comes with an interface `context-menu'.

Customize context-menu to have a menu item that deletes window would
meet your request.

Such a menu is useful in general and I think it is good have it by
default.





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

* bug#56198: Request to delete window with mouse event
       [not found]     ` <m1k08zhlt0.fsf@misasa.okayama-u.ac.jp-N5io4Li----2>
@ 2022-06-29 10:37       ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 19+ messages in thread
From: carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-29 10:37 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: Tak Kunihiro, tkk, 56198

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]

Jun 29, 2022, 09:16 by homeros.misasa@gmail.com:

>> I frequently split my windows, I usually kill the buffer using the
>> menu bar. But this leaves me with the window open with some other
>> buffer. Would like to request some facility to delete a window
>> (delete-window) using the mouse
>>
>> How about having `Close' in context menu?
>>
>> I cannot understand this terminology.  How does one access the context
>> menu?
>>
>
> Recent Emacs comes with an interface `context-menu'.
>
I have GNU Emacs 27.2


> Customize context-menu to have a menu item that deletes window would
> meet your request.
>
> Such a menu is useful in general and I think it is good have it by
> default.
>


[-- Attachment #2: Type: text/html, Size: 1372 bytes --]

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

end of thread, other threads:[~2022-06-29 10:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24 15:27 bug#56198: Request to delete window with mouse event carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-24 17:05 ` Juri Linkov
2022-06-24 17:10 ` Visuwesh
     [not found] ` <878rpmasxd.fsf@gmail.com-N5LgcGT----2>
2022-06-25  7:35   ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-25  8:14     ` Visuwesh
2022-06-25  8:24     ` Eli Zaretskii
2022-06-25 12:34       ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-25 14:14         ` Visuwesh
2022-06-26 15:01           ` Lars Ingebrigtsen
2022-06-26 15:26             ` Visuwesh
2022-06-26 15:31               ` Lars Ingebrigtsen
2022-06-26 15:40                 ` Visuwesh
2022-06-26 15:46                   ` Lars Ingebrigtsen
     [not found]           ` <87letjeafl.fsf@gnus.org-N5VXCNa--7-2>
2022-06-26 15:15             ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-26 15:20               ` Eli Zaretskii
2022-06-29  0:07 ` Tak Kunihiro
     [not found] ` <m1v8skib7p.fsf@misasa.okayama-u.ac.jp-N5gmMGf--N-2>
2022-06-29  0:15   ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  9:16     ` Tak Kunihiro
     [not found]     ` <m1k08zhlt0.fsf@misasa.okayama-u.ac.jp-N5io4Li----2>
2022-06-29 10:37       ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).