0
|
1 ;;!emacs
|
|
2 ;;
|
|
3 ;; FILE: hsite.el
|
|
4 ;; SUMMARY: Site-specific setup for Hyperbole
|
|
5 ;; USAGE: GNU Emacs Lisp Library
|
|
6 ;; KEYWORDS: hypermedia, local
|
|
7 ;;
|
|
8 ;; AUTHOR: Bob Weiner
|
100
|
9 ;; ORG: InfoDock Associates
|
0
|
10 ;;
|
|
11 ;; ORIG-DATE: 15-Apr-91 at 00:48:49
|
100
|
12 ;; LAST-MOD: 17-Feb-97 at 18:34:17 by Bob Weiner
|
0
|
13 ;;
|
|
14 ;; This file is part of Hyperbole.
|
|
15 ;; Available for use and distribution under the same terms as GNU Emacs.
|
|
16 ;;
|
100
|
17 ;; Copyright (C) 1991-1997, Free Software Foundation, Inc.
|
0
|
18 ;; Developed with support from Motorola Inc.
|
|
19 ;;
|
|
20 ;; DESCRIPTION:
|
|
21 ;;
|
|
22 ;; See the "README" file for installation instructions.
|
|
23 ;;
|
|
24 ;; "hsite.el" may be byte-compiled if you like but normally it is not.
|
|
25 ;;
|
|
26 ;; Be sure to have users load any personal mail/news initializations
|
|
27 ;; before they load this file if any of Hyperbole's mail or news
|
|
28 ;; support features are enabled either herein or within their personal
|
|
29 ;; Hyperbole initializations. Otherwise, the mail/news support may
|
|
30 ;; not be configured properly.
|
|
31 ;;
|
|
32 ;; DESCRIP-END.
|
|
33
|
|
34 ;;; ************************************************************************
|
|
35 ;;; Read the comments and modify as desired.
|
|
36 ;;; ************************************************************************
|
|
37
|
|
38 (message "Initializing Hyperbole, please wait...")
|
|
39
|
24
|
40 ;;; ************************************************************************
|
100
|
41 ;;; TIMEZONE SETTING
|
|
42 ;;; ************************************************************************
|
|
43
|
|
44 ;; The following section applies only to MS-DOS and MS-Windows OSs.
|
|
45 ;; For such OSs, you must configure this section or you will receive
|
|
46 ;; an error when starting Hyperbole. Users of other OSs may simply
|
|
47 ;; ignore this section.
|
|
48
|
|
49
|
|
50 ;; Microcruft OSs don't provide an automatically set timezone environment
|
|
51 ;; variable. Nor do they include a UNIX-style date program. So follow
|
|
52 ;; the commented instructions in the code below here.
|
|
53
|
|
54 ;; If you happened to have installed a UNIX-style date program (when you type
|
|
55 ;; `date' at a shell, it simply spits out the date and time and then quits),
|
|
56 ;; you may comment out the logic.
|
|
57 ;;
|
|
58 (if (and hyperb:microcruft-os-p
|
|
59 (not (or (getenv "TZ") (getenv "TIMEZONE"))))
|
|
60 (progn
|
|
61 ;; Comment out the following `error' line...
|
|
62 (error "(hsite.el): Configure the TIMEZONE SETTING section in this file.")
|
|
63 ;; ... and uncomment the following line, substituting an appropriate
|
|
64 ;; timezone from the list in the variable, `htz:world-timezones'
|
|
65 ;; in the file, "htz.el".
|
|
66 ;; (setenv "TZ" "your-3char-timezone")
|
|
67 ))
|
|
68
|
|
69 ;;; ************************************************************************
|
0
|
70 ;;; SMART SETTINGS
|
|
71 ;;; ************************************************************************
|
|
72
|
|
73 (defvar hkey-always-display-menu nil
|
|
74 "*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.
|
|
75 If a Smart Menu is already displayed, perform another Action or Assist Key
|
|
76 function.")
|
|
77
|
|
78 (defvar smart-scroll-proportional t
|
|
79 "*Non-nil means Smart Keys should scroll relative to current line when pressed at the end of a line.
|
|
80 Action Key moves current line to top of window. Assist Key moves current
|
|
81 line to bottom of window. Repeated presses then scroll up or down a
|
|
82 windowful. Nil value instead ignores current line and always scrolls up or
|
|
83 down a windowful.")
|
|
84
|
|
85 ;;; ************************************************************************
|
|
86 ;;; HYPERBOLE DIRECTORY SETTING
|
|
87 ;;; ************************************************************************
|
|
88
|
|
89 (require 'hyperbole)
|
|
90
|
|
91 ;;; ************************************************************************
|
|
92 ;;; INTERNET SETTINGS
|
|
93 ;;; ************************************************************************
|
|
94
|
100
|
95 ;; String to be used in the call: (hpath:rfc rfc-num) to create a remote
|
|
96 ;; path to the RFC document for `rfc-num'. Uncomment and alter this setting
|
0
|
97 ;; if another site is closer for you.
|
|
98 ;; (setq hpath:rfc "/anonymous@ds.internic.net:rfc/rfc%s.txt")
|
|
99
|
|
100 ;; When a user creates an explicit button, Hyperbole tries to store her
|
|
101 ;; Internet e-mail address with the button by using the formula, email-id =
|
|
102 ;; <user-id>@<domainname>. Not every system has its domainname set
|
|
103 ;; up properly, however. If you do a {M-x load-file hypb.elc RET} and then
|
|
104 ;; hit {C-x C-e} after the closing paren of the following function,
|
|
105 ;; (hypb:domain-name), you will see whether or not yours is configured
|
|
106 ;; properly. If it is not, uncomment the following line and set it to the
|
|
107 ;; proper value.
|
|
108
|
100
|
109 ;; (setenv "DOMAINNAME" "yourdomain.com")
|
0
|
110
|
|
111 ;;; ************************************************************************
|
|
112 ;;; XEMACS, GNU EMACS 19, AND EPOCH CONFIGURATION
|
|
113 ;;; ************************************************************************
|
|
114
|
|
115 ;; No-op unless set by one of the conditionals below.
|
|
116 (defun hui:but-flash ())
|
|
117
|
|
118 (if (and hyperb:emacs19-p window-system)
|
|
119 (progn
|
|
120 (require 'hui-em19-b)
|
|
121 ;; Highlight explicit buttons whenever a file is read in.
|
|
122 (var:append 'find-file-hooks '(hproperty:but-create))
|
|
123 (fset 'hui:but-flash 'hproperty:but-flash)
|
|
124 ;;
|
|
125 ;; Substitute for the nil argument below a valid X color name with
|
|
126 ;; which to highlight buttons if the default highlighting does not
|
|
127 ;; appeal to you. See "hui-em19-b.el" for how this works.
|
|
128 (hproperty:cycle-but-color nil)
|
|
129 ;;
|
|
130 ;; Non-nil means visually emphasize that button under mouse cursor is
|
|
131 ;; selectable.
|
|
132 (setq hproperty:but-emphasize-p nil)
|
|
133 ;;
|
|
134 ;; If you find that the Hyperbole button flash time is too slow
|
|
135 ;; or too fast, adjust it here.
|
|
136 (setq hproperty:but-flash-time 1000)
|
|
137 ))
|
|
138
|
|
139 (if (and hyperb:lemacs-p (not noninteractive))
|
|
140 (progn
|
|
141 (require 'hui-xe-but)
|
|
142 ;;
|
|
143 ;; If running XEmacs 19.8 or below, don't highlight explicit buttons
|
|
144 ;; whenever a file is read in since this can cause a sporadic crash
|
|
145 ;; when find-files are done.
|
|
146 (if hyperb:kotl-p (var:append 'find-file-hooks '(hproperty:but-create)))
|
|
147 (fset 'hui:but-flash 'hproperty:but-flash)
|
|
148 ;;
|
|
149 ;; Substitute for the nil argument below a valid X color name with
|
|
150 ;; which to highlight buttons if the default highlighting does not
|
|
151 ;; appeal to you. See "hui-xe-but.el" for how this works.
|
|
152 (hproperty:cycle-but-color nil)
|
|
153 ;;
|
|
154 ;; Non-nil means visually emphasize that button under mouse cursor is
|
|
155 ;; selectable.
|
|
156 (setq hproperty:but-emphasize-p nil)
|
|
157 ;;
|
|
158 ;; If you find that the Hyperbole button flash time is too slow
|
|
159 ;; or too fast, adjust it here.
|
|
160 (setq hproperty:but-flash-time 1000)
|
|
161 ))
|
|
162
|
|
163 (if (and hyperb:epoch-p (string= hyperb:epoch-p "V4"))
|
|
164 (progn
|
|
165 (require 'hui-epV4-b)
|
|
166 ;; Highlight explicit buttons whenever a file is read in.
|
|
167 (var:append 'find-file-hooks '(hproperty:but-create))
|
|
168 (fset 'hui:but-flash 'hproperty:but-flash)
|
|
169 ;; Substitute for the nil argument below a valid X color name with
|
|
170 ;; which to highlight buttons if the default highlighting does not
|
|
171 ;; appeal to you. See "hui-epV4-b.el" for how this works.
|
|
172 (hproperty:cycle-but-color nil)
|
|
173 ;; If you use Epoch and find that the Hyperbole button flash time is
|
|
174 ;; too slow or too fast, adjust it here.
|
|
175 (defvar hproperty:but-flash-time 1000
|
|
176 "Machine specific value for empty loop counter, Epoch but flash delay.")
|
|
177 ))
|
|
178
|
|
179 ;;; ************************************************************************
|
|
180 ;;; EXTERNAL SYSTEM ENCAPSULATIONS
|
|
181 ;;; ************************************************************************
|
|
182
|
|
183 ;;; Support for encapsulations of any of these external systems may be
|
|
184 ;;; enabled here. You should be familiar with the external system before
|
|
185 ;;; you try to use the Hyperbole support for it.
|
|
186 ;;; Possible system encapsulations to include within the innermost set of
|
|
187 ;;; parentheses are:
|
|
188 ;;; hsys-wais hsys-hbase
|
|
189 ;;; See files with the same name, e.g. "hsys-wais.el" for details on each
|
|
190 ;;; system.
|
|
191 ;;;
|
|
192 ;;; Note: hsys-w3 is automatically loaded by default by Hyperbole.
|
|
193 (setq hibtypes:begin-load-hook
|
|
194 (list (function (lambda () (mapcar 'require '())))))
|
|
195
|
|
196 ;;; ************************************************************************
|
|
197 ;;; ONLINE LIBRARY CONFIGURATION
|
|
198 ;;; ************************************************************************
|
|
199
|
|
200 ;;; Support for online library document id references is loaded here but
|
|
201 ;;; requires some additional configuration before use. See the DESCRIPTION
|
|
202 ;;; section in "hib-doc-id.el" for complete installation and use information.
|
|
203 ;;;
|
|
204 (setq hibtypes:end-load-hook
|
|
205 (list (function (lambda () (mapcar 'require '(hib-doc-id))))))
|
|
206
|
|
207 ;;; ************************************************************************
|
|
208 ;;; FILE VIEWER COMMAND SETTINGS
|
|
209 ;;; ************************************************************************
|
|
210
|
|
211 (defvar hpath:display-alist
|
|
212 (let ((info-suffix "\\.info\\(-[0-9]+\\)?\\(\\.gz\\|\\.Z\\|-z\\)?$"))
|
|
213 (list
|
|
214 ;; Run the OO-Browser on OOBR or OOBR-FTR Environment files.
|
|
215 '("OOBR\\(-FTR\\)?$" . br-env-browse)
|
|
216 ;; Display the top node from Info online manuals.
|
|
217 (cons
|
|
218 (concat (` (, info-suffix)) "\\|/info/[^.]+$\\|/info-local/[^.]+$")
|
|
219 (` (lambda (file)
|
|
220 (if (and (string-match (, info-suffix) file)
|
|
221 (match-beginning 1))
|
|
222 ;; Removed numbered trailer to get basic filename.
|
|
223 (setq file (concat (substring file 0 (match-beginning 1))
|
|
224 (substring file (match-end 1)))))
|
|
225 (require 'info)
|
|
226 (condition-case ()
|
|
227 (Info-find-node file "Top")
|
|
228 (error (if (and file (file-exists-p file))
|
|
229 (progn
|
|
230 (if (get-buffer "*info*")
|
|
231 (kill-buffer "*info*"))
|
|
232 (Info-find-node file "*" nil t))
|
|
233 (error "Invalid file")))))))
|
|
234 ))
|
|
235 "*Alist of (FILENAME-REGEXP . EDIT-FUNCTION) elements for calling special
|
|
236 functions to display particular file types within Emacs. See also
|
100
|
237 `hpath:file-alist' for external display program settings.")
|
|
238
|
|
239 (defvar hpath:display-buffer-alist
|
|
240 (list
|
|
241 (list 'this-window 'switch-to-buffer)
|
|
242 (list 'other-window (function (lambda (b)
|
|
243 (if (br-in-browser)
|
|
244 (progn (br-to-view-window)
|
|
245 (switch-to-buffer b))
|
|
246 (switch-to-buffer-other-window b)))))
|
|
247 (list 'one-window (function (lambda (b)
|
|
248 (if (br-in-browser) (br-quit))
|
|
249 (delete-other-windows)
|
|
250 (switch-to-buffer b))))
|
|
251 (list 'new-frame (function (lambda (b)
|
|
252 (select-frame (make-frame))
|
|
253 (switch-to-buffer b))))
|
|
254 (list 'other-frame 'hpath:display-buffer-other-frame)
|
|
255 (list 'other-frame-one-window
|
|
256 (function (lambda (b)
|
|
257 (hpath:display-buffer-other-frame b)
|
|
258 (delete-other-windows)))))
|
|
259 "*Alist of (DISPLAY-WHERE-SYMBOL DISPLAY-BUFFER-FUNCTION) elements.
|
|
260 This permits fine-grained control of where Hyperbole displays linked to buffers.
|
|
261 The default value of DISPLAY-WHERE-SYMBOL is given by `hpath:display-where'.
|
|
262 Valid DISPLAY-WHERE-SYMBOLs are:
|
|
263 this-window - display in the current window
|
|
264 other-window - display in another window in the current frame
|
|
265 one-window - display in the current window, deleting other windows
|
|
266 new-frame - display in a new frame
|
|
267 other-frame - display in another, possibly existing, frame
|
|
268 other-frame-one-window - display in another frame, deleting other windows.")
|
|
269
|
|
270 (defvar hpath:display-where 'other-window
|
|
271 "Symbol specifying the default method to use to display Hyperbole link referents.
|
|
272 See documentation of `hpath:display-where-alist' for valid values.")
|
|
273
|
|
274 (defvar hpath:display-where-alist
|
|
275 (list
|
|
276 (list 'this-window 'find-file)
|
|
277 (list 'other-window (function (lambda (f)
|
|
278 (if (br-in-browser)
|
|
279 (progn (br-to-view-window)
|
|
280 (find-file f))
|
|
281 (find-file-other-window f)))))
|
|
282 (list 'one-window (function (lambda (f)
|
|
283 (if (br-in-browser) (br-quit))
|
|
284 (delete-other-windows) (find-file f))))
|
|
285 (list 'new-frame 'find-file-new-frame)
|
|
286 (list 'other-frame 'hpath:find-other-frame)
|
|
287 (list 'other-frame-one-window
|
|
288 (function (lambda (f) (hpath:find-other-frame f) (delete-other-windows)))))
|
|
289 "*Alist of (DISPLAY-WHERE-SYMBOL DISPLAY-FILE-FUNCTION) elements.
|
|
290 This permits fine-grained control of where Hyperbole displays linked to files.
|
|
291 The default value of DISPLAY-WHERE-SYMBOL is given by `hpath:display-where'.
|
|
292 Valid DISPLAY-WHERE-SYMBOLs are:
|
|
293 this-window - display in the current window
|
|
294 other-window - display in another window in the current frame
|
|
295 one-window - display in the current window, deleting other windows
|
|
296 new-frame - display in a new frame
|
|
297 other-frame - display in another, possibly existing, frame
|
|
298 other-frame-one-window - display in another frame, deleting other windows.")
|
0
|
299
|
|
300 ;;; `hyperb:window-system' variable from "hversion.el" must be defined
|
|
301 ;;; prior to this variable definition.
|
|
302 ;;;
|
|
303 (defvar hpath:find-alist
|
|
304 (let ((nextstep-suffixes '(("\\.\\(adaptor\\|app\\|bshlf\\|clr\\|concur\\|create\\|diagram\\|dp\\|e?ps\\|frame\\|gif\\|locus\\|Mesa\\|nib\\|project\\|rtf\\|sense\\|tiff\\|tree\\)$" . "open")))
|
|
305 (x-suffixes '(("\\.e?ps$" . "ghostview")
|
|
306 ("\\.ps\\.g?[zZ]$" . "zcat %s | ghostview -")
|
70
|
307 ("\\.\\(gif\\|tiff?\\|xbm\\|pm\\|pbm\\|jpe?g\\)" . "xv")
|
0
|
308 ("\\.xwd$" . "xwud -noclick -in")
|
|
309 ("\\.ra?s$" . "snapshot -l")
|
70
|
310 ("\\.xpm$" . "sxpm")
|
100
|
311 ("\\.\\(fm\\|frame\\|mif\\)$" .
|
|
312 "frame.pl -vn -preader -c -f%s") ;; was "msgfm_driver"
|
0
|
313 ("\\.\\(doc\\|boo\\)$" . "ileaf")
|
|
314 )))
|
|
315 (if (memq window-system '(dps ns))
|
|
316 nextstep-suffixes
|
|
317 (cdr (assoc hyperb:window-system
|
|
318 (list (cons "emacs19" x-suffixes) ; GNU Emacs V19 under X
|
|
319 (cons "lemacs" x-suffixes) ; XEmacs under X
|
|
320 (cons "xterm" x-suffixes) ; GNU Emacs V18 under X
|
|
321 (cons "epoch" x-suffixes) ; UofI Epoch under X
|
|
322 '("sun" . nil) ; SunView
|
|
323 (cons "next" nextstep-suffixes)
|
|
324 '("apollo" . nil) ; Display Manager
|
|
325 )))))
|
|
326 "*Alist of (FILENAME-REGEXP . EDIT-PROGRAM) elements for using window system
|
|
327 dependent external programs to edit/display particular file types. See also
|
100
|
328 `hpath:display-alist' for internal, window-system independent display
|
0
|
329 settings.")
|
|
330
|
|
331 ;;; ************************************************************************
|
|
332 ;;; LINK PATH VARIABLE SUBSTITUTION SETTINGS
|
|
333 ;;; ************************************************************************
|
|
334
|
|
335 ;;; The following variable permits sharing of links over wide areas, where
|
|
336 ;;; links may contain variable references whose values may differ between
|
|
337 ;;; link creator and link activator.
|
|
338 ;;;
|
|
339 ;;; When a link is created, if its path contains a match for any of the
|
|
340 ;;; variable values in hpath:variables, then the variable's symbol is
|
|
341 ;;; substituted for the literal value. Hyperbole then replaces the variable
|
|
342 ;;; with a matching value when the link is resolved.
|
|
343 ;;;
|
|
344 (defvar hpath:variables
|
|
345 '(hyperb:dir Info-directory Info-directory-list sm-directory load-path exec-path)
|
|
346 "*List of Emacs Lisp variable symbols to substitute within matching link paths.
|
|
347 Each variable value, if bound, must be either a pathname or a list of pathnames.")
|
|
348
|
|
349 ;;; ************************************************************************
|
100
|
350 ;;; HYPERBOLE INITIALIZATION
|
|
351 ;;; ************************************************************************
|
|
352
|
|
353 ;;; This call loads the whole Hyperbole system.
|
|
354 ;;; You may want to look at this file just to see what it does.
|
|
355 ;;;
|
|
356 (require 'hinit)
|
|
357 ;;;
|
|
358 ;;; This call initializes the Hyperbole system for use.
|
|
359 ;;;
|
|
360 (hyperb:init)
|
|
361
|
|
362 ;;; ************************************************************************
|
0
|
363 ;;; HYPERBOLE LOCAL VARIABLE SUPPORT
|
|
364 ;;; ************************************************************************
|
|
365
|
|
366 ;;; Uncomment this if you really need to be able to use Hyperbole variables
|
|
367 ;;; (and others with colons in their names) within file local variable lists.
|
|
368 ;;; See the source file for more details.
|
|
369 ;;;
|
|
370 ;; (require 'hlvar)
|
|
371
|
|
372 ;;; ************************************************************************
|
|
373 ;;; SITE-SPECIFIC ADDITIONS - Add your Hyperbole configuration additions here.
|
|
374 ;;; ************************************************************************
|
|
375
|
|
376 ;;; ************************************************************************
|
|
377 ;;; END OF HYPERBOLE CONFIGURATION
|
|
378 ;;; ************************************************************************
|
|
379
|
|
380 (provide 'hsite)
|
|
381
|
|
382 (message "Hyperbole is ready for action.")
|