summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2007-02-26 10:11:34 +0000
committerKim F. Storm <storm@cua.dk>2007-02-26 10:11:34 +0000
commit760a2050ca3b597fddd830f9676e427d97ecf9ff (patch)
tree7177e8c4bf1d879d4c7b3b1ce31288dbee3efe51 /lisp/mouse.el
parent864129b6f7f2c2b1fc81964796ced9915e570a7f (diff)
(mouse-show-mark): Run hooks and perform command
remapping for mouse-region-delete-keys.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index dae098ec117..ef0784d8973 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1276,7 +1276,17 @@ If MODE is 2 then do the same for lines."
(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))))