comparison lisp/hyperbole/hsite-ex.el @ 0:376386a54a3c r19-14

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