]> code.delx.au - gnu-emacs/blobdiff - lisp/term/rxvt.el
Update copyright year to 2015
[gnu-emacs] / lisp / term / rxvt.el
index 0e9de519c8cae66125905ace8ac2c0fb00ea266c..fa981c6625bdc4734228c7110bf79d9d831439c0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; rxvt.el --- define function key sequences and standard colors for rxvt
 
-;; Copyright (C) 2002-201 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii
 ;; Keywords: terminals
 
 (defvar rxvt-alternatives-map
   (let ((map (make-sparse-keymap)))
-    ;; The terminal intialization C code file might have initialized
+    ;; The terminal initialization C code file might have initialized
     ;; function keys F11->F42 from the termcap/terminfo information.  On
     ;; a PC-style keyboard these keys correspond to
     ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-.  The
-    ;; code here subsitutes the corresponding defintions in
+    ;; code here substitutes the corresponding definitions in
     ;; function-key-map.  This substitution is needed because if a key
     ;; definition if found in function-key-map, there are no further
     ;; lookups in other keymaps.
 
   ;; 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.
   (let ((m (copy-keymap rxvt-function-map)))
     (set-keymap-parent m (keymap-parent input-decode-map))
     (set-keymap-parent input-decode-map m))
 
 (defun rxvt-rgb-convert-to-16bit (prim)
   "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
-  (min 65535 (round (* (/ prim 255.0) 65535.0))))
+  (logior prim (lsh prim 8)))
 
 (defun rxvt-register-default-colors ()
   "Register the default set of colors for rxvt or compatible emulator.
@@ -228,14 +228,14 @@ for the currently selected frame."
        ;; 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)
                              (mapcar 'rxvt-rgb-convert-to-16bit
-                                     (list (round (* r 42.5))
-                                           (round (* g 42.5))
-                                           (round (* b 42.5)))))
+                                     (list (if (zerop r) 0 (+ (* r 40) 55))
+                                           (if (zerop g) 0 (+ (* g 40) 55))
+                                           (if (zerop b) 0 (+ (* b 40) 55)))))
            (setq b (1+ b))
            (if (> b 5)
                (setq g (1+ g)