unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56421: [PATCH] Make mouse-2 respect delete-selection mode
@ 2022-07-06 14:58 Visuwesh
  2022-07-06 15:11 ` Stefan Kangas
  0 siblings, 1 reply; 21+ messages in thread
From: Visuwesh @ 2022-07-06 14:58 UTC (permalink / raw)
  To: 56421

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

Tags: patch

Yanking with the mouse (i.e., mouse-2) does not replace the selected
region if delete-selection-mode is turned on.  Attached patch makes the
mouse yank commands delete-selection-mode aware.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-mouse-3-respect-delete-selection-mode.patch --]
[-- Type: text/patch, Size: 983 bytes --]

From 699b0b80648cb4b3d926937bf259442ccc1612a5 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
Date: Wed, 6 Jul 2022 20:27:16 +0530
Subject: [PATCH] Make mouse-2 respect delete-selection mode

* lisp/delsel.el: Make the mouse yank commands delete-selection-mode
aware.
---
 lisp/delsel.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/delsel.el b/lisp/delsel.el
index 5310328e5f..723a52b17d 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -300,6 +300,9 @@ delete-selection-uses-region-p
 (put 'yank-pop 'delete-selection 'yank)
 (put 'yank-from-kill-ring 'delete-selection 'yank)
 (put 'clipboard-yank 'delete-selection 'yank)
+(put 'mouse-yank-primary 'delete-selection 'yank)
+(put 'mouse-yank-secondary 'delete-selection 'yank)
+(put 'mouse-yank-at-click 'delete-selection 'yank)
 (put 'insert-register 'delete-selection t)
 ;; delete-backward-char and delete-forward-char already delete the selection by
 ;; default, but not delete-char.
--
2.35.1

[-- Attachment #3: Type: text/plain, Size: 517 bytes --]


In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2022-07-03 built on astatine
Repository revision: c4930e938b6f9f21b4a9c37912d2b6ce4796b9a2
Repository branch: tamil-phonetic2
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-modules --with-sound=alsa --with-x-toolkit=lucid
 --with-json --without-xaw3d --without-gconf --without-libsystemd
 --with-x --without-cairo'

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

end of thread, other threads:[~2022-07-13 11:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-06 14:58 bug#56421: [PATCH] Make mouse-2 respect delete-selection mode Visuwesh
2022-07-06 15:11 ` Stefan Kangas
2022-07-06 15:16   ` Visuwesh
2022-07-06 15:58     ` Stefan Kangas
2022-07-06 16:01       ` Visuwesh
2022-07-06 16:14         ` Stefan Kangas
2022-07-06 17:57           ` Juri Linkov
2022-07-07  4:05             ` Visuwesh
2022-07-07  6:23               ` Juri Linkov
2022-07-07  6:47                 ` Visuwesh
2022-07-11 10:58             ` Lars Ingebrigtsen
2022-07-11 11:04               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-11 11:10                 ` Lars Ingebrigtsen
2022-07-11 11:13                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-11 11:37                   ` Stefan Kangas
2022-07-11 11:39                     ` Lars Ingebrigtsen
2022-07-13 11:39                       ` Lars Ingebrigtsen
2022-07-11 11:39                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-07  1:12     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-07  1:17       ` Stefan Kangas
2022-07-07  2:57         ` Po Lu 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).