1 ;;; -*- Mode: Emacs-Lisp -*-
6 ;;; This file is part of ILISP.
7 ;;; Please refer to the file COPYING for copyrights and licensing
9 ;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
10 ;;; of present and past contributors.
12 ;;; $Id: ilisp-def.el,v 1.5 2002-06-03 23:37:00 wbd Exp $
16 (defvar ilisp-locals '(comint-prompt-regexp
27 comint-interrupt-regexp
30 comint-interrupt-start
35 comint-use-prompt-regexp-instead-of-fields)
36 "List of ilisp local variables.")
38 (defun lisp-deflocal (local)
39 (unless (memq local ilisp-locals)
40 (setq ilisp-locals (cons local ilisp-locals))))
44 (defmacro deflocal (variable default &optional documentation)
45 "Define an ilisp local variable."
46 (` (progn (lisp-deflocal '(, variable))
47 (defvar (, variable) (, default) (, documentation)))))
49 ;;;%%Simple customization
51 (defcustom ilisp-*prefix*
52 (if (and (boundp 'ilisp-*use-fsf-compliant-keybindings*)
53 ilisp-*use-fsf-compliant-keybindings*)
56 "Prefix sequence for ilisp commands.")
59 (deflocal ilisp-program nil
60 "*Program and arguments for invoking an inferior LISP.
61 The program can be an rsh to run on a remote machine. If there is not
62 a common file system, the interface files will be sent down the pipe
63 instead. The value of this variable is set from DIALECT-program, or
64 inherited from a less specific dialect if DIALECT-program is nil.")
67 "ILISP V%s Use M-x ilisp-bug for problems and suggestions."
68 "*Message of the day format string for ILISP given VERSION. To
69 prevent any message from being printed, set this to nil.")
71 (defvar lisp-wait-p nil
72 "*T if LISP eval/compile commands should wait for the result.
73 A minus prefix to the command will change the sense of this switch
74 for just the next command.")
76 (defvar lisp-no-popper 'message
77 "*T if all output goes to the inferior LISP rather than in a pop-up window.
78 '(quote message) if you want output of one line to go to the echo area
79 (usually the Minibuffer) or to a pop-up window if more. You should
80 probably also set comint-always-scroll to T as well so that output is
83 (defvar ilisp-*use-frame-for-output* t
84 "*If T, ILISP uses a frame for its output, rather than a pop-up window.
85 The output going to the frame is usually multiline. Single line
86 output usually goes to the echo area in the minibuffer. If no window
87 system is running then the value of this variable is ininfluent.")
89 (defcustom ilisp-*use-fsf-compliant-keybindings* nil
90 "*If non-nil, ILISP will use FSF Emacs compliant keybindings.
92 In brief, this means all ilisp-specific features will be bound to C-c
93 KEY, where KEY is a control character, a digit, or one of }, {, >, <,
94 :, or ;. In some cases ilisp may rebind a regular Emacs key, if the
95 new binding does \"the same thing\" as the original binding but in a
96 way more appropriate for ilisp."
99 :group 'ILisp-interaction
100 ;; note: custom-ilisp.el is not loaded yet, so I'm just getting
101 ;; ready for the future by specifying a group above.
104 (defvar lisp-show-status t
105 "*Set to nil to stop showing process status in lisp-mode buffers.")
107 (defvar ilisp-*prefix-match* nil
108 "*If T, when completing through the inferior LISP matches only as a prefix.
109 This will speed up completion, but you no longer get partial
112 (deflocal ilisp-filter-regexp nil
113 "*What not to save on an inferior LISP's input history.
114 Input matching this regexp is not saved on the input history in ilisp
117 (deflocal ilisp-filter-length 3
118 "*Do not save strings less than this in the command history.")
120 (deflocal ilisp-other-prompt nil
121 "*Regexp to recognise \"other\" prompts in the inferior LISP.
122 These 'prompts' are those of non-(read/eval/print) top-levels that
123 bol-ilisp skips them.")
125 (deflocal ilisp-raw-echo nil
126 "*Set this to T to cause echoing in raw keyboard mode.")
128 (deflocal ilisp-load-no-compile-query nil
129 "*Set this to T to stop load querying about compile.")
132 (defvar ilisp-site-hook nil
133 "Hook for site customization of ilisp mode when it is loaded.")
135 (defvar ilisp-load-hook '()
136 "Hook for customizing ilisp mode when it is loaded.")
138 (defvar ilisp-mode-hook '()
139 "Hook for customizing ilisp mode.")
141 (defvar ilisp-init-hook nil
142 "Hook of functions to call on first prompt in inferior LISP.")
144 (deflocal ilisp-init-hook-local nil
145 "Local Hook of functions to call on first prompt in inferior LISP.")
147 ;;;%%Advanced customization
149 (deflocal ilisp-reset nil
150 "String for resetting the top-level of the inferior LISP.")
152 (deflocal ilisp-load-or-send-command nil
153 "Format string for loading BINARY if possible otherwise loading FILE.
154 If you can't load either, return NIL.")
156 (deflocal ilisp-hash-form-regexp nil
157 "Regular expression for finding a package specification in a buffer.
158 The entire sexp starting with this pattern will be passed to
159 ilisp-package-command to find the package.")
161 (deflocal ilisp-in-package-command-string nil
162 "Regular expression for finding a command that makes some package active.")
164 (deflocal ilisp-defpackage-command-string nil
165 "Regular expression for finding a command that defines a package.")
167 (deflocal ilisp-package-separator-regexp nil
168 "Regular expression that matches the package separator.")
170 (deflocal ilisp-package-command nil
171 "Format string to find the package given PACKAGE.")
173 (deflocal ilisp-package-name-command nil
174 "Format string to return the name of the current package.")
176 (deflocal ilisp-in-package-command nil
177 "Format string to set the package given PACKAGE.")
179 (deflocal ilisp-last-command nil
180 "Format string for getting the last returned value.")
182 (deflocal ilisp-save-command nil
183 "Format string for saving result history given FORM.")
185 (deflocal ilisp-restore-command nil
186 "Format string for restoring result history.")
188 (deflocal ilisp-block-command nil
189 "Format string for grouping FORMS into one.")
191 (deflocal ilisp-no-package-in-core-regexp nil
192 "Regexp that matches to ilisp-package-block-command's result in a
193 case when the package was not found in core. Remember to set
194 `ilisp-fallback-package' too.")
196 (deflocal ilisp-fallback-package nil
197 "Package name to be used when the buffer's real package cannot be found
200 (deflocal ilisp-eval-command nil
201 "Format string for evaluating FORM in PACKAGE from FILE at LINE.")
203 (deflocal ilisp-defvar-regexp nil
204 "Regular expression for identifying a defvar form.")
206 (deflocal ilisp-defvar-command nil
207 "Format string for re-evaluating DEFVAR in PACKAGE from FILE at LINE.")
209 (deflocal ilisp-describe-command nil
210 "Format string for describing FORM in PACKAGE.")
212 (deflocal ilisp-compile-command nil
213 "Format string for compiling FORM in PACKAGE.")
215 (deflocal ilisp-inspect-command nil
216 "Format string for inspecting FORM in PACKAGE.")
218 (deflocal ilisp-arglist-command nil
219 "Format string for arglist of SYMBOL in PACKAGE.")
221 (deflocal ilisp-documentation-types nil
222 "((\"type\") ...) possible LISP documentation types.")
224 (deflocal ilisp-documentation-command nil
225 "Format string for documentation given SYMBOL in PACKAGE and TYPE.")
227 (deflocal ilisp-macroexpand-1-command nil
228 "Format string for top-level macroexpand given FORM and PACKAGE.")
230 (deflocal ilisp-macroexpand-command nil
231 "Format string for macroexpand given FORM and PACKAGE.")
233 (deflocal ilisp-complete-command nil
234 "Format string for finding possibly matching symbols.
235 Given SYMBOL, PACKAGE, FUNCTIONP, EXTERNALP and PARTIAL-MATCHP, it
236 should print '((string) (string) ...)'.")
238 (deflocal ilisp-callers-command nil
239 "Format for finding the callers of SYMBOL in PACKAGE.
240 The function should print out callers with one per line.")
242 (deflocal ilisp-trace-command nil
243 "Format for tracing SYMBOL in PACKAGE.")
244 (deflocal ilisp-untrace-command nil
245 "Format for untracing SYMBOL in PACKAGE.")
247 (deflocal ilisp-directory-command nil
248 "Format for getting default DIRECTORY.")
249 (deflocal ilisp-set-directory-command nil
250 "Format for setting default DIRECTORY.")
252 (deflocal ilisp-binary-command nil
253 "Command to return the extension for binary files.")
255 (deflocal ilisp-binary-extension nil
256 "*The extension to use for LISP binaries.
257 If there is an ilisp-binary-command, this string will be determined at
258 initialization time.")
260 (deflocal ilisp-init-binary-command nil
261 "Command to return the extension for initialization binary files.")
263 (deflocal ilisp-init-binary-extension nil
264 "The extension for initialization binary files.
265 If there is an ilisp-init-binary-command, this string will be
266 determined at initialization time.")
268 (deflocal ilisp-load-command nil
269 "Format string for loading a file in LISP given FILE.")
271 (deflocal ilisp-compile-file-command nil
272 "Format string for compiling a file in LISP given FILE and EXTENSION.")
274 (deflocal ilisp-print-info-message-command nil
275 "Format string for printing argument list information etc. given a STRING.")
278 (deflocal ilisp-source-types nil
279 "Alist of strings for source types.
280 The strings can be either symbols or list expressions since the input
281 accepts symbols or open ended lists as type specifiers.")
283 (deflocal ilisp-find-source-command nil
284 "Format string for finding the source file that defined SYMBOL in PACKAGE.
285 It should return NIL if no source is found.")
287 (deflocal ilisp-locator nil
288 "Function that finds the next SYMBOL TYPE definition in the current buffer.
289 The complete argument list is \(SYMBOL TYPE FIRST-P BACK-P): FIRST-P
290 is T the first time it is called in a buffer. BACK-P is T to move
293 (deflocal ilisp-calls-locator nil
294 "Function that finds calls to SYMBOL in the current buffer.
295 The complete argument list is \(SYMBOL TYPE FIRST-P BACK-P )FIRST-P is
296 T the first time it is called in a buffer. BACK-P is T to move
299 (deflocal ilisp-source-directory-fixup-alist
301 "*Alist of matchers to be used in conjuction with 'edit-definition-alist'.
302 The elements of the alist have the form (REGEXP . FIXUP-FUNCTION)
303 which will be applied to lists of source filenames to be used with
304 'edit-definitions-list'. FIXUP-FUNCTION takes no arguments and should
305 use replace-match to fix the filenames.")
309 (deflocal ilisp-use-map nil "Keymap to use in ILISP mode.")
311 (defvar ilisp-bugs-to "ilisp@cons.org" "Who to send bug reports to.")
313 (defvar ilisp-modes '(ilisp-mode) "List of all inferior ilisp modes.")
315 (defvar lisp-source-modes '(lisp-mode scheme-mode)
316 "Used to determine if a buffer contains Lisp source code.
317 If it's loaded into a buffer that is in one of these major modes, it's
318 considered a lisp source file by find-file-lisp, load-file-lisp and
319 compile-file-lisp. Used by these commands to determine defaults.")
321 (deflocal ilisp-no-newline nil
322 "Set to T to stop ilisp from inserting a newline after a command.")
324 (deflocal ilisp-error-filter nil "Function to filter error output.")
326 (deflocal ilisp-error-regexp nil "Regular expression to match error.")
328 (deflocal ilisp-symbol-delimiters nil
329 "Delimiters found around symbols.")
332 (defvar ilisp-completion-map nil "Keymap for reading ilisp readers.")
334 (defvar ilisp-epoch-running (and (boundp 'epoch::version) epoch::version)
335 "Non-nil if epoch is running.")
337 (defvar ilisp-*version*
338 "5.12.0" ;; ILISP-VERSION marker
341 (defvar ilisp-*directory* nil "The directory that ilisp is found in.")
343 (defvar ilisp-mode-map nil "Key map for ILISP.")
345 (defvar ilisp-raw-map nil
346 "Keyboard map for sending characters directly to the inferior LISP.")
348 (defvar ilisp-raw-message "Raw keyboard mode until C-g"
349 "Message for how to stop raw mode.")
351 (defvar ilisp-buffer nil "Name of selected ilisp buffer.")
353 (defvar ilisp-status nil "Status string for selected ilisp buffer.")
355 (defvar ilisp-buffers nil "List of ILISP buffers.")
357 (defvar ilisp-dialects nil "List of ILISP dialects.")
359 (deflocal ilisp-load-inits nil
360 "Alist of dialect files to load when initializing an inferior LISP.
361 By default the file will be loaded from the ilisp-directory.")
363 ;;; This is useful to have a clause in ilisp code like:
364 ;;; (if (memq 'allegro (ilisp-value 'ilisp-dialect))
367 (deflocal ilisp-dialect nil
368 "List of the dialects that defined the current inferior LISP.")
370 (defvar ilisp-initialized nil
371 "List of buffer names that have been initialized.")
373 (deflocal ilisp-initializing nil
374 "Set to T while waiting for inferior LISP to get initialized.")
376 (deflocal ilisp-load-files nil "List of files being loaded.")
378 (defvar lisp-changes nil
379 "List of markers for changed forms.")
381 (deflocal ilisp-pending-changes nil
382 "List of changes that are pending, but have not been confirmed yet.")
385 ;;; Dynamically bound variables for controlling reading
387 (defvar ilisp-complete nil "T if in minibuffer completion mode.")
389 (defvar ilisp-no-complete nil "T if incomplete symbols are allowed.")
391 (defvar ilisp-table nil "Completion table for ilisp readers.")
393 (defvar ilisp-paren nil "T if paren is allowed in ilisp readers.")
395 (defvar ilisp-completion-package nil
396 "Package of buffer requesting completion.")
398 (defvar ilisp-completion-function-p nil
399 "T if only symbols with function values are allowed.")
401 ;;; State variables for ilisp reading
403 (defvar ilisp-mini-prefix nil "Package and qualification from minibuffer.")
405 (defvar ilisp-original nil "Original string for ilisp completion.")
407 (defvar ilisp-original-function-p nil "Function-p for ilisp completion.")
409 (defvar ilisp-original-table nil "Completion table for ilisp-original.")
414 (defvar buffer-package 'not-yet-computed "Cached package name.")
416 (defvar buffer-mode-name nil "Original mode name.")
418 (defvar lisp-buffer-package nil "T if in lisp-buffer-package.")
420 (defvar lisp-dont-cache-package nil
421 "If Non-Nil then refind the most recent in-package each time.")
423 ;;;%Globals from ilisp-ext.el
426 (defvar ilisp-ext-load-hook nil "Hook to run when extensions are loaded.")
428 (defvar left-delimiter "\(" "*Left delimiter for find-unbalanced.")
430 (defvar right-delimiter "\)" "*Right delimiter for find-unbalanced.")
432 ;;; Copies of ilisp var definitions
434 (defvar ilisp-complete nil "T when ilisp is in completion mode.")
436 (defvar ilisp-modes '(ilisp-mode) "List of all inferior ilisp modes.")
438 (defvar lisp-fill-marker (make-marker)
439 "Keeps track of point so that it does not move during a reindent-lisp.")
441 (defvar ilisp-comment-marker (make-marker)
442 "Marker for end of a comment region.")
445 (defvar lisp-buffer-file nil
446 "Cons of buffer-file-name and the expanded name.")
448 (make-variable-buffer-local 'lisp-buffer-file)
450 (defvar ilisp-last-message nil)
452 (defvar ilisp-last-prompt nil)
454 (defvar lisp-prev-l/c-dir/file nil
455 "Saves the (directory . file) pair used in the last file handling command.
456 A \"file handling command\" may be 'find-file-lisp', 'load-file-lisp'
457 or 'compile-file-lisp' command. Used for determining the default in
460 (defvar ilisp-last-buffer nil
461 "The last used LISP buffer.")
464 ;;; ilisp-bindings-*bind-right-bracket-p*
466 (defcustom ilisp-bindings-*bind-right-bracket-p*
468 "If non-nil the key ']' will be bound to #'close-all-lisp."
469 :group 'ILisp-interaction)
471 ;;; ilisp-bindings-*bind-space-p*
472 (defcustom ilisp-bindings-*bind-space-p*
474 "If non-nil the 'SPACE' key will be bound to #'ilisp-arglist-message-lisp-space."
475 :group 'ILisp-interaction)
477 ;;; ilisp-arglist-message-space-lisp --
479 ;; 19990806 Martin Atzmueller
481 (defvar ilisp-*arglist-message-lisp-space-p* t
482 "If T display the arglist or value of a function/symbol after a #\\Space.
483 Set to 'all if you want the arglist or value of a function/symbol
486 (defvar ilisp-*arglist-message-switch-back-p* nil
487 "If T, the edited buffer is selected after the arglist has been displayed.")
489 (defvar ilisp-*use-frame-for-arglist-output-p* t
490 "If T, ILISP uses a distinct frame for its arglist output.
491 Otherwise ILISP uses the default 'lisp-display-ouput'.
492 The output going to the frame is usually multiline. If no window
493 system is running then the value of this variable is ininfluent.
496 Note: this can be set once before startup. Changing this after startup
497 will not have any effect! This effectively means, that this variable
498 must be set here. It relies on ilisp-*use-frame-for-output*, too.
499 Only if both are t the output will be sent to a frame.")
501 (defvar ilisp-*enable-ilisp-special-frame-p* nil
502 "If T, the ILISP inferior lisp buffer-name will be in
503 special-display-buffer-names; therefore the lisp-interaction buffer
504 will be in a 'special' seperate frame.")
506 (defvar ilisp-*enable-imenu-p* t
507 "Enables/disables loading/use of IMENU.
508 It provides for a index of all functions in a file. Default is T.")
511 ;;; ilisp-enable-easy-menu-p --
513 ;; 19990806 Martin Atzmueller
515 (defvar ilisp-*enable-cl-easy-menu-p* t
516 "Set to t if you want the new (and better!) menu for ILISP CL.")
518 (defvar ilisp-*enable-scheme-easy-menu-p* nil
519 "Set to t if you want the new (and better!) menu for ILISP Scheme.")
522 ;;; ilisp-*enable-ild-support-p*
523 ;;; 19990818 Marco Antoniotti
525 (defvar ilisp-*enable-ild-support-p* t
526 "Enables/disables loading of ILD package by J. M. Siskind.
530 ;;; ilisp-*use-hyperspec-interface-p*
531 ;;; 19990820 Marco Antoniotti
533 (defvar ilisp-*use-hyperspec-interface-p* t
534 "Enables/disables loading of the 'hyperspec' module provided with ILISP.
537 (defvar ilisp-*use-fi-clman-interface-p* nil
538 "Enables/disables use of Franz Inc's 'fi:clman' module.
541 (defvar ilisp-*use-cltl2-interface-p* t
542 "Enables/disables loading of the CLtL2 lookup module provided with ILISP.
545 ;;; end of file -- ilisp-def.lisp --