Mercurial > emacs
comparison lisp/mouse.el @ 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 | 8fe3a1b0606e |
children | e91b3798021f |
comparison
equal
deleted
inserted
replaced
57784:55829134ac17 | 57785:2a55e2b38c8d |
---|---|
1027 (defun mouse-show-mark () | 1027 (defun mouse-show-mark () |
1028 (let ((inhibit-quit t) | 1028 (let ((inhibit-quit t) |
1029 (echo-keystrokes 0) | 1029 (echo-keystrokes 0) |
1030 event events key ignore | 1030 event events key ignore |
1031 (x-lost-selection-functions | 1031 (x-lost-selection-functions |
1032 (if (boundp 'x-lost-selection-functions) | 1032 (when (boundp 'x-lost-selection-functions) |
1033 (copy-sequence x-lost-selection-functions)))) | 1033 (copy-sequence x-lost-selection-functions)))) |
1034 (add-hook 'x-lost-selection-hook | 1034 (add-hook 'x-lost-selection-functions |
1035 (lambda (seltype) | 1035 (lambda (seltype) |
1036 (if (eq seltype 'PRIMARY) | 1036 (when (eq seltype 'PRIMARY) |
1037 (progn (setq ignore t) | 1037 (setq ignore t) |
1038 (throw 'mouse-show-mark t))))) | 1038 (throw 'mouse-show-mark t)))) |
1039 (if transient-mark-mode | 1039 (if transient-mark-mode |
1040 (delete-overlay mouse-drag-overlay) | 1040 (delete-overlay mouse-drag-overlay) |
1041 (move-overlay mouse-drag-overlay (point) (mark t))) | 1041 (move-overlay mouse-drag-overlay (point) (mark t))) |
1042 (catch 'mouse-show-mark | 1042 (catch 'mouse-show-mark |
1043 ;; In this loop, execute scroll bar and switch-frame events. | 1043 ;; In this loop, execute scroll bar and switch-frame events. |
1063 (progn | 1063 (progn |
1064 (call-interactively (key-binding keys) | 1064 (call-interactively (key-binding keys) |
1065 nil keys) | 1065 nil keys) |
1066 (setq events nil))))))) | 1066 (setq events nil))))))) |
1067 ;; If we lost the selection, just turn off the highlighting. | 1067 ;; If we lost the selection, just turn off the highlighting. |
1068 (if ignore | 1068 (unless ignore |
1069 nil | |
1070 ;; For certain special keys, delete the region. | 1069 ;; For certain special keys, delete the region. |
1071 (if (member key mouse-region-delete-keys) | 1070 (if (member key mouse-region-delete-keys) |
1072 (delete-region (overlay-start mouse-drag-overlay) | 1071 (delete-region (overlay-start mouse-drag-overlay) |
1073 (overlay-end mouse-drag-overlay)) | 1072 (overlay-end mouse-drag-overlay)) |
1074 ;; Otherwise, unread the key so it gets executed normally. | 1073 ;; Otherwise, unread the key so it gets executed normally. |