annotate lisp/w3/w3-style.el @ 62:28a7c63c7e1e r19-16-pre6

Import from CVS: tag r19-16-pre6
author cvs
date Mon, 13 Aug 2007 08:59:13 +0200
parents 0293115a14e9
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1 ;;; w3-style.el --- Emacs-W3 binding style sheet mechanism
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Author: wmperry
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
3 ;; Created: 1997/01/17 14:27:39
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
4 ;; Version: 1.25
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Keywords: faces, 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
8 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;;
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
11 ;;; This file is part of GNU Emacs.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; You should have received a copy of the GNU General Public License
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
26 ;;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; A style sheet mechanism for emacs-w3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; This will eventually be able to under DSSSL[-lite] as well as the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; experimental W3C mechanism
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (require 'font)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (require 'w3-keyword)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (require 'cl)
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
38 (require 'css)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
42 (defun w3-handle-style (&optional plist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
43 (let ((url (or (plist-get plist 'href)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
44 (plist-get plist 'src)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
45 (plist-get plist 'uri)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
46 (media (intern (downcase (or (plist-get plist 'media) "all"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
47 (type (downcase (or (plist-get plist 'notation) "text/css")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (url-working-buffer " *style*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (stylesheet nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (defines nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (cur-sheet w3-current-stylesheet)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
52 (string (plist-get plist 'data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
53 (if (not (memq media (css-active-device-types)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
54 nil ; Not applicable to us!
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
55 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
56 (set-buffer (get-buffer-create url-working-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
57 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
58 (setq url-be-asynchronous nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
59 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
60 ((member type '("experimental" "arena" "w3c-style" "css" "text/css"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
61 (setq stylesheet (css-parse url string cur-sheet)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
62 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
63 (w3-warn 'html "Unknown stylesheet notation: %s" type))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
64 (setq w3-current-stylesheet stylesheet))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (defun w3-display-stylesheet (&optional sheet)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (if (not sheet) (setq sheet w3-current-stylesheet))
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
69 (css-display sheet))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (provide 'w3-style)