comparison lisp/x-faces.el @ 4215:de99c4dbad18

[xemacs-hg @ 2007-10-07 06:54:59 by stephent] Fix list-colors-display bug on X11. <87bqbb2z4c.fsf@uwakimon.sk.tsukuba.ac.jp>
author stephent
date Sun, 07 Oct 2007 06:55:00 +0000
parents 4f2243a0dc04
children 49480d838d32
comparison
equal deleted inserted replaced
4214:ae6b7b53a563 4215:de99c4dbad18
601 "/usr/openwin/share/lib/X11/") 601 "/usr/openwin/share/lib/X11/")
602 "Search path used by `x-color-list-internal' to find rgb.txt.") 602 "Search path used by `x-color-list-internal' to find rgb.txt.")
603 603
604 (defvar x-color-list-internal-cache) 604 (defvar x-color-list-internal-cache)
605 605
606 ;; Ben originally coded this in 2005/01 to return a list of lists each
607 ;; containing a single string. This is apparently derived from use of
608 ;; this list in completion, but in fact `read-color-completion-table'
609 ;; already does this wrapping. So I'm changing this to return a list of
610 ;; strings as the TTY code does, and as expected by r-c-c-t.
611 ;; -- sjt 2007-10-06
612
613 ;; This function is probably also used by the GTK platform. Cf.
614 ;; gtk_color_list in src/objects-gtk.c.
606 (defun x-color-list-internal () 615 (defun x-color-list-internal ()
607 (if (boundp 'x-color-list-internal-cache) 616 (if (boundp 'x-color-list-internal-cache)
608 x-color-list-internal-cache 617 x-color-list-internal-cache
609 (let ((rgb-file (locate-file "rgb.txt" x-library-search-path)) 618 (let ((rgb-file (locate-file "rgb.txt" x-library-search-path))
610 clist color p) 619 clist color p)
621 (forward-char 1)) 630 (forward-char 1))
622 (skip-chars-forward "0-9 \t") 631 (skip-chars-forward "0-9 \t")
623 (setq p (point)) 632 (setq p (point))
624 (end-of-line) 633 (end-of-line)
625 (setq color (buffer-substring p (point)) 634 (setq color (buffer-substring p (point))
626 clist (cons (list color) clist)) 635 clist (cons color clist))
627 ;; Ugh. If we want to be able to complete the lowercase form 636 ;; Ugh. If we want to be able to complete the lowercase form
628 ;; of the color name, we need to add it twice! Yuck. 637 ;; of the color name, we need to add it twice! Yuck.
629 (let ((dcase (downcase color))) 638 (let ((dcase (downcase color)))
630 (or (string= dcase color) 639 (or (string= dcase color)
631 (push (list dcase) clist))) 640 (push dcase clist)))
632 (forward-char 1)) 641 (forward-char 1))
633 (kill-buffer (current-buffer)))) 642 (kill-buffer (current-buffer))))
634 (setq x-color-list-internal-cache clist) 643 (setq x-color-list-internal-cache clist)
635 x-color-list-internal-cache))) 644 x-color-list-internal-cache)))
636 645