diff lisp/minibuf.el @ 2527:491f8cf78a9c

[xemacs-hg @ 2005-01-28 02:58:38 by ben] Abstract font-list/color-list font-menu.el, font.el, frame.el, gtk-font-menu.el, minibuf.el, msw-faces.el, msw-font-menu.el, obsolete.el, x-faces.el, x-font-menu.el: list-fonts->font-list. Create color-list. Abstract out x/msw-specific versions and obsolete the x/msw-specific Lisp functions. console-impl.h, objects-gtk.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c: list-fonts->font-list. Create color-list. Abstract out x/msw-specific versions and obsolete the x/msw-specific Lisp functions.
author ben
date Fri, 28 Jan 2005 02:58:52 +0000
parents cb22c508fb00
children 139afe9fb2ee
line wrap: on
line diff
--- a/lisp/minibuf.el	Fri Jan 28 02:36:28 2005 +0000
+++ b/lisp/minibuf.el	Fri Jan 28 02:58:52 2005 +0000
@@ -2181,75 +2181,8 @@
   "Read the name of a face from the minibuffer and return it as a symbol."
   (intern (completing-read prompt obarray 'find-face must-match)))
 
-;; #### - wrong place for this variable?  Exactly.  We probably want
-;; `color-list' to be a console method, so `tty-color-list' becomes
-;; obsolete, and `read-color-completion-table' conses (mapcar #'list
-;; (color-list)), optionally caching the results.
-
-;; Ben wanted all of the possibilities from the `configure' script used
-;; here, but I think this is way too many.  I already trimmed the R4 variants
-;; and a few obvious losers from the list.  --Stig
-(defvar x-library-search-path '("/usr/X11R6/lib/X11/"
-				"/usr/X11R5/lib/X11/"
-				"/usr/lib/X11R6/X11/"
-				"/usr/lib/X11R5/X11/"
-				"/usr/local/X11R6/lib/X11/"
-				"/usr/local/X11R5/lib/X11/"
-				"/usr/local/lib/X11R6/X11/"
-				"/usr/local/lib/X11R5/X11/"
-				"/usr/X11/lib/X11/"
-				"/usr/lib/X11/"
-				"/usr/local/lib/X11/"
-				"/usr/X386/lib/X11/"
-				"/usr/x386/lib/X11/"
-				"/usr/XFree86/lib/X11/"
-				"/usr/unsupported/lib/X11/"
-				"/usr/athena/lib/X11/"
-				"/usr/local/x11r5/lib/X11/"
-				"/usr/lpp/Xamples/lib/X11/"
-				"/usr/openwin/lib/X11/"
-				"/usr/openwin/share/lib/X11/")
-  "Search path used by `read-color' to find rgb.txt.")
-
-(defvar x-read-color-completion-table)
-
 (defun read-color-completion-table ()
-  (case (device-type)
-    ;; #### Evil device-type dependency
-    ((x gtk)
-     (if (boundp 'x-read-color-completion-table)
-	 x-read-color-completion-table
-       (let ((rgb-file (locate-file "rgb.txt" x-library-search-path))
-	     clist color p)
-	 (if (not rgb-file)
-	     ;; prevents multiple searches for rgb.txt if we can't find it
-	     (setq x-read-color-completion-table nil)
-	   (with-current-buffer (get-buffer-create " *colors*")
-	     (reset-buffer (current-buffer))
-	     (insert-file-contents rgb-file)
-	     (while (not (eobp))
-	       ;; skip over comments
-	       (while (looking-at "^!")
-		 (end-of-line)
-		 (forward-char 1))
-	       (skip-chars-forward "0-9 \t")
-	       (setq p (point))
-	       (end-of-line)
-	       (setq color (buffer-substring p (point))
-		     clist (cons (list 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)))
-	       (forward-char 1))
-	     (kill-buffer (current-buffer))))
-	 (setq x-read-color-completion-table clist)
-	 x-read-color-completion-table)))
-    (mswindows
-     (mapcar #'list (declare-fboundp (mswindows-color-list))))
-    (tty
-     (mapcar #'list (declare-fboundp (tty-color-list))))))
+  (mapcar #'list (color-list)))
 
 (defun read-color (prompt &optional must-match initial-contents)
   "Read the name of a color from the minibuffer.