From 67755cc4839b19875f9cf8ae5b5c48ea81b6649e Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 21 Aug 2007 20:04:51 +0000 Subject: [PATCH] (delete-selection-pre-hook): Use `mouse-region-match' instead of checking last-command. --- lisp/delsel.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/delsel.el b/lisp/delsel.el index 8d6e6ea97d2..b4ae7965a3f 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -89,14 +89,11 @@ any selection." ((eq type 'yank) ;; Before a yank command, make sure we don't yank the ;; head of the kill-ring that really comes from the - ;; currently active region we are going to delete - ;; (when last-command is one that uses copy-region-as-kill - ;; or kill-new). That would make yank a no-op. + ;; currently active region we are going to delete. + ;; That would make yank a no-op. (when (and (string= (buffer-substring-no-properties (point) (mark)) (car kill-ring)) - (memq last-command - '(mouse-set-region mouse-drag-region - mouse-save-then-kill mouse-secondary-save-then-kill))) + (mouse-region-match)) (current-kill 1)) (delete-active-region)) ((eq type 'supersede) -- 2.39.2