# HG changeset patch # User Richard M. Stallman # Date 841107815 0 # Node ID f063cae001ee6f4947a5610f5505a70c67eb58df # Parent 5f980c3b53e032ac8b40f5e77275c75039c75dda (mouse-region-delete-keys): New variable. (mouse-show-mark): If one of those keys is next, delete the region. diff -r 5f980c3b53e0 -r f063cae001ee lisp/mouse.el --- a/lisp/mouse.el Tue Aug 27 00:14:26 1996 +0000 +++ b/lisp/mouse.el Tue Aug 27 01:03:35 1996 +0000 @@ -732,6 +732,10 @@ nil))) ;; Momentarily show where the mark is, if highlighting doesn't show it. + +(defvar mouse-region-delete-keys '([delete]) + "List of keys which shall cause the mouse region to be deleted.") + (defun mouse-show-mark () (if transient-mark-mode (if window-system @@ -739,15 +743,22 @@ (if window-system (let ((inhibit-quit t) (echo-keystrokes 0) - event events) + event events key) (move-overlay mouse-drag-overlay (point) (mark t)) (while (progn (setq event (read-event)) (setq events (append events (list event))) + (setq key (apply 'vector events)) (and (memq 'down (event-modifiers event)) - (not (key-binding (apply 'vector events))) + (not (key-binding key)) + (not (member key mouse-region-delete-keys)) (not (mouse-undouble-last-event events))))) - (setq unread-command-events - (nconc events unread-command-events)) + ;; For certain special keys, delete the region. + (if (member key mouse-region-delete-keys) + (delete-region (overlay-start mouse-drag-overlay) + (overlay-end mouse-drag-overlay)) + ;; Otherwise, unread the key so it gets executed normally. + (setq unread-command-events + (nconc events unread-command-events))) (setq quit-flag nil) (delete-overlay mouse-drag-overlay)) (save-excursion