comparison lisp/delsel.el @ 82507:9c9e50cbdf1e

(delete-selection-pre-hook): Use `mouse-region-match' instead of checking last-command.
author Juri Linkov <juri@jurta.org>
date Tue, 21 Aug 2007 20:04:51 +0000
parents b98604865ea0
children 6ae29c2dfff0 b83d0dadb2a7
comparison
equal deleted inserted replaced
82506:eeb13f703926 82507:9c9e50cbdf1e
87 (cond ((eq type 'kill) 87 (cond ((eq type 'kill)
88 (delete-active-region t)) 88 (delete-active-region t))
89 ((eq type 'yank) 89 ((eq type 'yank)
90 ;; Before a yank command, make sure we don't yank the 90 ;; Before a yank command, make sure we don't yank the
91 ;; head of the kill-ring that really comes from the 91 ;; head of the kill-ring that really comes from the
92 ;; currently active region we are going to delete 92 ;; currently active region we are going to delete.
93 ;; (when last-command is one that uses copy-region-as-kill 93 ;; That would make yank a no-op.
94 ;; or kill-new). That would make yank a no-op.
95 (when (and (string= (buffer-substring-no-properties (point) (mark)) 94 (when (and (string= (buffer-substring-no-properties (point) (mark))
96 (car kill-ring)) 95 (car kill-ring))
97 (memq last-command 96 (mouse-region-match))
98 '(mouse-set-region mouse-drag-region
99 mouse-save-then-kill mouse-secondary-save-then-kill)))
100 (current-kill 1)) 97 (current-kill 1))
101 (delete-active-region)) 98 (delete-active-region))
102 ((eq type 'supersede) 99 ((eq type 'supersede)
103 (let ((empty-region (= (point) (mark)))) 100 (let ((empty-region (= (point) (mark))))
104 (delete-active-region) 101 (delete-active-region)