Mercurial > emacs
comparison lisp/facemenu.el @ 60522:66456f4ae924
(list-colors-print): Print #RRGGBB in default face.
Remove 1 space before #RRGGBB to not truncate it on terminal
windows w/o fringes. Remove 1 space between bg and fg examples
to get more space.
(list-colors-duplicates): Replace `and' with `if' for `boundp' to
avoid byte-compile warnings.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Tue, 08 Mar 2005 21:47:03 +0000 |
parents | 53053dc21ae7 |
children | cae70b5066ae 29e773288013 |
comparison
equal
deleted
inserted
replaced
60521:f38eb69aa763 | 60522:66456f4ae924 |
---|---|
511 (indent-to 22)) | 511 (indent-to 22)) |
512 (point) | 512 (point) |
513 'face (cons 'background-color (car color))) | 513 'face (cons 'background-color (car color))) |
514 (put-text-property | 514 (put-text-property |
515 (prog1 (point) | 515 (prog1 (point) |
516 (insert " " (if (cdr color) | 516 (insert " " (if (cdr color) |
517 (mapconcat 'identity (cdr color) ", ") | 517 (mapconcat 'identity (cdr color) ", ") |
518 (car color))) | 518 (car color)))) |
519 (indent-to (max (- (window-width) 8) 44)) | |
520 (insert (apply 'format " #%02x%02x%02x" | |
521 (mapcar (lambda (c) (lsh c -8)) | |
522 (color-values (car color))))) | |
523 | |
524 (insert "\n")) | |
525 (point) | 519 (point) |
526 'face (cons 'foreground-color (car color)))) | 520 'face (cons 'foreground-color (car color))) |
521 (indent-to (max (- (window-width) 8) 44)) | |
522 (insert (apply 'format "#%02x%02x%02x" | |
523 (mapcar (lambda (c) (lsh c -8)) | |
524 (color-values (car color))))) | |
525 | |
526 (insert "\n")) | |
527 (goto-char (point-min))) | 527 (goto-char (point-min))) |
528 | 528 |
529 (defun list-colors-duplicates (&optional list) | 529 (defun list-colors-duplicates (&optional list) |
530 "Return a list of colors with grouped duplicate colors. | 530 "Return a list of colors with grouped duplicate colors. |
531 If a color has no duplicates, then the element of the returned list | 531 If a color has no duplicates, then the element of the returned list |
537 a list of colors that the current display can handle." | 537 a list of colors that the current display can handle." |
538 (let* ((list (mapcar 'list (or list (defined-colors)))) | 538 (let* ((list (mapcar 'list (or list (defined-colors)))) |
539 (l list)) | 539 (l list)) |
540 (while (cdr l) | 540 (while (cdr l) |
541 (if (and (facemenu-color-equal (car (car l)) (car (car (cdr l)))) | 541 (if (and (facemenu-color-equal (car (car l)) (car (car (cdr l)))) |
542 (not (and (boundp 'w32-default-color-map) | 542 (not (if (boundp 'w32-default-color-map) |
543 (not (assoc (car (car l)) w32-default-color-map))))) | 543 (not (assoc (car (car l)) w32-default-color-map))))) |
544 (progn | 544 (progn |
545 (setcdr (car l) (cons (car (car (cdr l))) (cdr (car l)))) | 545 (setcdr (car l) (cons (car (car (cdr l))) (cdr (car l)))) |
546 (setcdr l (cdr (cdr l)))) | 546 (setcdr l (cdr (cdr l)))) |
547 (setq l (cdr l)))) | 547 (setq l (cdr l)))) |
548 list)) | 548 list)) |