home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / w3 / w3-style.el < prev    next >
Encoding:
Text File  |  1995-08-29  |  17.4 KB  |  518 lines

  1. ;;; w3-style.el,v --- Emacs-W3 binding style sheet mechanism
  2. ;; Author: wmperry
  3. ;; Created: 1995/08/27 01:10:25
  4. ;; Version: 1.37
  5. ;; Keywords: faces, hypermedia
  6.  
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8. ;;; Copyright (c) 1993, 1994, 1995 by William M. Perry (wmperry@spry.com)
  9. ;;;
  10. ;;; This file is not part of GNU Emacs, but the same permissions apply.
  11. ;;;
  12. ;;; GNU Emacs is free software; you can redistribute it and/or modify
  13. ;;; it under the terms of the GNU General Public License as published by
  14. ;;; the Free Software Foundation; either version 2, or (at your option)
  15. ;;; any later version.
  16. ;;;
  17. ;;; GNU Emacs is distributed in the hope that it will be useful,
  18. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. ;;; GNU General Public License for more details.
  21. ;;;
  22. ;;; You should have received a copy of the GNU General Public License
  23. ;;; along with GNU Emacs; see the file COPYING.  If not, write to
  24. ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26.  
  27. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  28. ;;; A style sheet mechanism for emacs-w3
  29. ;;;
  30. ;;; This will eventually be able to under DSSSL[-lite] as well as the
  31. ;;; experimental W3C mechanism
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33.  
  34. (defun w3-blend-colors (start end percentage)
  35.   (interactive "sStart Color:
  36. sEnd Color:
  37. nPercentage: ")
  38.   (setq percentage (max 0 (min percentage 100)))
  39.   (let* ((vals    (w3-color-rgb-components start))
  40.      (red-1   (nth 0 vals))
  41.      (green-1 (nth 1 vals))
  42.      (blue-1  (nth 2 vals))
  43.      (new     (w3-color-rgb-components end))
  44.      (red-2   (abs (/ (* percentage (- red-1   (nth 0 new))) 100)))
  45.      (green-2 (abs (/ (* percentage (- green-1 (nth 1 new))) 100)))
  46.      (blue-2  (abs (/ (* percentage (- blue-1  (nth 2 new))) 100))))
  47.     (format "#%04x%04x%04x"
  48.         (abs (- red-1 red-2))
  49.         (abs (- green-1 green-2))
  50.         (abs (- blue-1 blue-2)))))
  51.  
  52. (defun w3-percentage-from-date (date-1 date-2 length)
  53.   "Return the percentage of LENGTH that has elapsed between DATE-1 and DATE-2
  54. DATE-1 and DATE-2 are lists as returned by `current-time'
  55. LENGTH is in days"
  56.   (let ((secsbetween (+ (lsh (abs (- (nth 0 date-1) (nth 0 date-2))) 16)
  57.             (abs (- (nth 1 date-1) (nth 1 date-2)))))
  58.     (lengthinsecs (* length 24 60 60)))
  59.     (round (* (/ (float secsbetween) (max lengthinsecs 1)) 100))))
  60.  
  61. (defun w3-parse-dssl-lite (fname &optional string)
  62.   (let ((dest-buf (current-buffer))
  63.     (url-mime-accept-string
  64.      "Accept: application/stylesheet ; notation=dsssl-lite")
  65.     (sheet nil))
  66.     (save-excursion
  67.       (set-buffer (get-buffer-create
  68.            (url-generate-new-buffer-name " *style*")))
  69.       (erase-buffer)
  70.       (if fname (url-insert-file-contents fname))
  71.       (goto-char (point-max))
  72.       (if string (insert string))
  73.       (goto-char (point-min))
  74.       (delete-matching-lines "^[ \t]*#") ; Nuke comments
  75.       (delete-matching-lines "^[ \t\r]*$") ; Nuke blank lines
  76.       (goto-char (point-min))
  77.       (insert "(")
  78.       (goto-char (point-max))
  79.       (insert ")")
  80.       (goto-char (point-min))
  81.       (setq sheet (condition-case ()
  82.               (read (current-buffer))
  83.             (error nil)))
  84.       ;; Now need to convert the DSSSL-lite flow objects
  85.       ;; into our internal representation
  86.       ;; WORK WORK WORK!
  87.       )))
  88.  
  89. (if (not (fboundp 'string-to-number))
  90.     (fset 'string-to-number 'string-to-int))
  91.  
  92. (defun w3-spatial-to-canonical (spec)
  93.   "Convert SPEC (in inches, millimeters, points, or picas) into pixels"
  94.   (let ((num nil)
  95.     (type nil)
  96.     (dim1 (+ 25 (/ (float 4) 10)))
  97.     (dim2 (float 72))
  98.     (retval nil))
  99.     (if (string-match "[^0-9.]+$" spec)
  100.     (setq type (substring spec (match-beginning 0))
  101.           spec (substring spec 0 (match-beginning 0)))
  102.       (setq type "px"
  103.         spec spec))
  104.     (setq num (string-to-number spec))
  105.     (cond
  106.      ((member type '("pixel" "px" "pix"))
  107.       (setq retval num
  108.         num nil))
  109.      ((member type '("point" "pt"))
  110.       (setq num num))
  111.      ((member type '("inch" "in"))
  112.       (setq num (/ num dim2)))
  113.      ((string= type "mm")
  114.       (setq num (* num (/ dim1 dim2))))
  115.      ((string= type "cm")
  116.       (setq num (* num (/ dim1 dim2))))
  117.      )
  118.     (if (not retval)
  119.     (setq retval (* 10 num)))
  120.     retval))
  121.  
  122. (defun w3-lookup-rgb-components (color)
  123.   "Lookup COLOR (a color name) in rgb.txt and return a list of RGB values.
  124. The list (R G B) is returned, or an error is signaled if the lookup fails."
  125.   (let ((lib-list (if (boundp 'x-library-search-path)
  126.               x-library-search-path
  127.             ;; This default is from XEmacs 19.13 - hope it covers
  128.             ;; everyone.
  129.             (list "/usr/X11R6/lib/X11/"
  130.               "/usr/X11R5/lib/X11/"
  131.               "/usr/lib/X11R6/X11/"
  132.               "/usr/lib/X11R5/X11/"
  133.               "/usr/local/X11R6/lib/X11/"
  134.               "/usr/local/X11R5/lib/X11/"
  135.               "/usr/local/lib/X11R6/X11/"
  136.               "/usr/local/lib/X11R5/X11/"
  137.               "/usr/X11/lib/X11/"
  138.               "/usr/lib/X11/"
  139.               "/usr/local/lib/X11/"
  140.               "/usr/X386/lib/X11/"
  141.               "/usr/x386/lib/X11/"
  142.               "/usr/XFree86/lib/X11/"
  143.               "/usr/unsupported/lib/X11/"
  144.               "/usr/athena/lib/X11/"
  145.               "/usr/local/x11r5/lib/X11/"
  146.               "/usr/lpp/Xamples/lib/X11/"
  147.               "/usr/openwin/lib/X11/"
  148.               "/usr/openwin/share/lib/X11/")))
  149.     file r g b)
  150.     (while lib-list
  151.       (setq file (expand-file-name "rgb.txt" (car lib-list)))
  152.       (if (file-readable-p file)
  153.       (setq lib-list nil)
  154.     (setq lib-list (cdr lib-list)
  155.           file nil)))
  156.     (if (null file)
  157.     (error "w3-lookup-rgb-components: Can't find rgb.txt file.")
  158.       (save-excursion
  159.     (set-buffer (find-file-noselect file))
  160.     (save-excursion
  161.       (save-restriction
  162.         (widen)
  163.         (goto-char (point-min))
  164.         (if (re-search-forward (format "\t%s$" (regexp-quote color)) nil t)
  165.         (progn
  166.           (beginning-of-line)
  167.           (setq r (* (read (current-buffer)) 256)
  168.             g (* (read (current-buffer)) 256)
  169.             b (* (read (current-buffer)) 256)))
  170.           (message "No such color: %s" color)
  171.           (w3-warn 'html (format "No such color: %s" color))
  172.           (setq r 0
  173.             g 0
  174.             b 0))
  175.         (list r g b) ))))))
  176.  
  177. (defun w3-hex-string-to-number (string)
  178.   "Convert STRING to an integer by parsing it as a hexadecimal number."
  179.   (let ((conv-list '((?0 . 0) (?a . 10) (?A . 10)
  180.              (?1 . 1) (?b . 11) (?B . 11)
  181.              (?2 . 2) (?c . 12) (?C . 12)
  182.              (?3 . 3) (?d . 13) (?D . 13)
  183.              (?4 . 4) (?e . 14) (?E . 14)
  184.              (?5 . 5) (?f . 15) (?F . 15)
  185.              (?6 . 6) 
  186.              (?7 . 7)
  187.              (?8 . 8)
  188.              (?9 . 9)))
  189.     (n 0)
  190.     (i 0)
  191.     (lim (length string)))
  192.     (while (< i lim)
  193.       (setq n (+ (* n 16) (or (cdr (assq (aref string i) conv-list)) 0))
  194.         i (1+ i)))
  195.     n ))
  196.  
  197. (defun w3-parse-rgb-components (color)
  198.   "Parse RGB color specification and return a list of integers (R G B).
  199. #FEFEFE and rgb:fe/fe/fe style specifications are parsed."
  200.   (let ((case-fold-search t)
  201.     r g b str)
  202.   (cond ((string-match "^#[0-9a-f]+$" color)
  203.      (cond
  204.       ((= (length color) 4)
  205.        (setq r (w3-hex-string-to-number (substring color 1 2))
  206.          g (w3-hex-string-to-number (substring color 2 3))
  207.          b (w3-hex-string-to-number (substring color 3 4))
  208.          r (* r 4096)
  209.          g (* g 4096)
  210.          b (* b 4096)))
  211.       ((= (length color) 7)
  212.        (setq r (w3-hex-string-to-number (substring color 1 3))
  213.          g (w3-hex-string-to-number (substring color 3 5))
  214.          b (w3-hex-string-to-number (substring color 5 7))
  215.          r (* r 256)
  216.          g (* g 256)
  217.          b (* b 256)))
  218.       ((= (length color) 10)
  219.        (setq r (w3-hex-string-to-number (substring color 1 4))
  220.          g (w3-hex-string-to-number (substring color 4 7))
  221.          b (w3-hex-string-to-number (substring color 7 10))
  222.          r (* r 16)
  223.          g (* g 16)
  224.          b (* b 16)))
  225.       ((= (length color) 13)
  226.        (setq r (w3-hex-string-to-number (substring color 1 5))
  227.          g (w3-hex-string-to-number (substring color 5 9))
  228.          b (w3-hex-string-to-number (substring color 9 13))))
  229.       (t (error "Invalid RGB color specification: %s" color))))
  230.     ((string-match "rgb:\\([0-9a-f]+\\)/\\([0-9a-f]+\\)/\\([0-9a-f]+\\)"
  231.                color)
  232.      (if (or (> (- (match-end 1) (match-beginning 1)) 4)
  233.          (> (- (match-end 2) (match-beginning 2)) 4)
  234.          (> (- (match-end 3) (match-beginning 3)) 4))
  235.          (error "Invalid RGB color specification: %s" color)
  236.        (setq str (match-string 1 color)
  237.          r (* (w3-hex-string-to-number str)
  238.               (expt 16 (- 4 (length str))))
  239.          str (match-string 2 color)
  240.          g (* (w3-hex-string-to-number str)
  241.               (expt 16 (- 4 (length str))))
  242.          str (match-string 3 color)
  243.          b (* (w3-hex-string-to-number str)
  244.               (expt 16 (- 4 (length str)))))))
  245.     (t
  246.      (w3-warn 'html (format "Invalid RGB color specification: %s"
  247.                 color))
  248.      (setq r 0
  249.            g 0
  250.            b 0)))
  251.   (list r g b) ))
  252.  
  253. (defun w3-color-rgb-components (color)
  254.   "Return the RGB components of COLOR as a list of integers (R G B).
  255. 16-bit values are always returned.
  256. #FEFEFE and rgb:fe/fe/fe style color specifications are parsed directly
  257. into their components.
  258. RGB values for color names are looked up in the rgb.txt file.
  259. The variable x-library-search-path is use to locate the rgb.txt file."
  260.   (let ((case-fold-search t))
  261.     (cond
  262.      ((or (string-match "^#" color)
  263.       (string-match "^rgb:" color))
  264.       (w3-parse-rgb-components color))
  265.      ((string-match "\\([0-9.]+\\)[ \t]\\([0-9.]+\\)[ \t]\\([0-9.]+\\)"
  266.             color)
  267.       (let ((r (string-to-number (url-match color 1)))
  268.         (g (string-to-number (url-match color 2)))
  269.         (b (string-to-number (url-match color 3))))
  270.     (if (floatp r)
  271.         (setq r (round (* 255 r))
  272.           g (round (* 255 g))
  273.           b (round (* 255 b))))
  274.     (w3-parse-rgb-components (format "#%02x%02x%02x" r g b))))
  275.      (t
  276.       (w3-lookup-rgb-components color)))))
  277.  
  278. (defun w3-normalize-color (color)
  279.   "Return an RGB tuple, given any form of input.  If an error occurs, black
  280. is returned."
  281.   (apply 'format "#%04x%04x%04x" (w3-color-rgb-components color)))
  282.  
  283.  
  284. (defun w3-parse-arena-style-sheet (fname &optional string)
  285.   (let ((dest-buf (current-buffer))
  286.     (url-mime-accept-string
  287.      (concat
  288.       "Accept: application/stylesheet ; notation=experimental\r\n"
  289.       "Accept: application/stylesheet ; notation=w3c-style"))
  290.     (save-pos nil)
  291.     (applies-to nil)        ; List of tags to apply style to
  292.     (attrs nil)            ; List of name/value pairs
  293.     (tag nil)
  294.     (att nil)
  295.     (val nil)
  296.     (sheet nil))
  297.     (save-excursion
  298.       (set-buffer (get-buffer-create
  299.            (url-generate-new-buffer-name " *style*")))
  300.       (erase-buffer)
  301.       (if fname (url-insert-file-contents fname))
  302.       (goto-char (point-max))
  303.       (if string (insert string))
  304.       (goto-char (point-min))
  305.       (delete-matching-lines "^[ \t]*#")   ; Nuke comments
  306.       (delete-matching-lines "^[ \t\r]*$") ; Nuke blank lines
  307.       (w3-replace-regexp "--.*$" "")       ; Nuke new style comments
  308.       (w3-replace-regexp "^[ \t\r]+" "")   ; Nuke whitespace at beg. of line
  309.       (w3-replace-regexp "[ \t\r]+$" "")   ; Nuke whitespace at end of line
  310.       (w3-replace-regexp "![ \t]*\\([^ \t\r\n]+\\).*" "; priority=\"\\1\"")
  311.       (goto-char (point-min))
  312.       (while (not (eobp))
  313.     (beginning-of-line)
  314.     (setq save-pos (point))
  315.     (skip-chars-forward "^:")
  316.     (downcase-region save-pos (point))
  317.     ;; Could use read(), but it would slurp in the ':' as well
  318.     (setq applies-to (url-split (buffer-substring save-pos (point))
  319.                     "[ \t\r\n,&]"))
  320.     (skip-chars-forward " \t:")
  321.     (setq save-pos (point))
  322.     (end-of-line)
  323.     (skip-chars-backward "\r")
  324.     (setq attrs (mm-parse-args save-pos (point) t))
  325.     (skip-chars-forward "\r\n")
  326.     (while applies-to
  327.       (setq tag (intern (downcase (car (car applies-to))))
  328.         applies-to (cdr applies-to))
  329.       (let ((loop attrs))
  330.         (while loop
  331.           (setq att (car (car loop))
  332.             val (cdr (car loop))
  333.             loop (cdr loop))
  334.           (cond
  335.            ((string= "align" att)
  336.         (setq val (intern val)))
  337.            ((or (string= "indent" att)
  338.             (string-match "^margin" att))
  339.         (setq val (string-to-int val)))
  340.            (t nil))
  341.           (let* ((node-1 (assoc tag sheet))
  342.              (node-2 (and node-1 (assoc att node-1)))
  343.              (node-3 (assoc (symbol-name tag) sheet))
  344.              (node-4 (and node-3 (assoc att node-3))))
  345.         (cond
  346.          ((not node-3)
  347.           (setq sheet (cons (cons (symbol-name tag)
  348.                       (list (cons att val))) sheet)))
  349.          ((not node-4)
  350.           (setcdr node-3 (cons (cons att val) (cdr node-3))))
  351.          (t
  352.           (setcdr node-4 val)))
  353.         (cond
  354.          ((not node-1)
  355.           (setq sheet (cons (cons tag (list (cons att val))) sheet)))
  356.          ((not node-2)
  357.           (setcdr node-1 (cons (cons att val) (cdr node-1))))
  358.          (t
  359.           (setcdr node-2 val))))))))
  360.       (set-buffer-modified-p nil)
  361.       (kill-buffer (current-buffer)))
  362.     sheet))
  363.  
  364. (if (and (not (fboundp 'find-face))
  365.      (fboundp 'face-list))
  366.     (defun find-face (face)
  367.       (car-safe (memq face (face-list)))))
  368.  
  369. (defun w3-create-x-font (family style size em)
  370.   (format
  371.    "-*-%s-%s-%s-*-*-*-%s-%s-*-*-*-iso8859-1"
  372.    family
  373.    (if (string-match "bold" style) "bold" "medium")
  374.    (if (string-match "italic" style) "i" "r")
  375.    (if (eq em 'pixels) size "*")
  376.    (if (eq em 'points) size "*")))
  377.  
  378. (defun w3-generate-stylesheet-faces (sheet)
  379.   (url-lazy-message "Applying style hints...")
  380.   (let ((todo (delq nil (mapcar
  381.              (function (lambda (x) (if (symbolp (car x)) x)))
  382.              sheet)))
  383.     (cur nil)
  384.     (node nil)
  385.     (fore nil)
  386.     (back nil)
  387.     (font nil)
  388.     (family nil)
  389.     (scale nil)
  390.     (var nil)
  391.     (locale (if (fboundp 'valid-specifier-locale-p) (current-buffer)))
  392.     (face-name nil))
  393.     (while todo
  394.       (setq cur (car todo)
  395.         todo (cdr todo)
  396.         var (cdr-safe (assoc (car cur) w3-all-faces))
  397.         node cur)
  398.       (if node
  399.       (progn
  400.         (setq fore (downcase (or (cdr-safe (assoc "color.text" node))
  401.                      (cdr-safe (assoc "text-color" node))
  402.                      (cdr-safe (assoc "font.color" node))
  403.                      (cdr-safe (assoc "font-color" node))
  404.                      "none"))
  405.           back (downcase (or (cdr-safe (assoc "color.background" node))
  406.                      (cdr-safe (assoc "text-background" node))
  407.                      (cdr-safe (assoc "font-background" node))
  408.                      (cdr-safe (assoc "font.background" node))
  409.                      "none"))
  410.           scale (or (cdr-safe (assoc "font.size" node))
  411.                 (cdr-safe (assoc "font-size" node)))
  412.           scale (cond
  413.              ((null scale) "none")
  414.              ((listp scale) (condition-case ()
  415.                         (int-to-string
  416.                          (eval (read
  417.                             (format "(%c 3 %s)"
  418.                                 (car scale)
  419.                                 (cdr scale)))))
  420.                       (error 3)))
  421.              ((stringp scale) (downcase scale)))
  422.           family (downcase (or (cdr-safe (assoc "font.family" node))
  423.                        (cdr-safe (assoc "font-family" node))
  424.                        "none"))
  425.           font (downcase (or (cdr-safe (assoc "font.style" node))
  426.                      (cdr-safe (assoc "font-style" node))
  427.                      "none"))
  428.           font (mapconcat (function (lambda (x)
  429.                           (cond
  430.                            ((= x ? ) "")
  431.                            ((= x ?,) "-")
  432.                            ((= x ?&) "-")
  433.                            (t (char-to-string x)))))
  434.                   font "")
  435.           font (mapconcat 'identity
  436.                   (sort (mapcar 'car (url-split font "-"))
  437.                     'string-lessp)
  438.                   "-")
  439.           face-name (intern (if (fboundp 'make-face-larger)
  440.                     (concat fore "/" back "/" font
  441.                         "/" scale)
  442.                       (concat fore "/" back "/" font))))
  443.         (cond
  444.          ((and (string= fore "none")
  445.            (string= back "none")
  446.            (string= scale "none")
  447.            (string= font "none"))
  448.           nil)            ; Do nothing - no style directives
  449.          ((find-face face-name)
  450.           (setcdr node (cons (cons "face" face-name) (cdr node)))
  451.           (let ((x (assoc (symbol-name (car node)) w3-current-stylesheet)))
  452.         (if x
  453.             (setcdr x (cons (cons "face" face-name) (cdr x)))))
  454.           (and var (set var face-name))) ; face already created
  455.          (t
  456.           (setcdr node (cons (cons "face" face-name) (cdr node)))
  457.           (let ((x (assoc (symbol-name (car node)) w3-current-stylesheet)))
  458.         (if x
  459.             (setcdr x (cons (cons "face" face-name) (cdr x)))))
  460.           (make-face face-name)
  461.           (and var (set var face-name))
  462.           (if (not (string= fore "none"))
  463.           (w3-munge-color-fore face-name (w3-normalize-color fore)))
  464.           (if (not (string= back "none"))
  465.           (w3-munge-color-back face-name (w3-normalize-color back)))
  466.           (if (and (not (string= scale "none"))
  467.                (fboundp 'make-face-larger))
  468.           (let ((size (1- (string-to-int scale))))
  469.             (mapcar (cond
  470.                  ((= size 0) 'identity)
  471.                  ((< size 0) 'make-face-smaller)
  472.                  ((> size 0) 'make-face-larger))
  473.                 (make-list (abs size) face-name))))
  474.           (if (string= font "none")
  475.           nil
  476.         (progn
  477.           (if (string-match "bold" font)
  478.               (condition-case ()
  479.               (make-face-bold face-name)
  480.             (error nil)))
  481.           (if (string-match "italic" font)
  482.               (condition-case ()
  483.               (make-face-italic face-name)
  484.             (error nil)))
  485.           (if (string-match "underline" font)
  486.               (apply 'set-face-underline-p face-name t))))))))))
  487.   (url-lazy-message "Applying style hints... done"))
  488.  
  489. (defun w3-handle-style (&optional args)
  490.   (let ((fname (or (cdr-safe (assoc "href" args))
  491.            (cdr-safe (assoc "src" args))
  492.            (cdr-safe (assoc "uri" args))))
  493.     (type (downcase (or (cdr-safe (assoc "notation" args))
  494.                 "experimental")))
  495.     (url-working-buffer " *style*")
  496.     (base (cdr-safe (assoc "base" args)))
  497.     (stylesheet nil)
  498.     (string (cdr-safe (assoc "data" args))))
  499.     (if fname (setq fname (url-expand-file-name fname
  500.                         (cdr-safe
  501.                          (assoc base w3-base-alist)))))
  502.     (save-excursion
  503.       (set-buffer (get-buffer-create url-working-buffer))
  504.       (erase-buffer)
  505.       (setq url-be-asynchronous nil)
  506.       (cond
  507.        ((member type '("experimental" "arena" "w3c-style"))
  508.     (setq stylesheet (w3-parse-arena-style-sheet fname string)))
  509.        ((string= type "dsssl-lite")
  510.     (setq stylesheet (w3-parse-dsssl-lite fname string)))
  511.        (t
  512.     (w3-warn 'html "Unknown stylesheet notation: %s" type))))
  513.     (setq w3-current-stylesheet stylesheet)
  514.     (if (and w3-current-stylesheet (fboundp 'make-face))
  515.     (w3-generate-stylesheet-faces w3-current-stylesheet))))
  516.  
  517. (provide 'w3-style)
  518.