# HG changeset patch # User Dan Nicolaescu # Date 1122057615 0 # Node ID 79fcb8ba32debc9867ccf6d8109b3aa3402b7354 # Parent d5254bde5ea561e03189336a735c5e7d0ae1fb2f Load term/rxvt if the terminal is actually an rxvt terminal. (xterm-rxvt-set-background-mode): Remove, not used anymore. diff -r d5254bde5ea5 -r 79fcb8ba32de lisp/ChangeLog --- a/lisp/ChangeLog Fri Jul 22 17:11:04 2005 +0000 +++ b/lisp/ChangeLog Fri Jul 22 18:40:15 2005 +0000 @@ -1,5 +1,9 @@ 2005-07-22 Dan Nicolaescu + * term/xterm.el: Load term/rxvt if the terminal is actually an + rxvt terminal. + (xterm-rxvt-set-background-mode): Remove, not used anymore. + * term/rxvt.el (function-key-map): Use substitute-key-definition to bind {C,S,C-S}-{f1-f10}. Add a few missing key bindings. diff -r d5254bde5ea5 -r 79fcb8ba32de lisp/term/xterm.el --- a/lisp/term/xterm.el Fri Jul 22 17:11:04 2005 +0000 +++ b/lisp/term/xterm.el Fri Jul 22 18:40:15 2005 +0000 @@ -26,6 +26,13 @@ ;;; Code: +;;; rxvt terminals sometimes set the TERM variable to "xterm", but +;;; rxvt's keybindings that are incompatible with xterm's. It is +;;; better in that case to load rxvt's terminal initialization file. +(if (and (getenv "COLORTERM") + (string-match "\\`rxvt" (getenv "COLORTERM"))) + (load "term/rxvt") + ;;; The terminal intialization C code file might have initialized ;;; function keys F13->F60 from the termcap/terminfo information. On ;;; a PC-style keyboard these keys correspond to @@ -359,38 +366,11 @@ ;; right colors, so clear them. (clear-face-cache))) -;; rxvt puts the default colors into an environment variable -;; COLORFGBG. We use this to set the background mode in a more -;; intelligent way than the default guesswork in startup.el. -(defun xterm-rxvt-set-background-mode () - "Set background mode as appropriate for the default rxvt colors." - (let ((fgbg (getenv "COLORFGBG")) - bg rgb) - (setq default-frame-background-mode 'light) - (when (and fgbg - (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) - (setq bg (string-to-number (substring fgbg (match-beginning 1)))) - ;; The next line assumes that xterm-standard-colors are ordered - ;; by the color index in the ascending order! - (setq rgb (car (cddr (nth bg xterm-standard-colors)))) - ;; See the commentary in frame-set-background-mode about the - ;; computation below. - (if (< (apply '+ rgb) - ;; The following line assumes that white is the 15th - ;; color in xterm-standard-colors. - (* (apply '+ (car (cddr (nth 15 xterm-standard-colors)))) 0.6)) - (setq default-frame-background-mode 'dark))) - (frame-set-background-mode (selected-frame)))) - ;; Do it! (xterm-register-default-colors) -;; If this xterm is actually a disguised rxvt, be more intelligent about -;; determining the background mode. -(and (getenv "COLORTERM") - (string-match "\\`rxvt" (getenv "COLORTERM")) - (xterm-rxvt-set-background-mode)) ;; This recomputes all the default faces given the colors we've just set up. (tty-set-up-initial-frame-faces) +) ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a ;;; xterm.el ends here