From: Visuwesh <visuweshm@gmail.com>
To: 56198@debbugs.gnu.org
Cc: eliz@gnu.org, carlmarcos@tutanota.com
Subject: bug#56198: Request to delete window with mouse event
Date: Sat, 25 Jun 2022 19:44:05 +0530 [thread overview]
Message-ID: <87k0943k5u.fsf@gmail.com> (raw)
In-Reply-To: <N5P5bvT--3-2@tutanota.com> (carlmarcos's message of "Sat, 25 Jun 2022 14:34:47 +0200 (CEST)")
[சனி ஜூன் 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.
next prev parent reply other threads:[~2022-06-25 14:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k0943k5u.fsf@gmail.com \
--to=visuweshm@gmail.com \
--cc=56198@debbugs.gnu.org \
--cc=carlmarcos@tutanota.com \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).