summaryrefslogtreecommitdiff
path: root/lisp/xt-mouse.el
diff options
context:
space:
mode:
authorLuc Teirlinck <teirllm@auburn.edu>2005-04-12 23:05:22 +0000
committerLuc Teirlinck <teirllm@auburn.edu>2005-04-12 23:05:22 +0000
commit9001354f958f1a7d000d23198a5fd3404521bdb7 (patch)
treee1a21a249890ef939cc522a0b6c9b38d62777379 /lisp/xt-mouse.el
parentb5bbc1b3de4cfff5699823de27a87c8eb92d8485 (diff)
downloademacs-9001354f958f1a7d000d23198a5fd3404521bdb7.tar.gz
(xterm-mouse-mode): Provide correct standard value for Custom. No
longer show "Mouse" in mode line when enabled. Doc fix.
Diffstat (limited to 'lisp/xt-mouse.el')
-rw-r--r--lisp/xt-mouse.el31
1 files changed, 27 insertions, 4 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 4f7e19623fe..90e127487f5 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -156,10 +156,33 @@
With prefix arg, turn XTerm mouse mode on iff arg is positive.
Turn it on to use Emacs mouse commands, and off to use xterm mouse commands.
-This works in terminal emulators compatible with xterm. Only single clicks
-are supported. When turned on, the normal xterm mouse functionality is still
-available by holding down the SHIFT key while pressing the mouse button."
- nil " Mouse" nil :global t :group 'mouse
+This works in terminal emulators compatible with xterm. It only
+works for simple uses of the mouse. Basically, only non-modified
+single clicks are supported. When turned on, the normal xterm
+mouse functionality for such clicks is still available by holding
+down the SHIFT key while pressing the mouse button."
+ :global t :group 'mouse
+ ;; Do not change the :init-value below, without corresponding
+ ;; changes in the related code in startup.el.
+ :init-value (unless (or noninteractive
+ window-system
+ (null term-file-prefix))
+ (let ((term (getenv "TERM"))
+ hyphend)
+ (while
+ (and term
+ (not (load (concat term-file-prefix term) t t)))
+ ;; Strip off last hyphen and what follows, then
+ ;; try again
+ (setq term
+ (if (setq hyphend
+ (string-match "[-_][^-_]+$" term))
+ (substring term 0 hyphend)
+ nil)))
+ (and term
+ (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
+ term)
+ t)))
(if xterm-mouse-mode
;; Turn it on
(unless window-system