diff lisp/mouse.el @ 109062:d8144fe7f3f8

* bindings.el (global-map): Bind delete and DEL, the former to delete-forward-char. * mouse.el (mouse-region-delete-keys): Deleted. (mouse-show-mark): Simplify. * simple.el (delete-active-region): New option. (delete-backward-char): Implement in Lisp. (delete-forward-char): New command. * src/cmds.c (Fdelete_backward_char): Move into Lisp.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 27 Jun 2010 21:01:11 -0400
parents 1d1d5d9bd884
children a46a2b77a8b1
line wrap: on
line diff
--- a/lisp/mouse.el	Sun Jun 27 14:28:51 2010 -0700
+++ b/lisp/mouse.el	Sun Jun 27 21:01:11 2010 -0400
@@ -929,7 +929,7 @@
   (mouse-minibuffer-check start-event)
   (setq mouse-selection-click-count-buffer (current-buffer))
   ;; We must call deactivate-mark before repositioning point.
-  ;; Otherwise, for select-active-regions non-nil, we get the wrong
+  ;; Otherwise, for `select-active-regions' non-nil, we get the wrong
   ;; selection if the user drags a region, clicks elsewhere to
   ;; reposition point, then middle-clicks to paste the selection.
   (deactivate-mark)
@@ -1263,11 +1263,6 @@
 
 ;; Momentarily show where the mark is, if highlighting doesn't show it.
 
-(defcustom mouse-region-delete-keys '([delete] [deletechar] [backspace])
-  "List of keys that should cause the mouse region to be deleted."
-  :group 'mouse
-  :type '(repeat key-sequence))
-
 (defun mouse-show-mark ()
   (let ((inhibit-quit t)
 	(echo-keystrokes 0)
@@ -1297,8 +1292,7 @@
 				 'vertical-scroll-bar))
 			(and (memq 'down (event-modifiers event))
 			     (not (key-binding key))
-			     (not (mouse-undouble-last-event events))
-			     (not (member key mouse-region-delete-keys)))))
+			     (not (mouse-undouble-last-event events)))))
 	(and (consp event)
 	     (or (eq (car event) 'switch-frame)
 		 (eq (posn-point (event-end event))
@@ -1311,22 +1305,9 @@
 		      (setq events nil)))))))
     ;; If we lost the selection, just turn off the highlighting.
     (unless ignore
-      ;; For certain special keys, delete the region.
-      (if (member key mouse-region-delete-keys)
-	  (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))))
+      ;; Unread the key so it gets executed normally.
+      (setq unread-command-events
+	    (nconc events unread-command-events)))
     (setq quit-flag nil)
     (unless transient-mark-mode
       (delete-overlay mouse-drag-overlay))))