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