aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-04-16 04:15:39 +0000
committerRichard M. Stallman1995-04-16 04:15:39 +0000
commit7c49006bee5f3774784fc25b020f341698e4b82e (patch)
tree9cb76a857f99259ff371c21c876b4e22dd3b53e7
parentd0672e0d73b87c39e8671265e9d0533b5434bbe1 (diff)
downloademacs-7c49006bee5f3774784fc25b020f341698e4b82e.tar.gz
emacs-7c49006bee5f3774784fc25b020f341698e4b82e.zip
(list-colors-display): Minor clarification.
(facemenu-special-menu): Add "Intangible" item. (facemenu-color-equal): Doc fix.
-rw-r--r--lisp/facemenu.el29
1 files changed, 17 insertions, 12 deletions
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 0f7dcd99c0f..d7f9964bd78 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -168,6 +168,7 @@ when they are created.")
168 (let ((map (make-sparse-keymap "Special"))) 168 (let ((map (make-sparse-keymap "Special")))
169 (define-key map [read-only] (cons "Read-Only" 'facemenu-set-read-only)) 169 (define-key map [read-only] (cons "Read-Only" 'facemenu-set-read-only))
170 (define-key map [invisible] (cons "Invisible" 'facemenu-set-invisible)) 170 (define-key map [invisible] (cons "Invisible" 'facemenu-set-invisible))
171 (define-key map [intangible] (cons "Intangible" 'facemenu-set-intangible))
171 map) 172 map)
172 "Menu keymap for non-face text-properties.") 173 "Menu keymap for non-face text-properties.")
173;;;###autoload 174;;;###autoload
@@ -391,17 +392,20 @@ This sets the `read-only' text property; it can be undone with
391 392
392;;;###autoload 393;;;###autoload
393(defun list-colors-display (&optional list) 394(defun list-colors-display (&optional list)
394 "Display colors. 395 "Display names of defined colors, and show what they look like.
395You can optionally supply a LIST of colors to display, or this function will 396If the optional argument LIST is non-nil, it should be a list of
396get a list for the current display, removing alternate names for the same 397colors to display. Otherwise, this command computes a list
397color." 398of colors that the current display can handle."
398 (interactive) 399 (interactive)
399 (if (and (null list) (eq 'x window-system)) 400 (if (and (null list) (eq 'x window-system))
400 (let ((l (setq list (x-defined-colors)))) 401 (progn
401 (while (cdr l) 402 (setq list (x-defined-colors))
402 (if (facemenu-color-equal (car l) (car (cdr l))) 403 ;; Delete duplicate colors.
403 (setcdr l (cdr (cdr l))) 404 (let ((l list))
404 (setq l (cdr l)))))) 405 (while (cdr l)
406 (if (facemenu-color-equal (car l) (car (cdr l)))
407 (setcdr l (cdr (cdr l)))
408 (setq l (cdr l)))))))
405 (with-output-to-temp-buffer "*Colors*" 409 (with-output-to-temp-buffer "*Colors*"
406 (save-excursion 410 (save-excursion
407 (set-buffer standard-output) 411 (set-buffer standard-output)
@@ -423,9 +427,10 @@ color."
423 427
424(defun facemenu-color-equal (a b) 428(defun facemenu-color-equal (a b)
425 "Return t if colors A and B are the same color. 429 "Return t if colors A and B are the same color.
426A and B should be strings naming colors. The window-system server is queried 430A and B should be strings naming colors.
427to find how they would actually be displayed. Nil is always returned if the 431This function queries the window-system server to find out what the
428correct answer cannot be determined." 432color names mean. It returns nil if the colors differ or if it can't
433determine the correct answer."
429 (cond ((equal a b) t) 434 (cond ((equal a b) t)
430 ((and (eq 'x window-system) 435 ((and (eq 'x window-system)
431 (equal (x-color-values a) (x-color-values b)))))) 436 (equal (x-color-values a) (x-color-values b))))))