annotate lisp/w3/w3-e19.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children ac2d302a0011
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; w3-e19.el,v --- Emacs 19.xx specific functions for emacs-w3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Author: wmperry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Created: 1996/06/06 14:14:34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Version: 1.157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Keywords: faces, help, mouse, hypermedia
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; Copyright (c) 1993, 1994, 1995 by William M. Perry (wmperry@spry.com)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; along with GNU Emacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Enhancements For Emacs 19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (require 'w3-forms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (require 'font)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; Help menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defvar w3-links-menu nil "Menu for w3-mode in emacs 19.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (make-variable-buffer-local 'w3-links-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (defun w3-add-hotlist-menu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; Add the hotlist menu to this buffer - used when it changes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (let ((hot-menu (make-sparse-keymap "w3-hotlist"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (ctr 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (hot w3-hotlist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (while hot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (define-key hot-menu (vector (intern (concat "w3-hotlist-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (int-to-string ctr))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (cons (car (car hot))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (list 'lambda () '(interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (list 'w3-fetch (car (cdr (car hot)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (setq ctr (1+ ctr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 hot (cdr hot)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (setq w3-e19-hotlist-menu hot-menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;;; Functions to build menus of urls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (defun w3-e19-show-hotlist-menu (e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (if w3-html-bookmarks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (popup-menu w3-html-bookmarks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (let* ((x (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (x-popup-menu e w3-e19-hotlist-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (error nil))) ; to trap for empty menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (y (and x (lookup-key w3-e19-hotlist-menu (apply 'vector x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (if (and x y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (funcall y)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (defun w3-e19-show-links-menu (e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (if (not w3-e19-links-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (w3-build-FSF19-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (let* ((x (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (x-popup-menu e w3-e19-links-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (error nil))) ; to trap for empty menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (y (and x (lookup-key w3-e19-links-menu (apply 'vector x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (if (and x y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (funcall y))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defun w3-build-FSF19-menu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;; Build emacs19 menus from w3-links-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (let* ((ctr 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (menu-ctr 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (tmp nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (widgets (w3-only-links))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (widget nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (href nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (menus nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (setq tmp (make-sparse-keymap "Links"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (while widgets
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (setq widget (car widgets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 widgets (cdr widgets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 href (widget-get widget 'href))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (if (> ctr w3-max-menu-length)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (setq menus (cons tmp menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ctr 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 tmp (make-sparse-keymap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (concat "Links" (int-to-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (setq menu-ctr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (1+ menu-ctr)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (let ((ttl (w3-fix-spaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (widget-get widget :from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (widget-get widget :to))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (key (vector (intern (concat "link"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (int-to-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (setq ctr (1+ ctr))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (if (and (> (length ttl) 0) href)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (define-key tmp key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (cons ttl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (list 'lambda () '(interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (list 'w3-fetch href)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (if (not menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (setq w3-e19-links-menu tmp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (setq w3-e19-links-menu (make-sparse-keymap "LinkMenu")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 menus (nreverse (cons tmp menus))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ctr 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (while menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (define-key w3-e19-links-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (vector (intern (concat "SubMenu" ctr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (cons "More..." (car menus)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (setq menus (cdr menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ctr (1+ ctr))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (defun w3-setup-version-specifics ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; Set up routine for emacs 19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (require 'lmenu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (defun w3-store-in-clipboard (str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 "Store string STR in the Xwindows clipboard"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ((memq (device-type) '(x pm))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (x-select-text str))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ((eq (device-type) 'ns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (ns-store-pasteboard-internal str))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (defun w3-mode-version-specifics ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;; Emacs 19 specific stuff for w3-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (make-local-variable 'track-mouse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (if w3-track-mouse (setq track-mouse t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (if (or (memq (device-type) '(x pm ns)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (w3-build-FSF19-menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (defun w3-mouse-handler (e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 "Function to message the url under the mouse cursor"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (let* ((pt (posn-point (event-start e)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (good (eq (posn-window (event-start e)) (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (widget (and good pt (number-or-marker-p pt) (widget-at pt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (link (and widget (widget-get widget 'href)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (form (and widget (widget-get widget 'w3-form-data)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (imag nil) ; (nth 1 (memq 'w3graphic props))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (link (message "%s" link))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ((eq 'submit (w3-form-element-type form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (message "Submit form to %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (cdr-safe (assq 'action (w3-form-element-action form)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ((eq 'reset (w3-form-element-type form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (message "Reset form contents"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (message "Form entry (name=%s, type=%s)" (w3-form-element-name form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (w3-form-element-type form)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (imag (message "Inlined image (%s)" (car imag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (t (message "")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (defun w3-color-values (color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ((eq window-system 'x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (x-color-values color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ((eq window-system 'ns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (ns-color-values color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (defun w3-color-light-p (color-or-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (let (colors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ((null window-system)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ((facep color-or-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (setq color-or-face (face-background color-or-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (if (null color-or-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (setq color-or-face (cdr-safe
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (assq 'background-color (frame-parameters)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (setq colors (w3-color-values color-or-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ((stringp color-or-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (setq colors (w3-color-values color-or-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ((font-rgb-color-p color-or-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (setq colors (list (font-rgb-color-red color-or-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (font-rgb-color-green color-or-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (font-rgb-color-blue color-or-face))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (signal 'wrong-type-argument 'color-or-face-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (not (< (apply '+ colors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (/ (apply '+ (w3-color-values "white")) 3)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (provide 'w3-emacs19)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (provide 'w3-e19)