changeset 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 ae6b7b53a563
children 042ff1f24b23
files lisp/ChangeLog lisp/x-faces.el
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Oct 06 21:51:00 2007 +0000
+++ b/lisp/ChangeLog	Sun Oct 07 06:55:00 2007 +0000
@@ -1,3 +1,8 @@
+2007-10-06  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* x-faces.el (x-color-list-internal): Should return a list of
+	strings.  Make it so.
+
 2007-10-03  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* unicode.el (featurep):
--- a/lisp/x-faces.el	Sat Oct 06 21:51:00 2007 +0000
+++ b/lisp/x-faces.el	Sun Oct 07 06:55:00 2007 +0000
@@ -603,6 +603,15 @@
 
 (defvar x-color-list-internal-cache)
 
+;; Ben originally coded this in 2005/01 to return a list of lists each
+;; containing a single string.  This is apparently derived from use of
+;; this list in completion, but in fact `read-color-completion-table'
+;; already does this wrapping.  So I'm changing this to return a list of
+;; strings as the TTY code does, and as expected by r-c-c-t.
+;; -- sjt 2007-10-06
+
+;; This function is probably also used by the GTK platform.  Cf.
+;; gtk_color_list in src/objects-gtk.c.
 (defun x-color-list-internal ()
   (if (boundp 'x-color-list-internal-cache)
       x-color-list-internal-cache
@@ -623,12 +632,12 @@
 	    (setq p (point))
 	    (end-of-line)
 	    (setq color (buffer-substring p (point))
-		  clist (cons (list color) clist))
+		  clist (cons color clist))
 	    ;; Ugh.  If we want to be able to complete the lowercase form
 	    ;; of the color name, we need to add it twice!  Yuck.
 	    (let ((dcase (downcase color)))
 	      (or (string= dcase color)
-		  (push (list dcase) clist)))
+		  (push dcase clist)))
 	    (forward-char 1))
 	  (kill-buffer (current-buffer))))
       (setq x-color-list-internal-cache clist)