diff options
| author | Lars Ingebrigtsen | 2022-06-20 00:59:14 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-06-20 01:00:06 +0200 |
| commit | e02ebe91379459efc9c5fc7bb9de38fcf0e59cd7 (patch) | |
| tree | 676fbd4c4800fd449ac772104f3c6ebb488a5b7e /lisp/bindings.el | |
| parent | 694d7984a347652bd0ff337056b9e616dc5aaee8 (diff) | |
| download | emacs-e02ebe91379459efc9c5fc7bb9de38fcf0e59cd7.tar.gz emacs-e02ebe91379459efc9c5fc7bb9de38fcf0e59cd7.zip | |
Allow appending to the kill ring with mouse selections
* lisp/bindings.el (ignore-preserving-kill-region): New function.
(global-map): Use it.
* lisp/mouse.el (mouse-set-region, mouse-drag-region)
(mouse-drag-track): Allow appending to kill ring with mouse
selections (bug#32747).
Diffstat (limited to 'lisp/bindings.el')
| -rw-r--r-- | lisp/bindings.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el index ed1325e326c..c67a104b4c1 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -1339,7 +1339,15 @@ if `inhibit-field-text-motion' is non-nil." | |||
| 1339 | ;; can use S-tab instead to access that binding. | 1339 | ;; can use S-tab instead to access that binding. |
| 1340 | (define-key function-key-map [S-tab] [backtab]) | 1340 | (define-key function-key-map [S-tab] [backtab]) |
| 1341 | 1341 | ||
| 1342 | (define-key global-map [mouse-movement] 'ignore) | 1342 | (defun ignore-preserving-kill-region (&rest _) |
| 1343 | "Like `ignore', but don't overwrite `last-event' if it's `kill-region'." | ||
| 1344 | (declare (completion ignore)) | ||
| 1345 | (interactive) | ||
| 1346 | (when (eq last-command 'kill-region) | ||
| 1347 | (setq this-command 'kill-region)) | ||
| 1348 | nil) | ||
| 1349 | |||
| 1350 | (define-key global-map [mouse-movement] #'ignore-preserving-kill-region) | ||
| 1343 | 1351 | ||
| 1344 | (define-key global-map "\C-t" 'transpose-chars) | 1352 | (define-key global-map "\C-t" 'transpose-chars) |
| 1345 | (define-key esc-map "t" 'transpose-words) | 1353 | (define-key esc-map "t" 'transpose-words) |