changeset 61542:e04d48765c2e

(command-line): Handle `xterm-mouse-mode' before reading init file.
author Luc Teirlinck <teirllm@auburn.edu>
date Wed, 13 Apr 2005 22:24:03 +0000
parents a576ac1919b9
children e70ec34c978b
files lisp/startup.el
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Wed Apr 13 22:22:40 2005 +0000
+++ b/lisp/startup.el	Wed Apr 13 22:24:03 2005 +0000
@@ -752,6 +752,16 @@
               (not (fboundp 'x-show-tip)))
     (tooltip-mode 1))
 
+  ;; If you change the code below, you need to also change the
+  ;; corresponding code in the xterm-mouse-mode defcustom.  The two need
+  ;; to be equivalent under all conditions, or Custom will get confused.
+  (unless (or noninteractive
+	      window-system)
+    (let ((term (getenv "TERM")))
+      (and term
+	   (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)" term)
+	   (xterm-mouse-mode 1))))
+
   ;; Register default TTY colors for the case the terminal hasn't a
   ;; terminal init file.
   (unless (memq window-system '(x w32))
@@ -964,9 +974,6 @@
   ;; Load library for our terminal type.
   ;; User init file can set term-file-prefix to nil to prevent this.
 
-  ;; If you change the code below, you need to also change the
-  ;; corresponding code in the xterm-mouse-mode defcustom.  The two need
-  ;; to be equivalent under all conditions, or Custom will get confused.
   (unless (or noninteractive
               window-system
               (null term-file-prefix))
@@ -978,10 +985,7 @@
         (setq term
               (if (setq hyphend (string-match "[-_][^-_]+$" term))
                   (substring term 0 hyphend)
-                nil)))
-      (and term
-	   (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)" term)
-	   (xterm-mouse-mode 1))))
+                nil)))))
 
   ;; Update the out-of-memory error message based on user's key bindings
   ;; for save-some-buffers.