diff options
| author | Dan Nicolaescu | 2005-09-24 23:10:02 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2005-09-24 23:10:02 +0000 |
| commit | 836c8f066c86d0511a25f4bf926d5cfed1e3a3ef (patch) | |
| tree | bd1ee0fd34f193e082fd43f6e767366db6def0bb | |
| parent | aa5486323eee44814090691a798ab0d0b070858d (diff) | |
| download | emacs-836c8f066c86d0511a25f4bf926d5cfed1e3a3ef.tar.gz emacs-836c8f066c86d0511a25f4bf926d5cfed1e3a3ef.zip | |
* term/rxvt.el (rxvt-register-default-colors): Add support for 88
colors rxvt-unicode terminals by using the same code as xterm.el.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/term/rxvt.el | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3807037e57d..96091669512 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2005-09-24 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * term/rxvt.el (rxvt-register-default-colors): Add support for 88 | ||
| 4 | colors rxvt-unicode terminals by using the same code as xterm.el. | ||
| 5 | |||
| 1 | 2005-09-24 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2005-09-24 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * textmodes/tex-mode.el (tex-font-lock-append-prop) | 8 | * textmodes/tex-mode.el (tex-font-lock-append-prop) |
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 44a14271c92..05cd854f224 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el | |||
| @@ -210,6 +210,36 @@ for the currently selected frame." | |||
| 210 | (setq colors (cdr colors) | 210 | (setq colors (cdr colors) |
| 211 | color (car colors) | 211 | color (car colors) |
| 212 | ncolors (1- ncolors))) | 212 | ncolors (1- ncolors))) |
| 213 | (when (and (> ncolors 0) (= ncolors 72)) ; rxvt-unicode | ||
| 214 | ;; 64 non-gray colors | ||
| 215 | (let ((levels '(0 139 205 255)) | ||
| 216 | (r 0) (g 0) (b 0)) | ||
| 217 | (while (> ncolors 8) | ||
| 218 | (tty-color-define (format "color-%d" (- 88 ncolors)) | ||
| 219 | (- 88 ncolors) | ||
| 220 | (mapcar 'rxvt-rgb-convert-to-16bit | ||
| 221 | (list (nth r levels) | ||
| 222 | (nth g levels) | ||
| 223 | (nth b levels)))) | ||
| 224 | (setq b (1+ b)) | ||
| 225 | (if (> b 3) | ||
| 226 | (setq g (1+ g) | ||
| 227 | b 0)) | ||
| 228 | (if (> g 3) | ||
| 229 | (setq r (1+ r) | ||
| 230 | g 0)) | ||
| 231 | (setq ncolors (1- ncolors)))) | ||
| 232 | ;; Now the 8 gray colors | ||
| 233 | (while (> ncolors 0) | ||
| 234 | (setq color (rxvt-rgb-convert-to-16bit | ||
| 235 | (floor | ||
| 236 | (if (= ncolors 8) | ||
| 237 | 46.36363636 | ||
| 238 | (+ (* (- 8 ncolors) 23.18181818) 69.54545454))))) | ||
| 239 | (tty-color-define (format "color-%d" (- 88 ncolors)) | ||
| 240 | (- 88 ncolors) | ||
| 241 | (list color color color)) | ||
| 242 | (setq ncolors (1- ncolors)))) | ||
| 213 | ;; Modifying color mappings means realized faces don't use the | 243 | ;; Modifying color mappings means realized faces don't use the |
| 214 | ;; right colors, so clear them. | 244 | ;; right colors, so clear them. |
| 215 | (clear-face-cache))) | 245 | (clear-face-cache))) |