changeset 57785:2a55e2b38c8d

(mouse-show-mark): Replace the last occurrence of x-lost-selection-hooks with x-lost-selection-functions.
author Sam Steingold <sds@gnu.org>
date Fri, 29 Oct 2004 14:31:34 +0000
parents 55829134ac17
children feb47c14dfa5
files lisp/ChangeLog lisp/mouse.el
diffstat 2 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Oct 29 02:23:24 2004 +0000
+++ b/lisp/ChangeLog	Fri Oct 29 14:31:34 2004 +0000
@@ -1,3 +1,8 @@
+2004-10-29  Sam Steingold  <sds@gnu.org>
+
+	* mouse.el (mouse-show-mark): Repleace the last occurrence of
+	x-lost-selection-hooks with x-lost-selection-functions.
+
 2004-10-28  Stefan  <monnier@iro.umontreal.ca>
 
 	* mouse.el (mouse-show-mark): Adjust to new name and don't assume
--- a/lisp/mouse.el	Fri Oct 29 02:23:24 2004 +0000
+++ b/lisp/mouse.el	Fri Oct 29 14:31:34 2004 +0000
@@ -1029,13 +1029,13 @@
 	(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 @@
 					  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)