2
|
1 ;;; w3-style.el --- Emacs-W3 binding style sheet mechanism
|
0
|
2 ;; Author: wmperry
|
80
|
3 ;; Created: 1996/12/13 18:01:46
|
|
4 ;; Version: 1.23
|
0
|
5 ;; Keywords: faces, hypermedia
|
|
6
|
|
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2
|
8 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
|
80
|
9 ;;; Copyright (c) 1996 Free Software Foundation, Inc.
|
0
|
10 ;;;
|
80
|
11 ;;; This file is part of GNU Emacs.
|
0
|
12 ;;;
|
|
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
14 ;;; it under the terms of the GNU General Public License as published by
|
|
15 ;;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;;; any later version.
|
|
17 ;;;
|
|
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
|
|
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21 ;;; GNU General Public License for more details.
|
|
22 ;;;
|
|
23 ;;; You should have received a copy of the GNU General Public License
|
80
|
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 ;;; Boston, MA 02111-1307, USA.
|
0
|
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
28
|
|
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
30 ;;; A style sheet mechanism for emacs-w3
|
|
31 ;;;
|
|
32 ;;; This will eventually be able to under DSSSL[-lite] as well as the
|
|
33 ;;; experimental W3C mechanism
|
|
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
35 (require 'font)
|
|
36 (require 'w3-keyword)
|
|
37 (require 'cl)
|
80
|
38 (require 'css)
|
0
|
39
|
|
40
|
70
|
41
|
|
42 (defun w3-handle-style (&optional args)
|
|
43 (let ((fname (or (cdr-safe (assq 'href args))
|
|
44 (cdr-safe (assq 'src args))
|
|
45 (cdr-safe (assq 'uri args))))
|
|
46 (type (downcase (or (cdr-safe (assq 'notation args))
|
|
47 "experimental")))
|
0
|
48 (url-working-buffer " *style*")
|
70
|
49 (base (cdr-safe (assq 'base args)))
|
0
|
50 (stylesheet nil)
|
|
51 (defines nil)
|
|
52 (cur-sheet w3-current-stylesheet)
|
70
|
53 (string (cdr-safe (assq 'data args))))
|
|
54 (if fname (setq fname (url-expand-file-name fname
|
|
55 (cdr-safe
|
|
56 (assoc base w3-base-alist)))))
|
|
57 (save-excursion
|
|
58 (set-buffer (get-buffer-create url-working-buffer))
|
|
59 (erase-buffer)
|
|
60 (setq url-be-asynchronous nil)
|
|
61 (cond
|
80
|
62 ((member type '("experimental" "arena" "w3c-style" "css" "text/css"))
|
|
63 (setq stylesheet (css-parse fname string cur-sheet)))
|
70
|
64 (t
|
|
65 (w3-warn 'html "Unknown stylesheet notation: %s" type))))
|
|
66 (setq w3-current-stylesheet stylesheet)
|
80
|
67 )
|
|
68 )
|
0
|
69
|
|
70 (defun w3-display-stylesheet (&optional sheet)
|
|
71 (interactive)
|
|
72 (if (not sheet) (setq sheet w3-current-stylesheet))
|
80
|
73 (css-display sheet))
|
0
|
74
|
|
75 (provide 'w3-style)
|