From ab60bd74039853d94fd4b9715724af9444879b93 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Fri, 29 Oct 2004 14:31:34 +0000 Subject: [PATCH] (mouse-show-mark): Replace the last occurrence of x-lost-selection-hooks with x-lost-selection-functions. --- lisp/ChangeLog | 5 +++++ lisp/mouse.el | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 43df724bb4c..764b5e77bb3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-10-29 Sam Steingold + + * mouse.el (mouse-show-mark): Repleace the last occurrence of + x-lost-selection-hooks with x-lost-selection-functions. + 2004-10-28 Stefan * mouse.el (mouse-show-mark): Adjust to new name and don't assume diff --git a/lisp/mouse.el b/lisp/mouse.el index 109613e8f58..8f05324d84d 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1029,13 +1029,13 @@ If MODE is 2 then do the same for lines." (echo-keystrokes 0) event events key ignore (x-lost-selection-functions - (if (boundp 'x-lost-selection-functions) - (copy-sequence x-lost-selection-functions)))) - (add-hook 'x-lost-selection-hook + (when (boundp 'x-lost-selection-functions) + (copy-sequence x-lost-selection-functions)))) + (add-hook 'x-lost-selection-functions (lambda (seltype) - (if (eq seltype 'PRIMARY) - (progn (setq ignore t) - (throw 'mouse-show-mark t))))) + (when (eq seltype 'PRIMARY) + (setq ignore t) + (throw 'mouse-show-mark t)))) (if transient-mark-mode (delete-overlay mouse-drag-overlay) (move-overlay mouse-drag-overlay (point) (mark t))) @@ -1065,8 +1065,7 @@ If MODE is 2 then do the same for lines." nil keys) (setq events nil))))))) ;; If we lost the selection, just turn off the highlighting. - (if ignore - nil + (unless ignore ;; For certain special keys, delete the region. (if (member key mouse-region-delete-keys) (delete-region (overlay-start mouse-drag-overlay) -- 2.39.5