# HG changeset patch # User Kim F. Storm # Date 1172484694 0 # Node ID 2854cd09e515129d15d7a33120057b8b51d60fce # Parent db7a28104afb76420e47637eb7f3ba1fab2c6f0d (mouse-show-mark): Run hooks and perform command remapping for mouse-region-delete-keys. diff -r db7a28104afb -r 2854cd09e515 lisp/mouse.el --- a/lisp/mouse.el Mon Feb 26 10:11:22 2007 +0000 +++ b/lisp/mouse.el Mon Feb 26 10:11:34 2007 +0000 @@ -1276,7 +1276,17 @@ (unless ignore ;; For certain special keys, delete the region. (if (member key mouse-region-delete-keys) - (delete-region (mark t) (point)) + (progn + ;; Since notionally this is a separate command, + ;; run all the hooks that would be run if it were + ;; executed separately. + (run-hooks 'post-command-hook) + (setq last-command this-command) + (setq this-original-command 'delete-region) + (setq this-command (or (command-remapping this-original-command) + this-original-command)) + (run-hooks 'pre-command-hook) + (call-interactively this-command)) ;; Otherwise, unread the key so it gets executed normally. (setq unread-command-events (nconc events unread-command-events))))