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