aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2007-09-15 00:27:38 +0000
committerDan Nicolaescu2007-09-15 00:27:38 +0000
commitaaeefd66c584817a062e0f1f73db23bb0c4744a4 (patch)
tree8d3cbcabf19229b28b1593f588312db4161f8699
parentda600aad2b78301836086568c4cb16a907ccf00e (diff)
downloademacs-aaeefd66c584817a062e0f1f73db23bb0c4744a4.tar.gz
emacs-aaeefd66c584817a062e0f1f73db23bb0c4744a4.zip
* xt-mouse.el (xterm-mouse-mode): Add hooks here not at the top
level. Remove the hooks when turning off the mode. * term/xterm.el: Require xt-mouse at compile time. (terminal-init-xterm): Turn on xterm mouse tracking for this terminal if xterm-mouse-mode is enabled.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/term/xterm.el8
-rw-r--r--lisp/xt-mouse.el23
3 files changed, 39 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 62e9d912c14..b661d0883b6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12007-09-15 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * xt-mouse.el (xterm-mouse-mode): Add hooks here not at the top
4 level. Remove the hooks when turning off the mode.
5
6 * term/xterm.el: Require xt-mouse at compile time.
7 (terminal-init-xterm): Turn on xterm mouse tracking for this
8 terminal if xterm-mouse-mode is enabled.
9
12007-09-14 Dan Nicolaescu <dann@ics.uci.edu> 102007-09-14 Dan Nicolaescu <dann@ics.uci.edu>
2 11
3 * term/xterm.el (xterm-function-map): Replace bindings that were 12 * term/xterm.el (xterm-function-map): Replace bindings that were
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 8e803a4534b..de206c159c7 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -27,6 +27,8 @@
27 27
28;;; Code: 28;;; Code:
29 29
30(eval-when-compile (require 'xt-mouse))
31
30(defvar xterm-function-map 32(defvar xterm-function-map
31 (let ((map (make-sparse-keymap))) 33 (let ((map (make-sparse-keymap)))
32 34
@@ -455,7 +457,11 @@
455 (xterm-register-default-colors) 457 (xterm-register-default-colors)
456 ;; This recomputes all the default faces given the colors we've just set up. 458 ;; This recomputes all the default faces given the colors we've just set up.
457 (tty-set-up-initial-frame-faces) 459 (tty-set-up-initial-frame-faces)
458 460
461 (when xterm-mouse-mode
462 (turn-on-xterm-mouse-tracking-on-terminal
463 (frame-terminal (selected-frame))))
464
459 ;; Try to turn on the modifyOtherKeys feature on modern xterms. 465 ;; Try to turn on the modifyOtherKeys feature on modern xterms.
460 ;; When it is turned on much more key bindings work: things like 466 ;; When it is turned on much more key bindings work: things like
461 ;; C-. C-, etc. 467 ;; C-. C-, etc.
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index af7a3789df0..ab07a0c73c9 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -208,9 +208,32 @@ down the SHIFT key while pressing the mouse button."
208 (if xterm-mouse-mode 208 (if xterm-mouse-mode
209 ;; Turn it on 209 ;; Turn it on
210 (progn 210 (progn
211 ;; Frame creation and deletion.
212 (add-hook 'after-make-frame-functions
213 'turn-on-xterm-mouse-tracking-on-terminal)
214 (add-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame)
215
216 ;; Restore normal mouse behaviour outside Emacs.
217 (add-hook 'suspend-tty-functions
218 'turn-off-xterm-mouse-tracking-on-terminal)
219 (add-hook 'resume-tty-functions
220 'turn-on-xterm-mouse-tracking-on-terminal)
221 (add-hook 'suspend-hook 'turn-off-xterm-mouse-tracking)
222 (add-hook 'suspend-resume-hook 'turn-on-xterm-mouse-tracking)
223 (add-hook 'kill-emacs-hook 'turn-off-xterm-mouse-tracking)
211 (setq mouse-position-function #'xterm-mouse-position-function) 224 (setq mouse-position-function #'xterm-mouse-position-function)
212 (turn-on-xterm-mouse-tracking)) 225 (turn-on-xterm-mouse-tracking))
213 ;; Turn it off 226 ;; Turn it off
227 (remove-hook 'after-make-frame-functions
228 'turn-on-xterm-mouse-tracking-on-terminal)
229 (remove-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame)
230 (remove-hook 'suspend-tty-functions
231 'turn-off-xterm-mouse-tracking-on-terminal)
232 (remove-hook 'resume-tty-functions
233 'turn-on-xterm-mouse-tracking-on-terminal)
234 (remove-hook 'suspend-hook 'turn-off-xterm-mouse-tracking)
235 (remove-hook 'suspend-resume-hook 'turn-on-xterm-mouse-tracking)
236 (remove-hook 'kill-emacs-hook 'turn-off-xterm-mouse-tracking)
214 (turn-off-xterm-mouse-tracking 'force) 237 (turn-off-xterm-mouse-tracking 'force)
215 (setq mouse-position-function nil))) 238 (setq mouse-position-function nil)))
216 239