Mercurial > hg > xemacs-beta
comparison lisp/w3/w3.el @ 173:8eaf7971accc r20-3b13
Import from CVS: tag r20-3b13
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:49:09 +0200 |
parents | 15872534500d |
children | 3d6bfa290dbd |
comparison
equal
deleted
inserted
replaced
172:a38aed19690b | 173:8eaf7971accc |
---|---|
1 ;;; w3.el --- Main functions for emacs-w3 on all platforms/versions | 1 ;;; w3.el --- Main functions for emacs-w3 on all platforms/versions |
2 ;; Author: wmperry | 2 ;; Author: wmperry |
3 ;; Created: 1997/06/30 05:29:38 | 3 ;; Created: 1997/07/10 23:41:29 |
4 ;; Version: 1.134 | 4 ;; Version: 1.139 |
5 ;; Keywords: faces, help, comm, news, mail, processes, mouse, hypermedia | 5 ;; Keywords: faces, help, comm, news, mail, processes, mouse, hypermedia |
6 | 6 |
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
8 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu) | 8 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu) |
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. | 9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. |
797 (interactive) | 797 (interactive) |
798 (setq w3-setup-done nil | 798 (setq w3-setup-done nil |
799 url-setup-done nil | 799 url-setup-done nil |
800 w3-hotlist nil | 800 w3-hotlist nil |
801 url-mime-accept-string nil) | 801 url-mime-accept-string nil) |
802 (let ((x '(w3 mule-sysdp w3-e19 mm url w3-xemac w3-toolbar font))) | 802 (let ((x '(w3 base64 css mule-sysdp w3-e19 mm url w3-xemac |
803 w3-e20 dsssl dsssl-flow font images ssl url-auth | |
804 url-cache url-cookie url-file url-gopher url-gw | |
805 url-http url-mail url-misc url-news url-ns url-parse | |
806 url-vars w3-about w3-cus w3-display w3-e20 w3-elisp | |
807 w3-emulate w3-forms w3-hot w3-imap w3-jscript | |
808 w3-keyword w3-latex w3-menu w3-mouse w3-parse | |
809 w3-prefs w3-print w3-props w3-script w3-speak w3-style | |
810 w3-sysdp w3-toolbar w3-vars w3-widget w3-xemac w3 | |
811 w3-toolbar font))) | |
803 (while x | 812 (while x |
804 (setq features (delq (car x) features) | 813 (setq features (delq (car x) features) |
805 x (cdr x))) | 814 x (cdr x))) |
806 (require 'w3)) | 815 (require 'w3)) |
807 (w3-do-setup) | 816 (mapatoms (function |
808 (url-do-setup) | 817 (lambda (sym) |
809 ) | 818 (if (or (string-match "^w3-" (symbol-name sym)) |
819 (string-match "^url-" (symbol-name sym)) | |
820 (string-match "^ssl-" (symbol-name sym)) | |
821 (string-match "^base64-" (symbol-name sym)) | |
822 (string-match "^dsssl-" (symbol-name sym)) | |
823 (string-match "^mm-" (symbol-name sym))) | |
824 (progn | |
825 (fmakunbound sym) | |
826 (makunbound sym)))))) | |
827 (require 'w3)) | |
810 | 828 |
811 (defun w3-source-document-at-point () | 829 (defun w3-source-document-at-point () |
812 "View source to the document pointed at by link under point" | 830 "View source to the document pointed at by link under point" |
813 (interactive) | 831 (interactive) |
814 (w3-source-document t)) | 832 (w3-source-document t)) |
1563 (if base | 1581 (if base |
1564 (setq base (url-generic-parse-url base))) | 1582 (setq base (url-generic-parse-url base))) |
1565 (insert-buffer buffer) | 1583 (insert-buffer buffer) |
1566 (let ((inhibit-read-only t)) | 1584 (let ((inhibit-read-only t)) |
1567 (set-text-properties (point-min) (point-max) nil)) | 1585 (set-text-properties (point-min) (point-max) nil)) |
1568 (if (not base) | 1586 (cond |
1569 (setq url-current-object | 1587 (base |
1570 (url-generic-parse-url (concat "file:" | 1588 (setq url-current-object base)) |
1571 (buffer-file-name buffer)))) | 1589 ((buffer-file-name buffer) |
1572 (setq url-current-object base)))) | 1590 (setq url-current-object |
1591 (url-generic-parse-url (concat "file:" | |
1592 (buffer-file-name buffer))))) | |
1593 (t | |
1594 (setq url-current-object | |
1595 (url-generic-parse-url "file:/") | |
1596 url-current-mime-type "text/html"))))) | |
1573 | 1597 |
1574 (defun w3-internal-url (url) | 1598 (defun w3-internal-url (url) |
1575 ;; Handle internal urls (previewed buffers, etc) | 1599 ;; Handle internal urls (previewed buffers, etc) |
1576 (if (not (string-match "www:/+\\([^/]+\\)/\\(.*\\)" url)) | 1600 (if (not (string-match "www:/+\\([^/]+\\)/\\(.*\\)" url)) |
1577 (w3-fetch "www://error/") | 1601 (w3-fetch "www://error/") |
1969 "be wrong, and most colors and fonts will not be set up correctly.\n" | 1993 "be wrong, and most colors and fonts will not be set up correctly.\n" |
1970 "------\n" | 1994 "------\n" |
1971 (mapconcat 'identity remember "\n") | 1995 (mapconcat 'identity remember "\n") |
1972 "------"))))) | 1996 "------"))))) |
1973 | 1997 |
1998 (defvar w3-widget-global-map nil) | |
1999 | |
1974 ;;;###autoload | 2000 ;;;###autoload |
1975 (defun w3-do-setup () | 2001 (defun w3-do-setup () |
1976 "Do setup - this is to avoid conflict with user settings when W3 is | 2002 "Do setup - this is to avoid conflict with user settings when W3 is |
1977 dumped with emacs." | 2003 dumped with emacs." |
1978 (url-do-setup) | 2004 (url-do-setup) |
2060 ; the standard WWW_HOME, then default to the documentation @ IU | 2086 ; the standard WWW_HOME, then default to the documentation @ IU |
2061 (or w3-default-homepage | 2087 (or w3-default-homepage |
2062 (setq w3-default-homepage | 2088 (setq w3-default-homepage |
2063 (or (getenv "WWW_HOME") | 2089 (or (getenv "WWW_HOME") |
2064 "http://www.cs.indiana.edu/elisp/w3/docs.html"))) | 2090 "http://www.cs.indiana.edu/elisp/w3/docs.html"))) |
2065 | |
2066 ; Set up the entity definition for PGP and PEM authentication | |
2067 | 2091 |
2068 (run-hooks 'w3-load-hook)) | 2092 (run-hooks 'w3-load-hook)) |
2069 | 2093 |
2070 (defun w3-mark-link-as-followed (ext dat) | 2094 (defun w3-mark-link-as-followed (ext dat) |
2071 ;; Mark a link as followed | 2095 ;; Mark a link as followed |
2235 (setq choice (cdr (assoc match links-alist)))) | 2259 (setq choice (cdr (assoc match links-alist)))) |
2236 (t (setq choice nil))) | 2260 (t (setq choice nil))) |
2237 (if choice | 2261 (if choice |
2238 (w3-fetch choice))))) | 2262 (w3-fetch choice))))) |
2239 | 2263 |
2264 (defun w3-display-errors () | |
2265 "Display any HTML errors for the current page." | |
2266 (interactive) | |
2267 (let ((w3-notify 'friendly) | |
2268 (inhibit-read-only t) | |
2269 (buffer nil) | |
2270 (todo w3-current-badhtml) | |
2271 (url (url-view-url t))) | |
2272 (if (not todo) | |
2273 (error "No HTML errors on this page! Amazing, isn't it?")) | |
2274 (save-excursion | |
2275 (set-buffer | |
2276 (get-buffer-create (concat "HTML Errors for: " (or url "???")))) | |
2277 (setq buffer (current-buffer)) | |
2278 (erase-buffer) | |
2279 (while todo | |
2280 (goto-char (point-min)) | |
2281 (insert "\n" (car todo)) | |
2282 (setq todo (cdr todo)))) | |
2283 (w3-notify-when-ready buffer))) | |
2284 | |
2240 (defun w3-mode () | 2285 (defun w3-mode () |
2241 "Mode for viewing HTML documents. If called interactively, will | 2286 "Mode for viewing HTML documents. If called interactively, will |
2242 display the current buffer as HTML. | 2287 display the current buffer as HTML. |
2243 | 2288 |
2244 Current keymap is: | 2289 Current keymap is: |
2259 (w3-menu-install-menus) | 2304 (w3-menu-install-menus) |
2260 (setq url-current-passwd-count 0 | 2305 (setq url-current-passwd-count 0 |
2261 truncate-lines t | 2306 truncate-lines t |
2262 mode-line-format w3-modeline-format) | 2307 mode-line-format w3-modeline-format) |
2263 (run-hooks 'w3-mode-hook) | 2308 (run-hooks 'w3-mode-hook) |
2264 ;; Avoid calling the global bindings for RET and mouse-2. | 2309 (widget-setup)))) |
2265 (make-local-variable 'widget-global-map) | |
2266 (setq widget-global-map (make-sparse-keymap)) | |
2267 (widget-setup) | |
2268 (if w3-current-isindex | |
2269 (setq mode-line-process "-Searchable"))))) | |
2270 | 2310 |
2271 (require 'mm) | 2311 (require 'mm) |
2272 (require 'url) | 2312 (require 'url) |
2273 (require 'w3-parse) | 2313 (require 'w3-parse) |
2274 (require 'w3-display) | 2314 (require 'w3-display) |