1 ;;; hsys-w3.el --- Hyperbole support for Emacs W3 World-Wide Web (WWW) browsing.
3 ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
4 ;; Developed with support from Motorola Inc.
6 ;; Author: Bob Weiner, Brown U.
7 ;; Maintainer: Mats Lidell <matsl@contactor.se>
8 ;; Keywords: comm, help, hypermedia
10 ;; This file is part of GNU Hyperbole.
12 ;; GNU Hyperbole is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 3, or (at
15 ;; your option) any later version.
17 ;; GNU Hyperbole is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
29 ;; This module defines an implicit button type and associated action and
30 ;; help types. A press of the Action Key on a unified resource locator
31 ;; (URL) displays the referent for the URL. A press of the Help Key on a
32 ;; URL displays a history list of previously browsed WWW documents. Press
33 ;; the Action Key on any item from the history list to display it.
35 ;; This requires the Emacs W3 World-Wide-Web browser available from:
36 ;; ftp://cs.indiana.edu/pub/elisp/w3/.
38 ;; It assumes that you have set up to have w3 auto-loaded according to the
39 ;; setup instructions included with W3. Specifically, `w3-fetch' should be
46 ;;; Other required Elisp libraries
49 ;;; Requires that 'w3' or other web browser code that is called be available.
52 ;;; Public functions and types
56 "When not in a w3 buffer, follow any non-ftp url (link) at point.
57 Customize `browse-url' for what browser that is used."
58 (if (not (eq major-mode 'w3-mode))
59 (let ((link-and-pos (hpath:www-at-p t)))
61 (progn (ibut:label-set link-and-pos)
62 (hact 'www-url (car link-and-pos)))))))
65 "Follows a link given by URL using `browse-url'."
66 (interactive "sURL to follow: ")
68 (error "(www-url): Link label must be given as a string."))
69 (funcall 'browse-url url))
71 (defun www-url:help (&optional but)
72 "Displays history list of www nodes previously visited with the W3 browser."
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")))
80 ;;; hsys-w3.el ends here