Initial Commit
[packages] / xemacs-packages / hyperbole / hsite-ex.el
1 ;;; hsite-ex.el --- Site-specific setup for Hyperbole
2
3 ;; Copyright (C) 1991-1995, 2004, 2006 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: hypermedia, local
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 ;;   See the "README" file for installation instructions.
30 ;;
31 ;;   "hsite.el" may be byte-compiled if you like but normally it is not.
32 ;;
33 ;;   Be sure to have users load any personal mail/news initializations
34 ;;   before they load this file if any of Hyperbole's mail or news
35 ;;   support features are enabled either herein or within their personal
36 ;;   Hyperbole initializations.  Otherwise, the mail/news support may
37 ;;   not be configured properly.
38 ;;
39
40 ;;; Code:
41
42 ;;; 
43 ;;; Read the comments and modify as desired.
44 ;;; 
45
46 (message "Initializing Hyperbole, please wait...")
47
48 ;;;
49 ;;; SMART SETTINGS
50 ;;;
51
52 (defvar hkey-always-display-menu nil
53   "*Non-nil means always display the Smart Menu window when the Action or Assist Key is pressed and the Smart Menu system has been loaded.
54 If a Smart Menu is already displayed, perform another Action or Assist Key
55 function.")
56
57 (defcustom smart-scroll-proportional t
58   "*Non-nil means Smart Keys should scroll relative to current line when pressed at the end of a line.
59 Action Key moves current line to top of window.  Assist Key moves current
60 line to bottom of window.  Repeated presses then scroll up or down a
61 windowful.  Nil value instead ignores current line and always scrolls up or
62 down a windowful."
63   :group 'hyperbole
64   :type 'boolean
65   :link '(custom-manual "(hyperbole)Glossary"))
66
67 ;;;
68 ;;; HYPERBOLE DIRECTORY SETTING
69 ;;;
70
71 (require 'hyperbole)
72
73 ;;;
74 ;;; INTERNET SETTINGS
75 ;;;
76
77 ;; String to be used in the call: (hpath:rfc rfc-num) to create an ange-ftp
78 ;; path to the RFC document for 'rfc-num'.  Uncomment and alter this setting
79 ;; if another site is closer for you.
80 ;; (setq hpath:rfc "/anonymous@ds.internic.net:rfc/rfc%s.txt")
81
82 ;; When a user creates an explicit button, Hyperbole tries to store her
83 ;; Internet e-mail address with the button by using the formula, email-id =
84 ;; <user-id>@<domainname>.  Not every system has its domainname set
85 ;; up properly, however.  If you do a {M-x load-file hypb.elc RET} and then
86 ;; hit {C-x C-e} after the closing paren of the following function,
87 ;; (hypb:domain-name), you will see whether or not yours is configured
88 ;; properly.  If it is not, uncomment the following line and set it to the
89 ;; proper value.
90
91 ;; (setenv "DOMAINNAME" "mot.com")
92
93 ;;;
94 ;;; XEMACS, GNU EMACS 19, AND EPOCH CONFIGURATION
95 ;;;
96
97 ;; No-op unless set by one of the conditionals below.
98 (defun hui:but-flash ())
99
100 (if (and hyperb:emacs19-p window-system)
101     (progn
102       (require 'hui-em19-b)
103       ;; Highlight explicit buttons whenever a file is read in.
104       (var:append 'find-file-hooks '(hproperty:but-create))
105       (fset 'hui:but-flash 'hproperty:but-flash)
106       ;;
107       ;; Substitute for the nil argument below a valid X color name with
108       ;; which to highlight buttons if the default highlighting does not
109       ;; appeal to you. See "hui-em19-b.el" for how this works.
110       (hproperty:cycle-but-color nil)
111       ;;
112       ;; Non-nil means visually emphasize that button under mouse cursor is
113       ;; selectable.
114       (setq hproperty:but-emphasize-p nil)
115       ;;
116       ;; If you find that the Hyperbole button flash time is too slow
117       ;; or too fast, adjust it here.
118       (setq hproperty:but-flash-time 1000)
119       ))
120
121 (if (and hyperb:xemacs-p (not noninteractive))
122     (progn
123       (require 'hui-xe-but)
124       ;;
125       ;; If running XEmacs 19.8 or below, don't highlight explicit buttons
126       ;; whenever a file is read in since this can cause a sporadic crash
127       ;; when find-files are done.
128       (if hyperb:kotl-p (var:append 'find-file-hooks '(hproperty:but-create)))
129       (fset 'hui:but-flash 'hproperty:but-flash)
130       ;;
131       ;; Substitute for the nil argument below a valid X color name with
132       ;; which to highlight buttons if the default highlighting does not
133       ;; appeal to you. See "hui-xe-but.el" for how this works.
134       (hproperty:cycle-but-color nil)
135       ;;
136       ;; Non-nil means visually emphasize that button under mouse cursor is
137       ;; selectable.
138       (setq hproperty:but-emphasize-p nil)
139       ;;
140       ;; If you find that the Hyperbole button flash time is too slow
141       ;; or too fast, adjust it here.
142       (setq hproperty:but-flash-time 1000)
143       ))
144
145 (if (and hyperb:epoch-p (string= hyperb:epoch-p "V4"))
146     (progn
147       (require 'hui-epV4-b)
148       ;; Highlight explicit buttons whenever a file is read in.
149       (var:append 'find-file-hooks '(hproperty:but-create))
150       (fset 'hui:but-flash 'hproperty:but-flash)
151       ;; Substitute for the nil argument below a valid X color name with
152       ;; which to highlight buttons if the default highlighting does not
153       ;; appeal to you. See "hui-epV4-b.el" for how this works.
154       (hproperty:cycle-but-color nil)
155       ;; If you use Epoch and find that the Hyperbole button flash time is
156       ;; too slow or too fast, adjust it here.
157       (defvar hproperty:but-flash-time 1000
158         "Machine specific value for empty loop counter, Epoch but flash delay.")
159       ))
160
161 ;;;
162 ;;; EXTERNAL SYSTEM ENCAPSULATIONS
163 ;;;
164
165 ;;; Support for encapsulations of any of these external systems may be
166 ;;; enabled here.  You should be familiar with the external system before
167 ;;; you try to use the Hyperbole support for it.
168 ;;; Possible system encapsulations to include within the innermost set of
169 ;;; parentheses are:
170 ;;;   hsys-wais hsys-hbase
171 ;;; See files with the same name, e.g. "hsys-wais.el" for details on each
172 ;;; system.
173 ;;;
174 ;;; Note: hsys-w3 is automatically loaded by default by Hyperbole.
175 (setq hibtypes:begin-load-hook
176       (list (function (lambda () (mapcar 'require '())))))
177
178 ;;;
179 ;;; ONLINE LIBRARY CONFIGURATION
180 ;;;
181
182 ;;; Support for online library document id references is loaded here but
183 ;;; requires some additional configuration before use.  See the DESCRIPTION
184 ;;; section in "hib-doc-id.el" for complete installation and use information.
185 ;;;
186 (setq hibtypes:end-load-hook
187       (list (function (lambda () (mapcar 'require '(hib-doc-id))))))
188
189 ;;;
190 ;;; HYPERBOLE INITIALIZATION
191 ;;;
192
193 ;;; This call loads the whole Hyperbole system.
194 ;;; You may want to look at this file just to see what it does.
195 ;;;
196 (require 'hinit)
197 ;;;
198 ;;; This call initializes the Hyperbole system for use.
199 ;;;
200 (hyperb:init)
201
202 ;;;
203 ;;; FILE VIEWER COMMAND SETTINGS
204 ;;;
205
206 (defvar hpath:display-alist
207   (let ((info-suffix "\\.info\\(-[0-9]+\\)?\\(\\.gz\\|\\.Z\\|-z\\)?$"))
208     (list
209      ;; Run the OO-Browser on OOBR or OOBR-FTR Environment files.
210      '("OOBR\\(-FTR\\)?$" . br-env-browse)
211      ;; Display the top node from Info online manuals.
212      (cons
213       (concat (` (, info-suffix)) "\\|/info/[^.]+$\\|/info-local/[^.]+$")
214       (` (lambda (file)
215            (if (and (string-match (, info-suffix) file)
216                     (match-beginning 1))
217                ;; Removed numbered trailer to get basic filename.
218                (setq file (concat (substring file 0 (match-beginning 1))
219                                   (substring file (match-end 1)))))
220            (require 'info)
221            (condition-case ()
222                (Info-find-node file "Top")
223              (error (if (and file (file-exists-p file))
224                         (progn
225                           (if (get-buffer "*info*")
226                               (kill-buffer "*info*"))
227                           (Info-find-node file "*" nil t))
228                       (error "Invalid file")))))))
229      ))
230   "*Alist of (FILENAME-REGEXP . EDIT-FUNCTION) elements for calling special
231 functions to display particular file types within Emacs.  See also
232 'hpath:file-alist' for external display program settings.")
233
234 ;;; `hyperb:window-system' variable from "hversion.el" must be defined
235 ;;; prior to this variable definition.
236 ;;;
237 (defvar hpath:find-alist
238   (let ((nextstep-suffixes '(("\\.\\(adaptor\\|app\\|bshlf\\|clr\\|concur\\|create\\|diagram\\|dp\\|e?ps\\|frame\\|gif\\|locus\\|Mesa\\|nib\\|project\\|rtf\\|sense\\|tiff\\|tree\\)$" . "open")))
239         (x-suffixes '(("\\.e?ps$" . "ghostview")
240                       ("\\.ps\\.g?[zZ]$" . "zcat %s | ghostview -")
241                       ("\\.\\(gif\\|tiff?\\|xbm\\|pm\\|pbm\\|jpe?g\\)"  . "xv")
242                       ("\\.xwd$" . "xwud -noclick -in")
243                       ("\\.ra?s$" . "snapshot -l")
244                       ("\\.xpm$" . "sxpm")
245                       ("\\.\\(fm\\|frame\\|mif\\)$" . "maker")
246                       ("\\.\\(doc\\|boo\\)$" . "ileaf")
247                       )))
248     (if (memq window-system '(dps ns))
249         nextstep-suffixes
250       (cdr (assoc hyperb:window-system
251                   (list (cons "emacs19" x-suffixes)  ; GNU Emacs V19 under X
252                         (cons "xemacs"  x-suffixes)  ; XEmacs under X
253                         (cons "xterm"   x-suffixes)  ; GNU Emacs V18 under X
254                         (cons "epoch"   x-suffixes)  ; UofI Epoch under X
255                         '("sun"     . nil)       ; SunView
256                         (cons "next" nextstep-suffixes)
257                         '("apollo"  . nil)       ; Display Manager
258                         )))))
259   "*Alist of (FILENAME-REGEXP . EDIT-PROGRAM) elements for using window system
260 dependent external programs to edit/display particular file types.  See also
261 'hpath:display-alist' for internal, window-system independent display
262 settings.")
263
264 ;;;
265 ;;; LINK PATH VARIABLE SUBSTITUTION SETTINGS
266 ;;;
267
268 ;;; The following variable permits sharing of links over wide areas, where
269 ;;; links may contain variable references whose values may differ between
270 ;;; link creator and link activator.
271 ;;;
272 ;;; When a link is created, if its path contains a match for any of the
273 ;;; variable values in hpath:variables, then the variable's symbol is
274 ;;; substituted for the literal value.  Hyperbole then replaces the variable
275 ;;; with a matching value when the link is resolved.
276 ;;;
277 (defvar hpath:variables
278   '(hyperb:dir Info-directory Info-directory-list sm-directory load-path exec-path)
279   "*List of Emacs Lisp variable symbols to substitute within matching link paths.
280 Each variable value, if bound, must be either a pathname or a list of pathnames.")
281
282 ;;;
283 ;;; HYPERBOLE LOCAL VARIABLE SUPPORT
284 ;;;
285
286 ;;; Uncomment this if you really need to be able to use Hyperbole variables
287 ;;; (and others with colons in their names) within file local variable lists.
288 ;;; See the source file for more details.
289 ;;;
290 ;;  (require 'hlvar)
291
292 ;;;
293 ;;; SITE-SPECIFIC ADDITIONS - Add your Hyperbole configuration additions here.
294 ;;;
295
296 ;;;
297 ;;; END OF HYPERBOLE CONFIGURATION
298 ;;;
299
300 (provide 'hsite)
301
302 (message "Hyperbole is ready for action.")
303
304 ;;; hsite-ex.el ends here