annotate lisp/hyperbole/hsys-w3.el @ 36:c53a95d3c46d r19-15b101

Import from CVS: tag r19-15b101
author cvs
date Mon, 13 Aug 2007 08:53:38 +0200
parents 376386a54a3c
children 131b0175ea99
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 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: hsys-w3.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Hyperbole support for Emacs W3 World-Wide Web (WWW) browsing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: comm, help, hypermedia
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; ORG: Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 7-Apr-94 at 17:17:39 by Bob Weiner
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 0
diff changeset
12 ;; LAST-MOD: 10-Mar-97 at 12:17:08 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; This module defines an implicit button type and associated action and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; help types. A press of the Action Key on a unified resource locator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; (URL) displays the referent for the URL. A press of the Help Key on a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; URL displays a history list of previously browsed WWW documents. Press
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; the Action Key on any item from the history list to display it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; This requires the Emacs W3 World-Wide-Web browser available from:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; ftp://cs.indiana.edu/pub/elisp/w3/.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; It assumes that you have set up to have w3 auto-loaded according to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; setup instructions included with W3. Specifically, `w3-fetch' should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; autoloaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;; Other required Elisp libraries
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 ;;; Requires that 'w3' or other web browser code that is called be available.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;; Public functions and types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defib www-url ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 "When not in a w3 buffer, follow any non-ftp url (link) at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 The variable, `action-key-url-function,' can be used to customize the url
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 browser that is used."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (if (not (eq major-mode 'w3-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (let ((link-and-pos (hpath:www-at-p t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (if link-and-pos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (progn (ibut:label-set link-and-pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (hact 'www-url (car link-and-pos)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (defact www-url (url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 "Follows a link given by URL.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 The variable, `action-key-url-function,' can be used to customize the url
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 browser that is used."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (interactive "sURL to follow: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (or (stringp url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (error "(www-url): Link label must be given as a string."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (and (symbolp action-key-url-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (memq action-key-url-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 '(highlight-headers-follow-url-netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 highlight-headers-follow-url-mosaic))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (require 'highlight-headers))
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 0
diff changeset
69 (if window-system
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 0
diff changeset
70 (funcall action-key-url-function url)
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 0
diff changeset
71 (w3-fetch url)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (defun www-url:help (&optional but)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 "Displays history list of www nodes previously visited with the W3 browser."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (if (fboundp 'w3-show-history-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (hact 'w3-show-history-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (hact 'error "(www-url:help): W3 must be loaded to display WWW history")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (provide 'hsys-w3)