Initial Commit
[packages] / xemacs-packages / hyperbole / hsys-wais.el
1 ;;; hsys-wais.el --- Hyperbole support for WAIS browsing.
2
3 ;; Copyright (C) 1991, 1995 Free Software Foundation, Inc.
4 ;; Developed with support from Motorola Inc.
5
6 ;; Author: Bob Weiner, Brown U.
7 ;; Maintainer: Mats Lidell <matsl@contactor.se>
8 ;; Keywords: comm, help, hypermedia
9
10 ;; This file is part of GNU Hyperbole.
11
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.
16
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.
21
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.
26
27 ;;; Commentary:
28 ;;
29 ;;   For information on WAIS, see ftp://ftp.wais.com:/pub/.
30 ;;   The freeware/ subdirectory there contains free source code to support
31 ;;   WAIS on most standard architectures.
32 ;;
33
34 ;;; Code:
35
36 ;;;
37 ;;; Other required Elisp libraries
38 ;;;
39
40 ;; Autoload wais.
41 (autoload 'wais              "wais" "Client-server full-text retrieval"  t)
42 (autoload 'waisd-mode        "wais" "Wide Area Information Services"     t)
43 (autoload 'wais-select-question "wais" "Select a new WAIS question."     t)
44 (autoload 'wais-create-question "wais" "Create a new WAIS question."     t)
45
46 ;;;
47 ;;; Public implicit button types
48 ;;;
49
50 (defib wais-smart ()
51   "Handles context-sensitive Smart Key in WAIS buffers."
52   (if (featurep 'wais)
53       (let ((b (buffer-name)))
54         (cond ((string-match ": Find Documents On\\|: Similar To" b)
55                (hact 'wais-smart 'wais-query))
56               ((equal "*Source List*" b)
57                (hact 'wais-smart 'source-menu-view))
58               ((string-match ": On Sources" b)
59                (hact 'wais-smart
60                      (if (eobp) 'wais-view-source 'source-menu-view)))
61               ((string-match ": Results" b)
62                (hact 'wais-smart 'wais-edit))
63               ))))
64
65 ;;;
66 ;;; Public button action types
67 ;;;
68
69 (defact wais-ques (question-name)
70   "Loads a Wais Question QUESTION-NAME, displays it with WAIS Emacs interface."
71   (interactive "sWAIS Question name: ")
72   (if (or (featurep 'wais) (load "wais"))
73       (progn
74         (display-question question-name)
75         (wais)
76         (display-question question-name)
77         )
78     (error "(wais-ques): WAIS interface not available so can't load question.")
79     ))
80
81 (defact wais-smart (interactive-func)
82   "Performs INTERACTIVE-FUNC in a Wais buffer."
83   (call-interactively interactive-func))
84
85 (provide 'hsys-wais)
86
87 ;;; hsys-wais.el ends here