aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2002-03-05 18:41:53 +0000
committerEli Zaretskii2002-03-05 18:41:53 +0000
commitf4b60fe63591318ac690b360ebf9a7dc5f50a695 (patch)
treec0fdb1c54e95bd13f5a8c8cab1242b3b98dcd19e
parent022d6ae85743823ca78727f7d20bfae54ae53fa7 (diff)
downloademacs-f4b60fe63591318ac690b360ebf9a7dc5f50a695.tar.gz
emacs-f4b60fe63591318ac690b360ebf9a7dc5f50a695.zip
(mouse-show-mark): Remove the no-highlight alternative:
all terminals now support highlighting of some kind.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/mouse.el98
2 files changed, 50 insertions, 51 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 48c53ac4877..980f8171fed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12002-03-05 Eli Zaretskii <eliz@is.elta.co.il> 12002-03-05 Eli Zaretskii <eliz@is.elta.co.il>
2 2
3 * mouse.el (mouse-show-mark): Remove the no-highlight alternative:
4 all terminals now support highlighting of some kind.
5
3 * language/european.el (mac-roman): Fix the safe-chars property. 6 * language/european.el (mac-roman): Fix the safe-chars property.
4 7
52002-03-05 Andre Spiegel <spiegel@gnu.org> 82002-03-05 Andre Spiegel <spiegel@gnu.org>
diff --git a/lisp/mouse.el b/lisp/mouse.el
index f5e855f0920..f91707f1eea 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1007,57 +1007,53 @@ If DIR is positive skip forward; if negative, skip backward."
1007(defun mouse-show-mark () 1007(defun mouse-show-mark ()
1008 (if transient-mark-mode 1008 (if transient-mark-mode
1009 (delete-overlay mouse-drag-overlay) 1009 (delete-overlay mouse-drag-overlay)
1010 (if (not (display-mouse-p)) 1010 (let ((inhibit-quit t)
1011 (save-excursion 1011 (echo-keystrokes 0)
1012 (goto-char (mark t)) 1012 event events key ignore
1013 (sit-for 1)) 1013 x-lost-selection-hooks)
1014 (let ((inhibit-quit t) 1014 (add-hook 'x-lost-selection-hooks
1015 (echo-keystrokes 0) 1015 (lambda (seltype)
1016 event events key ignore 1016 (if (eq seltype 'PRIMARY)
1017 x-lost-selection-hooks) 1017 (progn (setq ignore t)
1018 (add-hook 'x-lost-selection-hooks 1018 (throw 'mouse-show-mark t)))))
1019 (lambda (seltype) 1019 (move-overlay mouse-drag-overlay (point) (mark t))
1020 (if (eq seltype 'PRIMARY) 1020 (catch 'mouse-show-mark
1021 (progn (setq ignore t) 1021 ;; In this loop, execute scroll bar and switch-frame events.
1022 (throw 'mouse-show-mark t))))) 1022 ;; Also ignore down-events that are undefined.
1023 (move-overlay mouse-drag-overlay (point) (mark t)) 1023 (while (progn (setq event (read-event))
1024 (catch 'mouse-show-mark 1024 (setq events (append events (list event)))
1025 ;; In this loop, execute scroll bar and switch-frame events. 1025 (setq key (apply 'vector events))
1026 ;; Also ignore down-events that are undefined. 1026 (or (and (consp event)
1027 (while (progn (setq event (read-event)) 1027 (eq (car event) 'switch-frame))
1028 (setq events (append events (list event))) 1028 (and (consp event)
1029 (setq key (apply 'vector events)) 1029 (eq (posn-point (event-end event))
1030 (or (and (consp event) 1030 'vertical-scroll-bar))
1031 (eq (car event) 'switch-frame)) 1031 (and (memq 'down (event-modifiers event))
1032 (and (consp event) 1032 (not (key-binding key))
1033 (eq (posn-point (event-end event)) 1033 (not (mouse-undouble-last-event events))
1034 'vertical-scroll-bar)) 1034 (not (member key mouse-region-delete-keys)))))
1035 (and (memq 'down (event-modifiers event)) 1035 (and (consp event)
1036 (not (key-binding key)) 1036 (or (eq (car event) 'switch-frame)
1037 (not (mouse-undouble-last-event events)) 1037 (eq (posn-point (event-end event))
1038 (not (member key mouse-region-delete-keys))))) 1038 'vertical-scroll-bar))
1039 (and (consp event) 1039 (let ((keys (vector 'vertical-scroll-bar event)))
1040 (or (eq (car event) 'switch-frame) 1040 (and (key-binding keys)
1041 (eq (posn-point (event-end event)) 1041 (progn
1042 'vertical-scroll-bar)) 1042 (call-interactively (key-binding keys)
1043 (let ((keys (vector 'vertical-scroll-bar event))) 1043 nil keys)
1044 (and (key-binding keys) 1044 (setq events nil)))))))
1045 (progn 1045 ;; If we lost the selection, just turn off the highlighting.
1046 (call-interactively (key-binding keys) 1046 (if ignore
1047 nil keys) 1047 nil
1048 (setq events nil))))))) 1048 ;; For certain special keys, delete the region.
1049 ;; If we lost the selection, just turn off the highlighting. 1049 (if (member key mouse-region-delete-keys)
1050 (if ignore 1050 (delete-region (overlay-start mouse-drag-overlay)
1051 nil 1051 (overlay-end mouse-drag-overlay))
1052 ;; For certain special keys, delete the region. 1052 ;; Otherwise, unread the key so it gets executed normally.
1053 (if (member key mouse-region-delete-keys) 1053 (setq unread-command-events
1054 (delete-region (overlay-start mouse-drag-overlay) 1054 (nconc events unread-command-events))))
1055 (overlay-end mouse-drag-overlay)) 1055 (setq quit-flag nil)
1056 ;; Otherwise, unread the key so it gets executed normally. 1056 (delete-overlay mouse-drag-overlay))))
1057 (setq unread-command-events
1058 (nconc events unread-command-events))))
1059 (setq quit-flag nil)
1060 (delete-overlay mouse-drag-overlay)))))
1061 1057
1062(defun mouse-set-mark (click) 1058(defun mouse-set-mark (click)
1063 "Set mark at the position clicked on with the mouse. 1059 "Set mark at the position clicked on with the mouse.