Mercurial > emacs
changeset 80848:03a94cbf631a
(t-mouse-mode): Do nothing on a graphical display
when disabling t-mouse-mode.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Fri, 04 May 2007 02:26:14 +0000 |
parents | b087ba5edba9 |
children | 626d17be9275 |
files | lisp/t-mouse.el |
diffstat | 1 files changed, 24 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/t-mouse.el Fri May 04 02:23:56 2007 +0000 +++ b/lisp/t-mouse.el Fri May 04 02:26:14 2007 +0000 @@ -275,32 +275,32 @@ Turn it on to use Emacs mouse commands, and off to use t-mouse commands." nil " Mouse" nil :global t - (if t-mouse-mode - ;; Turn it on - (unless window-system - ;; Starts getting a stream of mouse events from an asynchronous process. - ;; Only works if Emacs is running on a virtual terminal without a window system. + (unless window-system + (if t-mouse-mode + ;; Turn it on. Starts getting a stream of mouse events from an + ;; asynchronous process. Only works if Emacs is running on a virtual + ;; terminal without a window system. (progn - (setq mouse-position-function #'t-mouse-mouse-position-function) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (not (stringp tty)) - (error "Cannot find a virtual terminal")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" - "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (set-process-query-on-exit-flag t-mouse-process nil))) + (setq mouse-position-function #'t-mouse-mouse-position-function) + (let ((tty (t-mouse-tty)) + (process-connection-type t)) + (if (not (stringp tty)) + (error "Cannot find a virtual terminal")) + (setq t-mouse-process + (start-process "t-mouse" nil + "mev" "-i" "-E" "-C" tty + (if t-mouse-swap-alt-keys + "-M-leftAlt" "-M-rightAlt") + "-e-move" + "-dall" "-d-hard" + "-f"))) + (setq t-mouse-filter-accumulator "") + (set-process-filter t-mouse-process 't-mouse-process-filter) + (set-process-query-on-exit-flag t-mouse-process nil)) ;; Turn it off - (setq mouse-position-function nil) - (delete-process t-mouse-process) - (setq t-mouse-process nil))) + (setq mouse-position-function nil) + (delete-process t-mouse-process) + (setq t-mouse-process nil)))) (provide 't-mouse)