Mercurial > emacs
comparison lisp/mouse.el @ 66669:550c8e306cb5
Fix special handling of DEL after dragging a region:
(mouse-drag-region-1): Treat mouse-set-region like mouse-set-point.
(mouse-region-delete-keys): Add [backspace].
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 03 Nov 2005 21:37:21 +0000 |
parents | e921fbeaaddb |
children | 2c91c2e7af3a |
comparison
equal
deleted
inserted
replaced
66668:857eb702a3f1 | 66669:550c8e306cb5 |
---|---|
959 | 959 |
960 (if (consp event) | 960 (if (consp event) |
961 (let* ((fun (key-binding (vector (car event)))) | 961 (let* ((fun (key-binding (vector (car event)))) |
962 (do-multi-click (and (> (event-click-count event) 0) | 962 (do-multi-click (and (> (event-click-count event) 0) |
963 (functionp fun) | 963 (functionp fun) |
964 (not (eq fun 'mouse-set-point))))) | 964 (not (memq fun '(mouse-set-point mouse-set-region)))))) |
965 ;; Run the binding of the terminating up-event, if possible. | 965 ;; Run the binding of the terminating up-event, if possible. |
966 (if (and (not (= (overlay-start mouse-drag-overlay) | 966 (if (and (not (= (overlay-start mouse-drag-overlay) |
967 (overlay-end mouse-drag-overlay))) | 967 (overlay-end mouse-drag-overlay))) |
968 (not do-multi-click)) | 968 (not do-multi-click)) |
969 (let* ((stop-point | 969 (let* ((stop-point |
1073 (t | 1073 (t |
1074 (while (and (not (eobp)) (= (following-char) char)) | 1074 (while (and (not (eobp)) (= (following-char) char)) |
1075 (forward-char 1)))))) | 1075 (forward-char 1)))))) |
1076 | 1076 |
1077 (defun mouse-start-end (start end mode) | 1077 (defun mouse-start-end (start end mode) |
1078 "Return a list of region bounds based on START and END according to MODE. | 1078 "Return a list of region bounds based on START and END according to MODE. |
1079 If MODE is 0 then set point to (min START END), mark to (max START END). | 1079 If MODE is 0 then set point to (min START END), mark to (max START END). |
1080 If MODE is 1 then set point to start of word at (min START END), | 1080 If MODE is 1 then set point to start of word at (min START END), |
1081 mark to end of word at (max START END). | 1081 mark to end of word at (max START END). |
1082 If MODE is 2 then do the same for lines." | 1082 If MODE is 2 then do the same for lines." |
1083 (if (> start end) | 1083 (if (> start end) |
1179 (setcar last event) | 1179 (setcar last event) |
1180 nil))) | 1180 nil))) |
1181 | 1181 |
1182 ;; Momentarily show where the mark is, if highlighting doesn't show it. | 1182 ;; Momentarily show where the mark is, if highlighting doesn't show it. |
1183 | 1183 |
1184 (defvar mouse-region-delete-keys '([delete] [deletechar]) | 1184 (defcustom mouse-region-delete-keys '([delete] [deletechar] [backspace]) |
1185 "List of keys which shall cause the mouse region to be deleted.") | 1185 "List of keys that should cause the mouse region to be deleted." |
1186 :group 'mouse | |
1187 :type '(repeat key-sequence)) | |
1186 | 1188 |
1187 (defun mouse-show-mark () | 1189 (defun mouse-show-mark () |
1188 (let ((inhibit-quit t) | 1190 (let ((inhibit-quit t) |
1189 (echo-keystrokes 0) | 1191 (echo-keystrokes 0) |
1190 event events key ignore | 1192 event events key ignore |