]> code.delx.au - gnu-emacs/blobdiff - lisp/term/xterm.el
* mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
[gnu-emacs] / lisp / term / xterm.el
index 47da0bf4de57e04674039727bc28b869be99364e..c03d64a2f5451fb76f46e42912b74eac999ac67c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; xterm.el --- define function key sequences and standard colors for xterm
 
-;; Copyright (C) 1995, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2013 Free Software Foundation, Inc.
 
 ;; Author: FSF
 ;; Keywords: terminals
 (defgroup xterm nil
   "XTerm support."
   :version "24.1"
-  :group 'emacs)
+  :group 'environment)
 
 (defcustom xterm-extra-capabilities 'check
-  "Set to a list if the XTerm supports modifyOtherKeys or
-reporting the background color.  Set to 'check to check for those
-features.  Set to nil to skip the checks."
+  "Whether Xterm supports some additional, more modern, features.
+If nil, just assume that it does not.
+If `check', try to check if it does.
+If a list, assume that the listed features are supported, without checking.
+
+The relevant features are:
+  modifyOtherKeys  -- if supported, more key bindings work (e.g., \"\\C-,\")
+  reportBackground -- if supported, Xterm reports its background color
+"
+  :version "24.1"
   :group 'xterm
   :type '(choice (const :tag "No" nil)
                  (const :tag "Check" check)
@@ -460,7 +467,7 @@ features.  Set to nil to skip the checks."
   "Terminal initialization function for xterm."
   ;; rxvt terminals sometimes set the TERM variable to "xterm", but
   ;; rxvt's keybindings are incompatible with xterm's. It is
-  ;; better in that case to use rxvt's initializion function.
+  ;; better in that case to use rxvt's initialization function.
   (if (and (getenv "COLORTERM" (selected-frame))
           (string-match "\\`rxvt" (getenv "COLORTERM" (selected-frame))))
       (tty-run-terminal-initialization (selected-frame) "rxvt")
@@ -473,7 +480,7 @@ features.  Set to nil to skip the checks."
 
       ;; Use inheritance to let the main keymap override those defaults.
       ;; This way we don't override terminfo-derived settings or settings
-      ;; made in the .emacs file.
+      ;; made in the init file.
       (set-keymap-parent map (keymap-parent input-decode-map))
       (set-keymap-parent input-decode-map map)))
 
@@ -532,6 +539,7 @@ features.  Set to nil to skip the checks."
                 (and (memq 'reportBackground tocheck-capabilities)
                      version
                      (>= version 242)))
+       (discard-input)
         (send-string-to-terminal "\e]11;?\e\\")
         (when (and (equal (read-event nil nil 2) ?\e)
                    (equal (read-event nil nil 2) ?\]))
@@ -637,7 +645,7 @@ versions of xterm."
        ;; 216 non-gray colors first
        (let ((r 0) (g 0) (b 0))
          (while (> ncolors 24)
-           ;; This and other formulae taken from 256colres.pl and
+           ;; This and other formulas taken from 256colres.pl and
            ;; 88colres.pl in the xterm distribution.
            (tty-color-define (format "color-%d" (- 256 ncolors))
                              (- 256 ncolors)