+ (let ((do-hook (if xterm-mouse-mode 'add-hook 'remove-hook)))
+ (funcall do-hook 'terminal-init-xterm-hook
+ 'turn-on-xterm-mouse-tracking-on-terminal)
+ (funcall do-hook 'delete-terminal-functions
+ 'turn-off-xterm-mouse-tracking-on-terminal)
+ (funcall do-hook 'suspend-tty-functions
+ 'turn-off-xterm-mouse-tracking-on-terminal)
+ (funcall do-hook 'resume-tty-functions
+ 'turn-on-xterm-mouse-tracking-on-terminal)
+ (funcall do-hook 'suspend-hook 'turn-off-xterm-mouse-tracking)
+ (funcall do-hook 'suspend-resume-hook 'turn-on-xterm-mouse-tracking)
+ (funcall do-hook 'kill-emacs-hook 'turn-off-xterm-mouse-tracking))