Merged from miles@gnu.org--gnu-2005 (patch 83-87, 449-468)
[bpt/emacs.git] / lisp / term / rxvt.el
index 180e0b4..6e45cce 100644 (file)
@@ -36,7 +36,6 @@
   (setq rxvt-function-map (make-sparse-keymap))
 
   ;; Set up function-key-map entries that termcap and terminfo don't know.
-  ;; XXX We need to find a way to have these define-keys be display-local. -- Lorentey
   (define-key rxvt-function-map "\e[A" [up])
   (define-key rxvt-function-map "\e[B" [down])
   (define-key rxvt-function-map "\e[C" [right])
   (define-key rxvt-function-map "\e[d" [S-left])
   (define-key rxvt-function-map "\e[c" [S-right])
   (define-key rxvt-function-map "\e[a" [S-up])
-  (define-key rxvt-function-map "\e[b" [S-down])
+  (define-key rxvt-function-map "\e[b" [S-down]))
 
-  ;; 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.
-  (set-keymap-parent rxvt-function-map (keymap-parent function-key-map))
-  (set-keymap-parent function-key-map rxvt-function-map))
+;; 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.
+(let ((m (copy-keymap rxvt-function-map)))
+  (set-keymap-parent m (keymap-parent (terminal-local-value 'function-key-map nil)))
+  (set-keymap-parent (terminal-local-value 'function-key-map nil) m))
 
 
 ;; Set up colors, for those versions of rxvt that support it.
@@ -160,7 +160,7 @@ for the currently selected frame."
   "Set background mode as appropriate for the default rxvt colors."
   (let ((fgbg (server-getenv "COLORFGBG"))
        bg rgb)
-    (setq frame-background-mode 'light)        ; default
+    (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))))
@@ -173,7 +173,7 @@ for the currently selected frame."
             ;; The following line assumes that white is the 15th
             ;; color in rxvt-standard-colors.
             (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6))
-         (setq frame-background-mode 'dark)))
+         (setq default-frame-background-mode 'dark)))
     (frame-set-background-mode (selected-frame))))
 
 ;; Do it!