1. xemacs
  2. ilisp


steve  committed 45ed3aa


  • Participants
  • Branches default
  • Tags xemacs

Comments (0)

Files changed (76)


View file
+Thanks to Guido Bosch, David Braunegg, Tim Bradshaw, Thomas M. Breuel,
+Hans Chalupsky, Kimball Collins, Brian Dennis, David Duff, Tom
+Emerson, Michael Ernst, Scott Fahlman, David Gadbois, Robert
+P. Goldman, Marty Hall, Richard Harris, Jim Healy, Christopher Hoover,
+Larry Hunter, Ben Hyde, Chuck Irvine, Michael Kashket, Mark
+Kantrowitz, Qiegang Long, Erik Naggum, Dan Pierson, Yusuf Pisan, Frank
+Ritter, Jeffrey Mark Siskind, Neil Smithline, Richard Stallman, Larry
+Stead, Jason Trenouth, Christof Ullwer, Bjorn Victor, Fred White, Ben
+Wing, Matsuo Yoshihiro, Jamie Zawinski, Paul Fuqua (for the CMU-CL GC
+display code) and Marco Antoniotti for bug reports, suggestions and
+code.  Our apologies to anyone we may have forgotten.
+Special thanks to Todd Kaufmann for the texinfo file, work on bridge,
+epoch-pop and for really exercising everything.


View file
+This file is part of ILISP.
+Version: 5.8
+Date:    15 July 1996
+Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
+              1993, 1994 Ivan Vasquez
+              1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
+              1996 Marco Antoniotti and Rick Campbell
+Other authors' names for which this Copyright notice also holds
+may appear later in this file.
+Send mail to 'ilisp-request@naggum.no' to be included in the
+ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
+mailing list were bugs and improvements are discussed.
+ILISP if freely redistributable. Eventually it may become part of GNU
+Emacs and it will in that case comply with the GPL.
+For the time being we adopt the following licensing agreement. Such
+licensing agreement may be overridden by the licensing notice
+contained in an individual file and for that file only.
+This software is distributed in the hope that it will be useful (both
+in and of itself and as an example of lisp programming), but WITHOUT
+ANY WARRANTY. The author(s) do not accept responsibility to anyone for
+the consequences of using it or for whether it serves any particular
+purpose or works at all. No warranty is made about the software or its
+Use and copying of this software and the preparation of derivative
+works based on this software are permitted, so long as the following
+conditions are met:
+	o  The copyright notice and this entire notice are included intact
+	   and prominently carried on all copies and supporting documentation.
+	o  No fees or compensation are charged for use, copies, or
+	   access to this software. You may charge a nominal
+	   distribution fee for the physical act of transferring a
+	   copy, but you may not charge for the program itself. 
+	o  If you modify this software, you must cause the modified
+	   file(s) to carry prominent notices (a Change Log)
+	   describing the changes, who made the changes, and the date
+	   of those changes.
+	o  Any work distributed or published that in whole or in part
+	   contains or is a derivative of this software or any part 
+	   thereof is subject to the terms of this agreement. The 
+	   aggregation of another unrelated program with this software
+	   or its derivative on a volume of storage or distribution
+	   medium does not bring the other program under the scope
+	   of these terms.
+	o  Permission is granted to manufacturers and distributors of
+	   lisp compilers and interpreters to include this software
+	   with their distribution. 
+This software is made available AS IS, and is distributed without 
+warranty of any kind, either expressed or implied.
+In no event will the author(s) or their institutions be liable to you
+for damages, including lost profits, lost monies, or other special,
+incidental or consequential damages arising out of or in connection
+with the use or inability to use (including but not limited to loss of
+data or data being rendered inaccurate or losses sustained by third
+parties or a failure of the program to operate as documented) the 
+program, even if you have been advised of the possibility of such
+damanges, or for any claim by any other party, whether in an action of
+contract, negligence, or other tortious action.
+January 4th, 1995
+# end of file -- COPYING --

File ChangeLog

View file
+1998-01-11  SL Baur  <steve@altair.xemacs.org>
+	* Makefile: Update to newer package interface.
+1997-12-24  SL Baur  <steve@altair.xemacs.org>
+	* Makefile: created


View file
+FTP directions
+You can get the distribution file, `ilisp-5.8.tar.gz' via anonymous
+FTP from `FTP.CS.CMU.EDU' ( in
+% ftp ftp.cs.cmu.edu
+Name (ftp.cs.cmu.edu:rickc): anonymous
+331 Guest login ok, send username@node as password.
+ftp> cd /afs/cs/user/campbell/http/ilisp
+250 Directory path set to /afs/cs/user/campbell/http/ilisp.
+ftp> type binary
+200 Type set to I.
+ftp> get ilisp-5.8.tar.gz
+200 PORT command successful.
+150 Opening data connection for ilisp-5.8.tar.gz.
+226 Transfer complete.
+local: ilisp-5.8.tar.gz remote: ilisp-5.8.tar.gz
+168801 bytes received.
+ftp> quit
+221 Goodbye.
+Or get whatever single files you need from the `untarred'
+You can also get `ilisp-5.8.tar.gz' via anonymous FTP from
+`FTP.ICSI.BERKELEY.EDU' in either `/pub/software/elisp/' or
+WWW directions
+You can use the World Wide Web (WWW) to get the distribution file from
+the anonymous FTP locations using one of the following URLs:
+   * ftp://ftp.cs.cmu.edu/afs/cs/user/campbell/http/ilisp/ilisp-5.8.tar.gz
+   * ftp://ftp.icsi.berkeley.edu/pub/software/elisp/ilisp-5.8.tar.gz
+   * ftp://ftp.icsi.berkeley.edu/pub/theory/marcoxa/ilisp-5.8.tar.gz
+   You can also use the CMU Artificial Intelligence Repository:
+   http://www.cs.cmu.edu/Web/Groups/AI/html/repository.html
+From there follow: `LISP', `UTIL', `EMACS' and finally `ILISP'.  Use
+your browser capabilities to download what you need.
+The complete URL for the distribution file in the CMU AI Repository is
+Other URLs for the distribution file include:
+   * http://www.c2.net/~campbell/ilisp/ilisp-5.8.tar.gz
+   * http://www.cs.cmu.edu/~campbell/ilisp/ilisp-5.8.tar.gz


View file
+# -*- Mode: Text -*-
+Version 5.8 alpha
+Fixes and enhancements since 5.7
+-- XLISP and XLISPSTAT support has been added on an experimental way.
+   Please give us feedback on their behavior.
+-- There is now a way to disable the DEFPACKAGE feature for GCL.  But
+   it is not turned on.  You have to fix it manually by transforming two
+   '#+(and nil gcl)' into '#+(and t gcl)'
+-- A few fixes were made to realign ILISP to Xemacs 19.14
+-- The file 'clisp.lisp' has been renamed to 'cl-ilisp.lisp', in order
+   to avoid confusion with the CLISP implementation of Common Lisp.
+-- The file ILISP.prj (if present) can be safely ignored unless you
+   want to use the PRCS project control system
+   (http://http.cs.berkeley.edu/~jmacd/prcs-home.html)
+-- Changed 'comint-ipc' and 'bridge'. They now use
+   'process-send-string' instead of defining specialized versions of
+   it. (This was done because it appears that the newer versions of
+   'comint' have a 'process-send-string' that does what these specialized
+   versions used to do.)
+-- Added constant '+ilisp-emacs-minor-version-number+' (in 'ilcompat').
+-- Conditionalized loading of 'bridge.el' (in 'ilisp').
+-- Fixed the annoying ECL/GCL glitch in 'ilisp-kcl' and the error
+   regexps for KCL and IBCL in the same file
+-- Patched 'comint-ipc' according to suggestion by Kazuhiro Fujieda.
+-- Patched 'ilisp-out'  according to suggestion by Kazuhiro Fujieda.
+Known Bugs
+-- Allegro multiprocessing output handling is still broken.  This is a
+   though one and the maintaners cannot fix it.
+Version 5.7
+Fixes and enhancements since 5.6:
+-- ILISP now unpacks in a directory called ./ilisp-<version>.
+-- Fixed various simple bugs in the init files (hooks et
+   similia). Check 'ilisp.el' and 'ilisp.emacs' for details.
+-- Support for different Emacs versions has been broken down in
+   various version specific files. See:
+	ilcompat.el (new name for compatibility file)
+	ilfsf19.el
+	ilfsf18.el
+	illuc19.el = ilxemacs.el
+-- ILISP is now compiled with version 19 bytecodes when
+   appropriate. (This should work at least for FSF 19.xx).
+-- Added a primitive menubar entry.
+-- Included the bug fixes for source file tracking.
+-- The Makefile now contains a new target called 'loadfile', which
+   generates a file called 'ilisp-all.elc'. This speeds up ILISP sturtup.
+-- Popping to the inferior lisp buffer is now done in a more
+   intelligent way in FSF-19 (i.e. if a frame with the appropriate
+   window is available, then that frame is raised instead of
+   recreating a window in the current one).
+-- The ILD uniform Lisp debugger by J. Siskind has been added to the
+   distribution (file 'ild.mail').  ILD is not integrated yet with
+   ILISP, but it is important enough that people should experiment
+   with it.
+-- The texinfo file has been fixed.
+-- New dialects have been added: GCL, ECL, Harlequin Lispworks, CLISP.
+-- The special-form-p/special-operator-p mess should be fixed (at
+   least in CMUCL).
+-- Cleaned up support for Lucid, Allegro and CMULISP.
+-- The file 'scheme2c.mail' contains a trick to make Scheme->C to work
+   with ILISP.
+-- The file 'ilisp-s2c.el' contains a first cut definition of the
+   Scheme->C dialect. Note that this file is neither byte compiled nor
+   loaded.
+Known bugs:
+-- Keymap handling is still rather inflexible. Either you like the
+   setup or you don't. (A patch by Kimball Collins was not inserted in
+   the code because we feel there should be a more thorough cleanup).
+-- AKCL and GCL may cause an error in the sturtup procedure of ILISP. We (the
+   maintainers) have been unable to track down this one since we have
+   not access to an AKCL or GCL environment. Please help us.
+-- Source level tracking for interpreted code in CMUCL may still break down
+   unexpectedly. This is due to the inner working of CMUCL and there
+   is no easy fix. We try to fall back on the TAG machinery.
+-- The menu entry does not track correctly the status of the inferior
+   lisp. I.e. there is no code yet that disables the menu items when
+   the inferior Lisp is not running anymore.
+-- Package tracking is still somewhat flaky.
+-- Multiprocessing Lisps may still cause problems with prompts. This
+   has been noticed especially with Allegro CL.
+-- The "send the source even if compiled file file exist" bug is still
+   in place.
+Mon, 11 Jul 94 10:48:24 EDT  Version 5.6 Released
+-- Works once again with GNU emacs 19.25, lemacs 19.10. and emacs 18.58.
+-- The popper facility has been completely replaced by a much less
+   intrusive facility which has most of the original functionality.
+   All ilisp output is funneled through the function which is the value 
+   of the variable ilisp-display-output-function.  Several sample display 
+   functions are provided.  Do c-H m in an ilisp buffer for more info.
+-- The common lisp arglist printer has been prettified somewhat.
+-- Ilisp no longer tries to handle lisp errors by default.  This is
+   controlled by the varible ilisp-handle-errors.
+-- Many of the hairy regexps used to located definitions have been
+   broken out into separate variables. One is ilisp-cl-source-locater-patterns,
+   which is an alist of (function-type regexp)
+-- Compile-defun, eval-defun and friends display the returned lisp value.
+-- Defined variables for the init files for the built-in dialects, to ease
+   customization (ilisp-clisp-init-file, etc).
+-- Some handy new functions: ilisp-lispm-bindings, repair-ilisp.
+-- A minor bugfix in ilisp-send.
+-- A simplified makefile.
+Fixes in 5.5:
+-- Now works with lemacs 19.8 (to be released soon) in addition to all
+   the other versions of emacs around.
+Fixes in 5.4:
+-- Added support for CMUCL 17b.
+-- Fixed definition regexp in ilisp-locate-ilisp.   Thanks to Paul
+   Krause.
+-- Hacked popper to make output lines of one line or less get
+   displayed in the message buffer, depending on the variable
+   popper-use-message-buffer.
+Fixes in 5.3:
+-- Fixes some problems in clisp.lisp
+-- Makefile-ilisp now valid for Sun's distributed `make'.
+-- Did the right thing regarding autoloads (yes you have to define them
+in your .emacs, and make them autoload "ilisp".)  See ilisp.emacs
+-- Put the run-hooks calls at the end of ilisp.el where they should
+   be.
+	"Fixes" in version 5.2 of ILISP.  
+Cause more problems with autoloads and fixes a missing definition in the
+Makefile-ilisp in 5.1
+	"Fixes" in version 5.1:
+It removes some correct information concerning autoloads in ilisp.texi
+and ilisp.emacs that was released in 5.0
+Sat Jun 26 14:22:01 1993  Version 5.0 Released
+The major changes from 4.12:
+--Now works with emacs-18, fsf emacs-19, and Lucid emacs-19.
+--Major file splitting done in an attempt to modularize ILISP.
+--Added LISP-DONT-CACHE-PACKAGE lets users tell ILISP to search for the
+most recent IN-PACKAGE on each eval/compile in a lisp buffer.
+--Added 'message feature for lisp-no-popper, allows output from ILISP
+to be sent to the message window (instead of via the popper or the
+inferior lisp buffer) if it is one line long.  Useful for small
+arg-lists, etc. Now the default.  
+--Made the popper be off by default.  To have the popper on, set
+popper-pop-buffers and popper-buffers-to-skip to t in a
+popper-load-hook. See the sample in popper.el
++Support for multiple LISP dialects including Lucid, Allegro, KCL,
+AKCL, IBCL and CMU on multiple machines even at the same time.
++Dynamically sized pop-up windows that can be buried and scrolled from
+any window.
++Packages are properly handled including the distinction between
+exported and internal symbols.
++Synchronous, asynchronous or batch eval and compile of files,
+regions, definitions and sexps with optional switching and automatic
++Arglist, documentation, describe, and macroexpand.
++Completion of filename components and LISP symbols including partial
++Find source both with and without help from the inferior LISP.
+Including CLOS methods, multiple definitions and multiple files.  Also
+works for automatically generated functions like defstruct.
++Edit the callers of a function with and without help from the
+inferior LISP.
++Trace/untrace a function.
++Esc-q works properly on paragraphs in comments, strings and code.
++Find unbalanced parentheses.
++Super brackets.
++Handles editing, entering and indenting full LISP expressions.
++Next/previous and similar history mechanism compatible with comint.
++Handles LISP errors.
++Result histories are maintained in the inferior LISP.
++Does not create spurious symbols and handles case issues.
++Raw keyboard mode allows interaction with interactive programs
+through Emacs.
++Online manuals for ILISP.
+92/03/17 Version 4.12 released
+Changes: Fixed an intermittent send bug.  Made it so that popper is
+not required so aggressively.  Ignore symbolics font information of
+source. Made lisp-end-defun-text so that it would work in non-lisp
+modes. Set the package for ilisp-arglist. Made error dispatch case
+insensitive.  Fixed lisp-directory to add files when lisp-edit-files
+is t.  Fixed clisp.lisp compile for lucid.  Made
+comint-interrupt-subjob interactive. Updated popper to run with emacs
+19.  Fixed popper-wraps so that shell-command gets wrapped at load
+time and changed it to be a function.  Added newline at end of bug
+messages.  Updated the cmulisp interface file to run with the lastest
+CMU CL release. Made sure that *standard-output* and *error-output*
+are bound to *terminal-io*.  Fixed completer so that last completion
+was accurate in the case of interruptions.  Added a path cache to
+completer. Fixed completer so that Meta-return completes to best guess
+and so that the full pattern is used for disambiguation.  Fixed +
+history so that it is saved/restored. Fixed popper so that popping up
+a window when in a popper window resuses the same window and if the
+buffer is changed within a temp-buffer-show form, it works properly.
+Fixed lisp-defun-end so that it no longer includes to the end of the
+line.  Made it so that initialization through commands did not try to
+synchronize with the inferior LISP.  Fixed edit-definitions-lisp so
+that it would work if there is no inferior lisp.  Fixed popper-wrap so
+that it included numeric documentation strings.  Made it so that
+popper preserves the buffer point and scrolling backwards wraps
+around.  Incoroporated the latest version of completion.  Added
+documentation on global-map bindings.  Added
+ilisp-load-no-compile-query.  Added ilisp-use-map so that keymaps can
+be switched in dialect definitions. Added completer-any-delimiter to
+completer. Fixed bug in completer that caused relative file names to
+get erased. Fixed popper so that it handled killed buffers, popped
+faster and had negative buffer lists.  Fixed it so that
+dialect-program doesn't get stomped by loading ilisp.  Made it so that
+ilisp-bug doesn't stomp on someone's unfinished message.  Look for
+both .elc and .el files for setting ilisp-directory. Fixed a bug in
+lucid that prevented compilation of the interface files on some
+implementations.  Fixed epoch-pop so that it quits nicer.  Fixed bug
+in CMU LISP interface.  Added *features* to ilisp-bug.  Fixed bugs in
+completer when extending directories and for Apollo and AFS.  Fixed
+popper so that it does not remove the trailing newline.  Made
+lisp-buffer smart about killed buffers.
+91/05/08 Version 4.11 released
+Changes: Improved the way that completer handled filenames ending with
+a / and relative pathnames.  Added popper-wrap to popper for functions
+that don't use with-output-to-temp-buffer.  Added popper-empty-min and
+popper-min-heights. Made popper-pop-buffers and popper-buffers-to-skip
+default to t.  Fixed lisp-prefix-p so that reusing completion tables
+works better. Fixed a bug in lisp-end-defun-text that made things
+weird when people did not use ;;; for top comment blocks. Improved
+ilisp-bug so that it gives more information and is less likely to
+break.  Put interface files in their own package.  Changed
+ilisp-compile to funcall of compile for all except lucid.  Fixed a bug
+in lisp-pop-to-buffer that put the lisp in the popper buffer.  Fixed a
+bug in ilisp-matching-symbols that prevented pattern matching with a
+pattern that matched the last word.  Bare CR's now send an empty
+string.  Made it so that allegro init binary extensions default to
+excl:*fasl-default-type* unless on a known platform.  Added fboundp to
+generic-function-p in ilisp-arglist.  Fixed KCL and friends dialects.
+Fixed a couple of small bugs in completer.  Added raw keyboard mode.
+Fixed lisp-pop-to-buffer so that the buffer was always selected which
+fixed a bug in edit-definitions and friends.  Removed space from KCL
+comint-prompt-regexp.  Added inspect-lisp.  Fixed a bug in popper-show
+that complained if buffer was a string and fixed call in
+who-calls-lisp.  Fixed some bugs in completer that completed too much
+for local returns and that nuked the string if confirmation was
+91/03/19 Version 4.10 released
+Changes: Changed the default binding of close-and-send-lisp.  Added
+better dialect support for kcl, akcl, and ibcl.  Improved the run-time
+detection of PCL/CLOS in clisp.lisp.  Fixed a nasty popper bug if you
+tried to pop up a window when in a popper window.  Made it so that
+popper-other-window would switch to the popper window when called with
+a C-u prefix.  Added support for allegro 4.0. Made lisp-in-string
+smarter about escaped " so that close-all-lisp worked better.  Renamed
+reparse-attribute-list and made it so that you can specify manual
+packages.  Improved partial completion of symbols so that it goes to
+the ambiguous part.  Changed it so that uncompiled interface files
+complain rather than compile.  Improved completer so that it completes
+pathname components.  Made it so that dialects could be started up
+with emacs switches.  Incorporated a new fancier version of
+reposition-window-lisp.  Fixed restore so that it no longer printed
+messages when there were multiple line values restored.  Added
+trace-function-lisp.  Improved lisp-function-name when it is in a
+string.  Changed initialization so that there is a dialect specific
+program variable and the defaults are better and sticky.
+lucid-check-prompt was hosed which of course broke everything in
+Lucid.  Fixed load-file-lisp so that it allows interaction and senses
+compile errors better.  Added process bridges.  Added
+comint-always-scroll.  Made allegro macroexpand so that it would walk
+instead.  Fixed popper so that switching to the popper buffer worked.
+Fixed close-all-lisp so that it did not blow away # or ' at start of
+sexp.  Fixed ilisp-buffer so that it complained if the buffer was
+killed out from under it.  Changed ilisp-filter-regexp to filter all
+lone keywords.  Added prefix arg to documentation-lisp so that
+function call doc could be gotten.  Set ilisp-directory in
+initialization so that it could be built into Emacs image.  Added
+Franz online common lisp manual.  Added reset-ilisp to reset to
+top-level and made it so that delete-char would pop one level at the
+end.  Added call-defun-lisp and bound it to C-z y.  Fixed the binding
+for popper-grow-output.  Added lisp-no-popper to stop using popper.
+Fixed compile-defun-lisp so that it would compile the previous form in
+the inferior LISP.  Made it so that the entire in-package sexp is sent
+to the inferior so that nicknames get set.  Added package-lisp and
+set-package-lisp.  Removed eval-prev-sexp-lisp and made
+eval-next-sexp-lisp do that with a negative prefix.  Fixed
+lisp-defun-name so that it returned just the function name.  Added
+lisp-region-name to better name regions.  Improved messages in
+interrupt-subjob-lisp.  Added sit-for to all accept-process-output
+loops to prevent locking up Emacs in Sys V.  Changed how
+comment-region-lisp treated the end of the region and fixed a nasty
+bug for a region including the eob.  Made changes to clisp.lisp for
+lucid and kcl.  Added better kcl dialect definition.  Made it so that
+end-of-defun-lisp would require ;;; at the left margin to decide that
+the next definition had started.  Made it so that multiple sexps could
+be typed to the top-level.  Made it so that all popper windows could
+be skipped.  Simplified the ilisp-package-regexp.
+90/12/30 Version 4.00 released
+IMPROVEMENTS: Process stuff has been rewritten and much improved.  If
+you prefer the old eval/compile behavior, set lisp-wait-p to t in your
+ilisp-load-hook.  Improved edit-definitions and edit-callers so that
+they support multiple definitions of any LISP object even if the
+inferior LISP does not store the information.  Added support for
+Epoch.  Separated out lisp-mode extensions, symlink fix, source stuff
+and batch eval/compile.  Lots of minor improvements, see details
+INCOMPATIBLE CHANGES: Renamed interactive functions to put package
+specification at the end so that names were quicker to specify and
+some internal functions so that they were unique to ilisp.
+ilisp-clisp now takes the full file name.  ilisp-load-or-send-command
+now takes the binary and source paths explicitly.  The ilisp- prefix
+was removed from dialect file names.  ilisp-definition-regexp has gone
+away.  ilisp-prompt, ilisp-fix-error and ilisp-continue have gone away
+in favor of the actual comint- variables.  ilisp-expand-symlinks has
+gone away. 
+DETAILS: Finally fixed up how many newlines are inserted.  Made it so
+that the source file stuff would use a resident buffer with the same
+name if available.  Added ilisp-filter-length to the input filter.
+When reading a symbol, the inferior lisp is no longer queried with an
+empty string.  newline-and-indent-ilisp will send a string w/o a new
+line if called at the end of a buffer.  This was so that raw character
+i/o could be done in some lisps.  All comint and comint-ipc variables
+can now be set in hooks and the right thing will happen.  Made
+lisp-end-defun-text skip over leading comments.  Added the functions
+search-in-lisp-files and replace-in-lisp-files.  Prevented the
+addition of duplicate entries to the input ring and expanded its size
+to 200 entries.  Made lisp-def-name so that it adds the name of the
+defining form and returns an empty string at the end of a buffer.
+Swapped bindings of macroexpand-lisp and macroexpand-1-lisp.  Fixed
+expand-file-name bug if // was at the start of a filename.  Fixed
+obscure bug in make-local-variable.  Added ilisp-other-prompt and
+bol-ilisp.  Added case-fold-search to appropriate places.  Fixed error
+recovery in ilisp-completer.  Removed extra parentheses in the string
+for ilisp-init-binary-command.  Added documentation on scrolling the
+popper window backwards.  Fixed comment-region so that it handles
+empty lines and deleting spaces at the start.  Fixed behavior of
+reindent-lisp on comments at the start and end of a buffer.  Saved the
+point in reposition-window-lisp.  Rewrote close-all-lisp so that it
+inserted a bracket if in a string and was better behaved WRT non sexp
+brackets and so that it could close all brackets.  Removed breaks in
+lisp-end-defun-text for unclosed strings.  Added comint-check-prompt
+to comint-ipc so that dialects can be smarter about errors.  Added
+ilisp-check-prompt and allegro and lucid definitions.  Changed
+edit-callers so that it uses the name of the current defun as its
+default.  Changed popper so that it handles more windows, removes
+trailing lines, is nicer about bindings and added popper-grow-output.
+Also added epoch-pop for epoch.  Made lisp-input-start work if the
+point was at the start of the line the prompt was on.  This made
+reindent-lisp and close-all-lisp work in ilisp mode.  Added
+close-and-send-lisp.  Made it so that bindings are only done after the
+hooks are run.  Shorter clisp error messages.  Removed
+ilisp-definition-regexp and replaced it with ilisp-locator.  Made
+message optional in ilisp-send and ilisp-send-string.  Added a startup
+message to ilisp buffers.  Made it so that there is filename
+completion when prompting for lisp program.  Fixed bug in
+ilisp-load-init.  Made it so that if an eval/compile worked normally,
+no message was displayed.  Fixed lucid ilisp-list-callers so that it
+does not recurse forever.  Changed lisp-list-callers to who-calls-lisp
+and made it so that it would display the buffer.  Added ilisp-dialect
+as a list of dialect names for the inferior LISP.  Added partial
+minibuffer completion.  Improved filename completion help in
+complete-lisp.  Added ilisp-bug for bug reporting. Improved case
+handling for clisp.  popper v2.00, completer v2.00.
+10/12/90 Version 3.0 released.  Improved pop-up windows, symbol
+completion, package handling, compilation and initialization.
+Changed default binding prefix.  Added trace/untrace and
+evaluation of defvars.
+ 8/22/90 Version 2.0 released. Fixed bugs and changed initialization.
+ 6/11/90 Version 1.0 released.


View file
+-*- Mode: Text -*-
+ILISP assumes a minimum of CLtL2 compliance. This requirements
+immediately clashes with the problems of some KCL-derivativs,
+including GCL.  Here is a list of known problems for several CL
+implementations (we do not know whether there are problems with
+Scheme's - please let us know).
+o All dialects
+	Be sure that the variables:
+	ilisp-binary-extension
+	ilisp-init-binary-extension
+	ilisp-binary-command
+	Have the appropriate value.  Older versions of ILISP (< 5.8)
+	assumed a single CL installation and suggested a change to the
+	hook 'ilisp-site-hook' in the 'ilisp.emacs' file.
+	This should not be so anymore.
+o KCL, AKCL, Ibuki, GCL, and ECL
+	  You need to have your system configured with a
+	  DEFPACKAGE. You can either generate an image which contains
+	  it or you can arrange the init file to load it for you.
+	  You can find a DEFPACKAGE in the AI.Repository of CMU.
+	- LOOP
+	  Most likely the DEFPACKAGE will require a full fledged LOOP.
+	  The same instructions apply.
+	Try to set the variables:
+	cmulisp-source-directory-regexp
+	cmulisp-local-source-directory
+	To sensible values.
+o Harlequin
+	No known extra installation glitches
+o Lucid
+	No known extra installation glitches
+o Allegro
+	No known extra installation glitches
+	No known extra installation glitches

File Makefile

View file
+# Makefile for ILISP/Inferior Lisp code
+# This file is part of XEmacs.
+# XEmacs is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+# XEmacs is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+# You should have received a copy of the GNU General Public License
+# along with XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+VERSION = 1.02
+PACKAGE = ilisp
+PKG_TYPE = regular
+REQUIRES = xemacs-base
+ELCS = bridge.elc comint-ipc.elc comint-v18.elc completer.elc \
+	completer.new.elc completer.no-fun.elc ilcompat.elc ilfsf18.elc \
+	ilfsf19.elc ilisp-acl.elc ilisp-aut.elc ilisp-bat.elc ilisp-bug.elc \
+	ilisp-chs.elc ilisp-cl.elc ilisp-cmp.elc ilisp-cmt.elc ilisp-cmu.elc \
+	ilisp-cpat.elc ilisp-def.elc ilisp-dia.elc ilisp-doc.elc ilisp-el.elc \
+	ilisp-ext.elc ilisp-hi.elc ilisp-hlw.elc ilisp-hnd.elc ilisp-ind.elc \
+	ilisp-inp.elc ilisp-kcl.elc ilisp-key.elc ilisp-kil.elc ilisp-low.elc \
+	ilisp-luc.elc ilisp-mak.elc ilisp-menu.elc ilisp-mnb.elc \
+	ilisp-mod.elc ilisp-mov.elc ilisp-out.elc ilisp-prc.elc ilisp-prn.elc \
+	ilisp-rng.elc ilisp-s2c.elc ilisp-sch.elc ilisp-snd.elc ilisp-src.elc \
+	ilisp-sym.elc ilisp-utl.elc ilisp-val.elc ilisp-xfr.elc ilisp-xls.elc \
+	ilisp.elc illuc19.elc ilxemacs.elc
+INFO_FILES = ilisp.info*
+PRELOADS = -eval "(push \"`pwd`\" load-path)" -l ./ilcompat.el -l ./ilisp-dia.el
+include ../../XEmacs.rules
+all:: $(ELCS) auto-autoloads.elc ilisp.info
+srckit: srckit-std
+binkit: binkit-sourceinfo

File Makefile.rm

View file
+# -*- Mode: Makefile -*-
+# Makefile --
+# This file is part of ILISP.
+# Version: 5.8
+# Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
+#               1993, 1994 Ivan Vasquez
+#               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
+#               1996 Marco Antoniotti and Rick Campbell
+# Send mail to 'ilisp-request@naggum.no' to be included in the
+# ILISP mailing list.
+# Note: this makefile assumes GNU make
+# Updated for XEmacs autoloads builds, but unused at present since no
+#  autoloads are generated, and this package hasn't been customized.
+# Various Variables
+Version = 5.8
+# Use whichever you like most
+#EMACS = xemacs
+#EMACS = /usr/local/bin/emacs
+EMACS = emacs
+# The SHELL variable is used only for making the distribution.
+#SHELL = /bin/csh
+# Tsk, tsk, Though shalt not use csh in distributed scripts.
+SHELL = /bin/sh
+# These are used mostly for packaging the distribution
+Ilisp_src_dir = $(shell pwd)
+Ilisp_tar_dir = ilisp-$(Version)
+OtherFiles = README         \
+             HISTORY        \
+             Makefile       \
+             ilisp.emacs    \
+             INSTALLATION   \
+             COPYING        \
+             GETTING-ILISP  \
+             Welcome
+DocFiles = ilisp.texi
+LoadFiles = ilisp-def.elc ilisp-el.elc ilisp-sym.elc \
+ ilisp-inp.elc ilisp-ind.elc ilisp-prc.elc ilisp-val.elc ilisp-out.elc \
+ ilisp-mov.elc ilisp-key.elc ilisp-prn.elc ilisp-low.elc ilisp-doc.elc \
+ ilisp-ext.elc ilisp-mod.elc ilisp-dia.elc ilisp-cmt.elc ilisp-rng.elc \
+ ilisp-hnd.elc ilisp-utl.elc ilisp-cmp.elc ilisp-kil.elc ilisp-snd.elc \
+ ilisp-xfr.elc ilisp-hi.elc ilisp-aut.elc ilisp-cl.elc ilisp-cmu.elc \
+ ilisp-acl.elc ilisp-kcl.elc ilisp-luc.elc ilisp-sch.elc ilisp-hlw.elc \
+ ilisp-xls.elc
+# Rules
+	$(EMACS) -batch -l ilisp-mak.el
+elc: $(LoadFiles) $(XEmacsELC)
+$(LoadFiles) :
+	$(EMACS) -batch -l ilisp-mak.el
+	etags *.el
+	$(RM) *.elc
+	touch ilisp-all.elc
+	cat $(LoadFiles) > ilisp-all.elc
+	rm $(LoadFiles)
+# Note that the redirection is done by a Bourne Shell.
+	gzip *.el $(OtherFiles) $(DocFiles)
+# The following targets are used only to create a distribution file.
+dist: tarring dist_compressing
+	(cd $(Ilisp_src_dir)/..;                                        \
+         if ( $(notdir $(Ilisp_src_dir)) != $(Ilisp_tar_dir) )          \
+            ln -s $(notdir $(Ilisp_src_dir)) $(Ilisp_tar_dir) ;         \
+         tar cvf $(Ilisp_tar_dir).tar                                   \
+            $(patsubst %,$(Ilisp_tar_dir)/%,$(OtherFiles))              \
+            $(Ilisp_tar_dir)/*.el                                       \
+            $(Ilisp_tar_dir)/*.lisp                                     \
+            $(patsubst %,$(Ilisp_tar_dir)/%,$(DocFiles))                \
+            $(Ilisp_tar_dir)/*.mail)
+	(cd $(Ilisp_src_dir)/.. ; gzip $(Ilisp_tar_dir).tar)
+uuencoding: ../$(Ilisp_tar_dir).tar.gz
+	(cd $(Ilisp_src_dir)/.. ;                                           \
+         uuencode $(Ilisp_tar_dir).tar.gz $(Ilisp_tar_dir).tar.gz > il.uue)
+#autoloads: auto-autoloads.el
+#custom-load.elc: custom-load.el
+#	$(EMACS) -batch -q -no-site-file -f batch-byte-compile $?
+#auto-autoloads.el: $(LoadFiles:.elc=.el)
+#	$(EMACS) -batch -q -no-site-file \
+#		-eval '(setq autoload-target-directory "'`pwd`'/")' \
+#		-l autoload \
+#		-f batch-update-autoloads $?
+# end of file -- Makefile --


View file
+ILISP is a powerful GNU Emacs interface to many dialects of Lisp,
+including Lucid, Allegro, Harlequin LispWorks, GCL, KCL, AKCL, ECL, IBCL,
+and CMUCL.
+Written by Chris McConnell <ccm+@cs.cmu.edu> and now maintained by
+Marco Antoniotti <marcoxa@icsi.berkeley.edu> and
+Rick Campbell <campbell@c2.net>.
+Please refer to the following files in this directory:
+ HISTORY:	A detailed summary of changes over the course of ILISP's
+		existence.
+ GETTING-ILISP:	Directions for obtaining this collection using
+		anonymous FTP.
+ INSTALLATION:	Directions about how to install ILISP and specific
+		dialect needs.
+Please send bug reports, questions, suggestions, etc. to:
+  ILISP Discussion <ilisp@naggum.no>
+Please address all list administration messages, such as requests to
+subscribe or unsubscribe from ilisp@naggum.no, to:
+  ILISP Administrivia <ilisp-request@naggum.no>
+See http://www.c2.net/~campbell/ilisp/ or
+http://www.cs.cmu.edu/~campbell/ilisp/ for more information.

File Welcome

View file
+Welcome to the ILISP Discussion mailing list.
+ILISP is a GNU Emacs package for controlling an inferior process
+running a lisp dialect.  You can get ILISP by anonymous ftp at
+FTP.CS.CMU.EDU in the directory /afs/cs/user/campbell/http/ilisp/.
+Also you can find ILISP by getting to the AI.Repository via the WWW.
+From there follow: LISP, UTIL, EMACS and finally ILISP
+Other archive sites include:
+ ftp://ftp.icsi.berkeley.edu/pub/software/elisp/
+ http://www.c2.net/~campbell/ilisp/
+ http://www.cs.cmu.edu/~campbell/ilisp/
+ILISP is currently being maintained by Marco Antoniotti
+<marcoxa@icsi.berkeley.edu> and Rick Campbell <campbell@c2.net>.
+The mailing list is maintained by Erik Naggum <erik@naggum.no>.
+Please address all list administration messages, such as requests to
+subscribe or unsubscribe, to:
+ ILISP Administrivia <ilisp-request@naggum.no>
+Please allow a little time;
+there's no list server programming running, the list is maintained by
+To send a message to everyone on the list, address it to:
+ ILISP Discussion <ilisp@naggum.no>
+The list has had a very low volume lately, so you may not see messages
+for a while after subscribing.
+Please note that there is no "bug" list like ilisp-bugs@naggum.no.
+The primary list serves the purpose of a general bug fix and
+discussion area.

File allegro.lisp

View file
+;;; -*- Mode: Lisp -*-
+;;; allegro.lisp --
+;;; This file is part of ILISP.
+;;; Version: 5.8
+;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
+;;;               1993, 1994 Ivan Vasquez
+;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
+;;;               1996 Marco Antoniotti and Rick Campbell
+;;; Other authors' names for which this Copyright notice also holds
+;;; may appear later in this file.
+;;; Send mail to 'ilisp-request@naggum.no' to be included in the
+;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
+;;; mailing list were bugs and improvements are discussed.
+;;; ILISP is freely redistributable under the terms found in the file
+;;; Allegro initializations
+;;; Author: Chris McConnell, ccm@cs.cmu.edu
+(in-package "ILISP")
+(defun ilisp-callers (symbol package)
+  "Print a list of all of the functions that call FUNCTION and return
+T if successful." 
+  (ilisp-errors
+   (let ((function (ilisp-find-symbol symbol package))
+	 (callers nil)
+	 (*print-level* nil)
+	 (*print-length* nil)
+	 (*package* (find-package 'lisp)))
+     (when (and function (fboundp function))
+       (labels ((in-expression (function expression)
+		  (cond ((null expression) nil)
+			((listp expression)
+			 (let ((header (first expression)))
+			   (if (or (eq header function)
+				   (and (eq header 'function)
+					(eq (second expression) function)))
+			       t
+			       (dolist (subexp expression)
+				 (when (in-expression function subexp)
+				   (return t)))))))))
+	 (excl::who-references
+	  function
+	  #'(lambda (function)
+	      (push (excl::fn_symdef function) callers)))
+	 (do-all-symbols (symbol)
+	   (when (and (fboundp symbol)
+		      (not (compiled-function-p (symbol-function symbol)))
+		      (in-expression function (symbol-function symbol)))
+	     (push symbol callers)))
+	 (dolist (caller callers)
+	   (print caller))
+	 t)))))
+(defun ilisp-source-files (symbol package type)
+  "Print each file for PACKAGE:SYMBOL's TYPE definition on a line and
+return T if successful."
+  (ilisp-errors
+   (let* ((symbol (ilisp-find-symbol symbol package))
+	  (type (if (equal type "any") t (ilisp-find-symbol type "keyword")))
+	  (paths (when symbol (excl:source-file symbol type))))
+     (if paths
+	 (progn
+	   (if (eq type t)
+	       (dolist (path (remove-duplicates paths
+						:key #'cdr :test #'equal))
+		 (print (namestring (cdr path))))
+	       (print (namestring paths)))
+	   t)
+	 nil))))
+(dolist (symbol '(ilisp-callers ilisp-source-files))
+  (export symbol))
+(unless (compiled-function-p #'ilisp-callers)
+  (format t "\"ILISP: File is not compiled, use M-x ilisp-compile-inits\""))

File bridge.el

View file
+;;; -*-Emacs-Lisp-*-
+;;; Bridge process filter, V1.0
+;;; Copyright (C) 1991 Chris McConnell, ccm@cs.cmu.edu  
+;;; Send mail to ilisp@naggum.no if you have problems.
+;;; Send mail to ilisp-request@naggum.no if you want to be on the
+;;; ilisp mailing list.
+;;; This file is part of GNU Emacs.
+;;; GNU Emacs is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY.  No author or distributor
+;;; accepts responsibility to anyone for the consequences of using it
+;;; or for whether it serves any particular purpose or works at all,
+;;; unless he says so in writing.  Refer to the GNU Emacs General Public
+;;; License for full details.
+;;; Everyone is granted permission to copy, modify and redistribute
+;;; GNU Emacs, but only under the conditions described in the
+;;; GNU Emacs General Public License.   A copy of this license is
+;;; supposed to have been given to you along with GNU Emacs so you
+;;; can know your rights and responsibilities.  It should be in a
+;;; file named COPYING.  Among other things, the copyright notice
+;;; and this notice must be preserved on all copies.
+;;; Send any bugs or comments.  Thanks to Todd Kaufmann for rewriting
+;;; the process filter for continuous handlers.
+;;; USAGE: M-x install-bridge will add a process output filter to the
+;;; current buffer.  Any output that the process does between
+;;; bridge-start-regexp and bridge-end-regexp will be bundled up and
+;;; passed to the first handler on bridge-handlers that matches the
+;;; output using string-match.  If bridge-prompt-regexp shows up
+;;; before bridge-end-regexp, the bridge will be cancelled.  If no
+;;; handler matches the output, the first symbol in the output is
+;;; assumed to be a buffer name and the rest of the output will be
+;;; sent to that buffer's process.  This can be used to communicate
+;;; between processes or to set up two way interactions between Emacs
+;;; and an inferior process.
+;;; You can write handlers that process the output in special ways.
+;;; See bridge-send-handler for the default handler.  The command
+;;; hand-bridge is useful for testing.  Keep in mind that all
+;;; variables are buffer local.
+;;; ;;; Set up load path to include bridge
+;;; (setq load-path (cons "/bridge-directory/" load-path))
+;;; (autoload 'install-bridge "bridge" "Install a process bridge." t)
+;;; (setq bridge-hook 
+;;;       '(lambda ()
+;;;         ;; Example options
+;;;         (setq bridge-source-insert nil) ;Don't insert in source buffer
+;;;         (setq bridge-destination-insert nil) ;Don't insert in dest buffer
+;;;         ;; Handle copy-it messages yourself
+;;;         (setq bridge-handlers
+;;;          '(("copy-it" . my-copy-handler)))))
+;;; # This pipes stdin to the named buffer in a Unix shell
+;;; alias devgnu '(echo -n "\!* "; cat -; echo -n "
+;;; ls | devgnu *scratch*
+(defvar bridge-hook nil
+  "Hook called when a bridge is installed by install-hook.")
+(defvar bridge-start-regexp ""
+  "*Regular expression to match the start of a process bridge in
+process output.  It should be followed by a buffer name, the data to
+be sent and a bridge-end-regexp.")
+(defvar bridge-end-regexp "
+  "*Regular expression to match the end of a process bridge in process
+(defvar bridge-prompt-regexp nil
+  "*Regular expression for detecting a prompt.  If there is a
+comint-prompt-regexp, it will be initialized to that.  A prompt before
+a bridge-end-regexp will stop the process bridge.")
+(defvar bridge-handlers nil
+  "Alist of (regexp . handler) for handling process output delimited
+by bridge-start-regexp and bridge-end-regexp.  The first entry on the
+list whose regexp matches the output will be called on the process and
+the delimited output.")
+(defvar bridge-source-insert t
+  "*T to insert bridge input in the source buffer minus delimiters.")
+(defvar bridge-destination-insert t
+  "*T for bridge-send-handler to insert bridge input into the
+destination buffer minus delimiters.")
+(defvar bridge-chunk-size 512
+  "*Long inputs send to comint processes are broken up into chunks of
+this size.  If your process is choking on big inputs, try lowering the
+;;;%Internal variables
+(defvar bridge-old-filter nil
+  "Old filter for a bridged process buffer.")
+(defvar bridge-string nil 
+  "The current output in the process bridge.")
+(defvar bridge-in-progress nil
+  "The current handler function, if any, that bridge passes strings on to,
+or nil if none.")
+(defvar bridge-send-to-buffer nil
+  "The buffer that the default bridge-handler (bridge-send-handler) is
+currently sending to, or nil if it hasn't started yet.  Your handler
+function can use this variable also.")
+(defvar bridge-last-failure ()
+  "Last thing that broke the bridge handler.  First item is function call
+(eval'able); last item is error condition which resulted.  This is provided
+to help handler-writers in their debugging.")
+(defun bridge-insert (output)
+  "Insert process OUTPUT into the current buffer."
+  (if output
+      (let* ((buffer (current-buffer))
+	     (process (get-buffer-process buffer))
+	     (mark (process-mark process))
+	     (window (selected-window))
+	     (at-end nil))
+	(if (eq (window-buffer window) buffer)
+	    (setq at-end (= (point) mark))
+	    (setq window (get-buffer-window buffer)))
+	(save-excursion
+	  (goto-char mark)
+	  (insert output)
+	  (set-marker mark (point)))
+	(if window 
+	    (progn
+	      (if at-end (goto-char mark))
+	      (if (not (pos-visible-in-window-p (point) window))
+		  (let ((original (selected-window)))
+		    (save-excursion
+		      (select-window window)
+		      (recenter '(center))
+		      (select-window original)))))))))
+;(defun bridge-send-string (process string)
+;  "Send PROCESS the contents of STRING as input.
+;This is equivalent to process-send-string, except that long input strings
+;are broken up into chunks of size comint-input-chunk-size. Processes
+;are given a chance to output between chunks. This can help prevent processes
+;from hanging when you send them long inputs on some OS's."
+;  (let* ((len (length string))
+;	 (i (min len bridge-chunk-size)))
+;    (process-send-string process (substring string 0 i))
+;    (while (< i len)
+;      (let ((next-i (+ i bridge-chunk-size)))
+;	(accept-process-output)
+;	(process-send-string process (substring string i (min len next-i)))
+;	(setq i next-i)))))
+(defun bridge-call-handler (handler proc string)
+  "Funcall HANDLER on PROC, STRING carefully.  Error is caught if happens,
+and user is signaled.  State is put in bridge-last-failure.  Returns t if
+handler executed without error."
+  (let ((inhibit-quit nil)
+	(failed nil))
+    (condition-case err
+	(funcall handler proc string)
+      (error
+       (ding)
+       (setq failed t)
+       (message "bridge-handler \"%s\" failed %s (see bridge-last-failure)"
+		handler err)
+       (setq bridge-last-failure
+	     (` ((funcall '(, handler) '(, proc) (, string))
+		 "Caused: "
+		 (, err))))))
+    (not failed)))
+(defun bridge-send-handler (process input)
+  "Send PROCESS INPUT to the buffer name found at the start of the
+input.  The input after the buffer name is sent to the buffer's
+process if it has one.  If bridge-destination-insert is T, the input
+will be inserted into the buffer.  If it does not have a process, it
+will be inserted at the end of the buffer."
+  (if (null input)
+      (setq bridge-send-to-buffer nil)  ; end of bridge
+      (let (buffer-and-start buffer-name dest to)
+	;; if this is first time, get the buffer out of the first line
+	(cond ((not bridge-send-to-buffer)
+	       (setq buffer-and-start (read-from-string input)
+		     buffer-name (format "%s" (car (read-from-string input)))
+		     dest        (get-buffer buffer-name)
+		     to          (get-buffer-process dest)
+		     input (substring input (cdr buffer-and-start)))
+	       (setq bridge-send-to-buffer dest))
+	      (t
+	       (setq buffer-name bridge-send-to-buffer
+		     dest        (get-buffer buffer-name)
+		     to          (get-buffer-process dest)
+		     )))
+	(if dest
+	    (let ((buffer (current-buffer)))
+	      (if bridge-destination-insert
+		  (unwind-protect
+		       (progn
+			 (set-buffer dest)
+			 (if to 
+			     (bridge-insert input)
+			     (goto-char (point-max))
+			     (insert input)))
+		    (set-buffer buffer)))
+	      (if to
+		  ;; (bridge-send-string to input)
+		  (process-send-string to input)
+		  ))
+	    (error "%s is not a buffer" buffer-name)))))
+(defun bridge-filter (process output)
+  "Given PROCESS and some OUTPUT, check for the presence of
+bridge-start-regexp.  Everything prior to this will be passed to the
+normal filter function or inserted in the buffer if it is nil.  The
+output up to bridge-end-regexp will be sent to the first handler on
+bridge-handlers that matches the string.  If no handlers match, the
+input will be sent to bridge-send-handler.  If bridge-prompt-regexp is
+encountered before the bridge-end-regexp, the bridge will be cancelled."
+   (let ((inhibit-quit t)
+	 (match-data (match-data))
+	 (buffer (current-buffer))
+	 (process-buffer (process-buffer process))
+	 (case-fold-search t)
+	 (start 0) (end 0)
+	 function
+	 b-start b-start-end b-end)
+     (set-buffer process-buffer) ;; access locals
+     (setq function bridge-in-progress)
+     ;; How it works:
+     ;;
+     ;; start, end delimit the part of string we are interested in;
+     ;; initially both 0; after an iteration we move them to next string.
+     ;; b-start, b-end delimit part of string to bridge (possibly whole string);
+     ;; this will be string between corresponding regexps.
+     ;; There are two main cases when we come into loop:
+     ;;  bridge in progress
+     ;;0    setq b-start = start
+     ;;1    setq b-end (or end-pattern end)
+     ;;4    process string
+     ;;5    remove handler if end found
+     ;;  no bridge in progress
+     ;;0    setq b-start if see start-pattern
+     ;;1    setq b-end if bstart to (or end-pattern end)
+     ;;2    send (substring start b-start)  to normal place
+     ;;3    find handler (in b-start, b-end) if not set
+     ;;4    process string
+     ;;5    remove handler if end found
+     ;; equivalent sections have the same numbers here;
+     ;; we fold them together in this code.
+     (unwind-protect
+	(while (< end (length output))
+	  ;;0    setq b-start if find
+	  (setq b-start
+		(cond (bridge-in-progress
+		       (setq b-start-end start)
+		       start)
+		      ((string-match bridge-start-regexp output start)
+		       (setq b-start-end (match-end 0))
+		       (match-beginning 0))
+		      (t nil)))
+	  ;;1    setq b-end
+	  (setq b-end
+		(if b-start
+		    (let ((end-seen (string-match bridge-end-regexp
+						  output b-start-end)))
+		      (if end-seen (setq end (match-end 0)))
+		      end-seen)))
+	  (if (not b-end) (setq end   (length output)
+				b-end (length output)))
+	  ;;1.5 - if see prompt before end, remove current
+	  (if b-start
+	      (let ((prompt (string-match bridge-prompt-regexp
+					  output b-start-end)))
+		(if (and prompt (<= (match-end 0) b-end))
+		    (setq b-start nil  ; b-start-end start
+			  b-end   start
+			  end     (match-end 0)
+			  bridge-in-progress nil
+			  ))))
+	  ;;2    send (substring start b-start) to old filter, if any
+	  (if (/= start (or b-start end)) ; don't bother on empty string
+	      (let ((pass-on (substring output start (or b-start end))))
+		(if bridge-old-filter
+		    (let ((old bridge-old-filter))
+		      (store-match-data match-data)
+		      (funcall old process pass-on)
+		      ;; if filter changed, re-install ourselves
+		      (let ((new (process-filter process)))
+			(if (not (eq new 'bridge-filter))
+			    (progn (setq bridge-old-filter new)
+				   (set-process-filter process 'bridge-filter)))))
+		    (set-buffer process-buffer)
+		    (bridge-insert pass-on))))
+	  ;;3 find handler (in b-start, b-end) if none current
+	  (if (and b-start (not bridge-in-progress))
+	      (let ((handlers bridge-handlers))
+		(while (and handlers (not function))
+		  (let* ((handler (car handlers))
+			 (m (string-match (car handler) output b-start-end)))
+		    (if (and m (< m b-end))
+			(setq function (cdr handler))
+			(setq handlers (cdr handlers)))))
+		;; Set default handler if none
+		(if (null function)
+		    (setq function 'bridge-send-handler))
+		(setq bridge-in-progress function)))
+	  ;;4    process string
+	  (if function
+	      (let ((ok t))
+		(if (/=  b-start-end b-end)
+		    (let ((send (substring output b-start-end b-end)))
+		      ;; also, insert the stuff in buffer between
+		      ;; iff bridge-source-insert.
+		      (if bridge-source-insert (bridge-insert send))
+		      ;; call handler on string
+		      (setq ok (bridge-call-handler function process send))))
+		;;5    remove handler if end found
+		;; if function removed then tell it that's all
+		(if (or (not ok) (/= b-end end));; saw end before end-of-string
+		    (progn
+		      (bridge-call-handler function process nil)
+		      ;; have to remove function too for next time around
+		      (setq function nil
+			    bridge-in-progress nil)
+		      ))
+		))
+	     ;; continue looping, in case there's more string
+	     (setq start end)
+	     ))
+       ;; protected forms:  restore buffer, match-data
+       (set-buffer buffer)
+       (store-match-data match-data)
+       ))
+(defun install-bridge ()
+  "Set up a process bridge in the current buffer."
+  (interactive)
+  (if (not (get-buffer-process (current-buffer)))
+      (error "%s does not have a process" (buffer-name (current-buffer)))
+      (make-local-variable 'bridge-start-regexp)
+      (make-local-variable 'bridge-end-regexp)
+      (make-local-variable 'bridge-prompt-regexp)
+      (make-local-variable 'bridge-handlers)
+      (make-local-variable 'bridge-source-insert)
+      (make-local-variable 'bridge-destination-insert)
+      (make-local-variable 'bridge-chunk-size)
+      (make-local-variable 'bridge-old-filter)
+      (make-local-variable 'bridge-string)
+      (make-local-variable 'bridge-in-progress)
+      (make-local-variable 'bridge-send-to-buffer)
+      (setq bridge-string nil bridge-in-progress nil
+	    bridge-send-to-buffer nil)
+      (if (boundp 'comint-prompt-regexp)
+	  (setq bridge-prompt-regexp comint-prompt-regexp))
+      (let ((process (get-buffer-process (current-buffer))))
+	(if process
+	    (if (not (eq (process-filter process) 'bridge-filter))
+		(progn
+		  (setq bridge-old-filter (process-filter process))
+		  (set-process-filter process 'bridge-filter)))
+	    (error "%s does not have a process" 
+		   (buffer-name (current-buffer)))))
+      (run-hooks 'bridge-hook)
+      (message "Process bridge is installed")))
+(defun reset-bridge ()
+  "Must be called from the process's buffer.  Removes any active bridge."
+  (interactive)
+  ;; for when things get wedged
+  (if bridge-in-progress
+      (unwind-protect
+	   (funcall bridge-in-progress (get-buffer-process
+					(current-buffer))
+		    nil)
+	(setq bridge-in-progress nil))
+      (message "No bridge in progress.")))
+(defun remove-bridge ()
+  "Remove bridge from the current buffer."
+  (interactive)
+  (let ((process (get-buffer-process (current-buffer))))
+    (if (or (not process) (not (eq (process-filter process) 'bridge-filter)))
+	(error "%s has no bridge" (buffer-name (current-buffer)))
+	;; remove any bridge-in-progress
+	(reset-bridge)
+	(set-process-filter process bridge-old-filter)
+	(funcall bridge-old-filter process bridge-string)
+	(message "Process bridge is removed."))))
+;;;% Utility for testing
+(defun hand-bridge (start end)
+  "With point at bridge-start, sends bridge-start + string +
+bridge-end to bridge-filter.  With prefix, use current region to send."
+  (interactive "r")
+  (let ((p0 (if current-prefix-arg (min start end)
+		(if (looking-at bridge-start-regexp) (point)
+		    (error "Not looking at bridge-start-regexp"))))
+	(p1 (if current-prefix-arg (max start end)
+		(if (re-search-forward bridge-end-regexp nil t)
+		    (point) (error "Didn't see bridge-end-regexp")))))
+    (bridge-filter (get-buffer-process (current-buffer))
+		   (buffer-substring p0 p1))
+    ))
+(provide 'bridge)

File cl-ilisp.lisp

View file
+;;; -*- Mode: Lisp -*-
+;;; cl-ilisp.lisp --
+;;; This file is part of ILISP.
+;;; Version: 5.8
+;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
+;;;               1993, 1994 Ivan Vasquez
+;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
+;;;               1996 Marco Antoniotti and Rick Campbell
+;;; Other authors' names for which this Copyright notice also holds
+;;; may appear later in this file.
+;;; Send mail to 'ilisp-request@naggum.no' to be included in the
+;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
+;;; mailing list were bugs and improvements are discussed.
+;;; ILISP is freely redistributable under the terms found in the file
+;;; Common Lisp initializations
+;;; Author: Chris McConnell, ccm@cs.cmu.edu
+;;; ange-ftp hack added by ivan Wed Mar 10 12:30:15 1993
+;;; ilisp-errors *gc-verbose* addition ivan Tue Mar 16 03:21:51 1993
+;;; Rcs_Info: clisp.lisp,v 1.26 1993/09/03 02:05:07 ivan Rel $
+;;; Revision 1.19  1993/08/24  22:01:52  ivan
+;;; Use defpackage instead of just IN-PACKAGE.
+;;; Renamed FUNCTION to FUN in ilisp-arglist to get around CMUCL 17b bug.
+;;; Revision 1.16  1993/06/29  05:51:35  ivan
+;;; Added Ed Gamble's #'readtable-case fix and Hans Chalupsky's
+;;; allegro-4.1 addition.
+;;; Revision 1.8  1993/06/28  00:57:42  ivan
+;;; Stopped using 'COMPILED-FUNCTION-P for compiled check.
+;;; Revision 1.3  1993/03/16  23:22:10  ivan
+;;; Added breakp arg to ilisp-trace.
+#+(or allegro-v4.0 allegro-v4.1)
+(eval-when (compile load eval)
+  (setq excl:*cltl1-in-package-compatibility-p* t))
+(in-package "ILISP")
+;;; GCL 2.2 doesn't have defpackage (yet) so we need to put the export
+;;; here. (toy@rtp.ericsson.se)
+;;; Please note that while the comment and the fix posted by Richard
+;;; Toy are correct, they are deprecated by at least one of the ILISP
+;;; maintainers. :) By removing the 'nil' in the following #+, you
+;;; will fix the problem but will not do a good service to the CL
+;;; community.  The right thing to do is to install DEFPACKAGE in your
+;;; GCL and to write the GCL maintainers and to ask them to
+;;; incorporate DEFPACKAGE in their standard builds.
+;;; Marco Antoniotti <marcoxa@icsi.berkeley.edu> 19960715
+#+(and nil gcl)
+(export '(ilisp-errors
+	  ilisp-save
+	  ilisp-restore
+	  ilisp-symbol-name
+	  ilisp-find-symbol
+	  ilisp-find-package
+	  ilisp-eval
+	  ilisp-compile
+	  ilisp-describe
+	  ilisp-inspect
+	  ilisp-arglist
+	  ilisp-documentation
+	  ilisp-macroexpand
+	  ilisp-macroexpand-1
+	  ilisp-trace
+	  ilisp-untrace
+	  ilisp-compile-file
+	  ilisp-casify
+	  ilisp-matching-symbols))
+(defvar *ilisp-old-result* nil "Used for save/restore of top level values.")
+(defun special-form-p (symbol)
+  "Backward compatibility for non ANSI CL's."
+  (special-operator-p symbol))
+(defmacro ilisp-handler-case (expression &rest handlers)
+  "Evaluate EXPRESSION using HANDLERS to handle errors."
+  handlers
+  (if (macro-function 'handler-case)
+      `(handler-case ,expression ,@handlers)
+      #+allegro `(excl::handler-case ,expression ,@handlers)
+      #+lucid `(lucid::handler-case ,expression ,@handlers)
+      #-(or allegro lucid) expression))
+(defun ilisp-readtable-case (readtable)
+  (if (fboundp 'readtable-case)
+      (funcall #'readtable-case readtable)
+      #+allegro (case excl:*current-case-mode*
+		  (:case-insensitive-upper :upcase)
+		  (:case-insensitive-lower :downcase)
+		  (otherwise :preserve))
+      #-allegro :upcase))
+(defmacro ilisp-errors (form)
+  "Handle errors when evaluating FORM."
+  `(let ((*standard-output* *terminal-io*)
+	 (*error-output* *terminal-io*)
+	 #+cmu
+	 (ext:*gc-verbose* nil) ; cmulisp outputs "[GC ...]" which
+				; doesn't read well...
+	 #+ecl
+	 (sys:*gc-verbose* nil) ; ecolisp also outputs "[GC ...]"
+	 )
+     (princ " ")			;Make sure we have output
+     (ilisp-handler-case
+      ,form	
+      (error (error)
+       (with-output-to-string (string)
+	 (format string "ILISP: ~A" error))))))
+(defun ilisp-save ()
+  "Save the current state of the result history."
+  (declare (special / // /// + ++ +++))
+  (unless *ilisp-old-result*
+    (setq *ilisp-old-result* (list /// // +++ ++ + /))))
+(defun ilisp-restore ()
+  "Restore the old result history."
+  (declare (special / // /// + ++ +++ * ** -))
+  (setq // (pop *ilisp-old-result*)
+	** (first //)
+	/  (pop *ilisp-old-result*)
+	*  (first /)
+	++  (pop *ilisp-old-result*)
+	+   (pop *ilisp-old-result*)
+	-   (pop *ilisp-old-result*))
+  (values-list (pop *ilisp-old-result*)))
+;;; ilisp-symbol-name --
+;;; ':capitalize' case added under suggestion by Rich Mallory.
+(defun ilisp-symbol-name (symbol-name)
+  "Return SYMBOL-NAME with the appropriate case as a symbol."
+  (case (ilisp-readtable-case *readtable*)
+    (:upcase (string-upcase symbol-name))
+    (:downcase (string-downcase symbol-name))
+    (:capitalize (string-capitalize symbol-name))
+    (:preserve symbol-name)))
+(defun ilisp-find-package (package-name)
+  "Return package PACKAGE-NAME or the current package."
+  (if (string-equal package-name "nil")
+      *package*
+      (or (find-package (ilisp-symbol-name package-name))
+	  (error "Package ~A not found" package-name))))
+(defun ilisp-find-symbol (symbol-name package-name)
+  "Return the symbol associated with SYMBOL-NAME in PACKAGE-NAME trying to
+handle case issues intelligently."
+  (find-symbol (ilisp-symbol-name symbol-name)
+	       (ilisp-find-package package-name)))
+;;; The following two functions were in version 5.5.
+;;; They disappeared in version 5.6. I am putting them back in the
+;;; distribution in order to make use of them later if the need
+;;; arises.
+;;; Marco Antoniotti: Jan 2 1995
+(defun ilisp-filename-hack (filename)
+  "Strip `/user@machine:' prefix from filename."
+  ;; Ivan's hack for getting away with dumb /ivan@bu-conx:/foo/bar/baz
+  ;; filenames...
+  (let ((at-location (position #\@ filename))
+	(colon-location (position #\: filename)))
+    (if (and at-location colon-location)
+	(subseq filename (1+ colon-location))
+	filename)))
+(defun ilisp-read-form (form package)
+  "Read string FORM in PACKAGE and return the resulting form."
+  (let ((*package* (ilisp-find-package package)))
+    (read-from-string form)))
+(defun ilisp-eval (form package filename)
+  "Evaluate FORM in PACKAGE recording FILENAME as the source file."
+  (princ " ")
+  ;; Ivan's hack for getting away with dumb /ivan@bu-conx:/foo/bar/baz
+  ;; filenames...
+  (let* ((at-location (position #\@ filename))
+	 (colon-location (position #\: filename))
+	 (filename
+	  (if (and at-location colon-location)
+	      (subseq filename (1+ colon-location))
+	      filename))
+	 (*package* (ilisp-find-package package))
+	 #+allegro (excl::*source-pathname* filename)
+	 #+allegro (excl::*redefinition-warnings* nil)
+	 #+lucid (lucid::*source-pathname*
+		  (if (probe-file filename)
+		      (truename filename)
+		      (merge-pathnames filename)))
+	 #+lucid (lucid::*redefinition-action* nil)
+	 #+lispworks (compiler::*input-pathname* (merge-pathnames filename))
+	 #+lispworks (compiler::*warn-on-non-top-level-defun* nil)
+	 ;; The LW entries are a mix of Rich Mallory and Jason
+	 ;; Trenouth suggestions
+	 ;; Marco Antoniotti: Jan 2 1995.
+	 )
+    filename
+    (eval (read-from-string form))))
+(defun ilisp-compile (form package filename)
+  "Compile FORM in PACKAGE recording FILENAME as the source file."
+  (princ " ")
+  ;; This makes sure that function forms are compiled
+  ;; NOTE: Rich Mallory proposed a variation of the next piece of
+  ;; code. for the time being we stick to the following simpler code.
+  ;; Marco Antoniotti: Jan 2 1995.
+  #-lucid
+  (ilisp-eval
+   (format nil "(funcall (compile nil '(lisp:lambda () ~A)))"
+	   form)
+   package
+   filename)
+  ;; The following piece of conditional code is left in the
+  ;; distribution just for historical purposes.
+  ;; It will disappear in the next release.
+  ;; Marco Antoniotti: Jan 2 1995.
+  #+lucid-ilisp-5.6
+  (labels ((compiler (form env)
+		     (if (and (consp form)
+			      (eq (first form) 'function)
+			      (consp (second form)))
+			 #-LCL3.0
+		       (evalhook `(compile nil ,form) nil nil env)
+		       #+LCL3.0
+		       ;; If we have just compiled a named-lambda, and the
+		       ;; name didn't make it in to the procedure object,
+		       ;; then stuff the appropriate symbol in to the
+		       ;; procedure object.
+		       (let* ((proc (evalhook `(compile nil ,form)
+					      nil nil env))
+			      (old-name (and proc (sys:procedure-ref proc 1)))
+			      (lambda (second form))
+			      (name (and (eq (first lambda)
+					     'lucid::named-lambda)
+					 (second lambda))))
+			 (when (or (null old-name)
+				   (and (listp old-name)
+					(eq :internal (car old-name))))
+			       (setf (sys:procedure-ref proc 1) name))
+			 proc)
+		       (evalhook form #'compiler nil env))))
+	  (let ((*evalhook* #'compiler))
+	    (ilisp-eval form package filename)))
+  #+lucid
+  ;; Following form is a patch provided by Christopher Hoover
+  ;; <ch@lks.csi.com>
+  (let ((*package* (ilisp-find-package package))
+ 	(lcl:*source-pathname* (if (probe-file filename)
+ 				   (truename filename)
+ 				 (merge-pathnames filename)))
+ 	(lcl:*redefinition-action* nil))
+    (with-input-from-string (s form)
+			    (lucid::compile-in-core-from-stream s)
+			    (values)))
+  )
+(defun ilisp-describe (sexp package)
+  "Describe SEXP in PACKAGE."
+  (ilisp-errors
+   (let ((*package* (ilisp-find-package package)))
+     (describe (eval (read-from-string sexp))))))
+(defun ilisp-inspect (sexp package)
+  "Inspect SEXP in PACKAGE."
+  (ilisp-errors
+   (let ((*package* (ilisp-find-package package)))
+     (inspect (eval (read-from-string sexp))))))
+(defun ilisp-arglist (symbol package)
+  (ilisp-errors
+    (let ((fn (ilisp-find-symbol symbol package))
+	  (*print-length* nil)
+	  (*print-pretty* t)
+	  (*package* (ilisp-find-package package)))
+      (cond ((null fn)
+	     (format t "Symbol ~s not present in ~s." symbol package))
+	    ((not (fboundp fn))
+	     (format t "~s: undefined~%" fn))
+	    (t
+	     (print-function-arglist fn)))))
+  (values))
+(defun print-function-arglist (fn)
+  "Pretty arglist printer"
+  (let* ((a (get-function-arglist fn))
+	 (arglist (ldiff a (member '&aux a)))
+	 (desc (ilisp-function-short-description fn)))
+    (format t "~&~s~a" fn (or desc ""))
+    (write-string ": ")
+    (if arglist
+	(write arglist :case :downcase :escape nil)
+      (write-string "()"))
+    (terpri)))
+(defun ilisp-generic-function-p (symbol)
+  (let ((generic-p
+	 (find-symbol "GENERIC-FUNCTION-P"
+		      (or (find-package "PCL")
+			  *package*))))
+    (and generic-p
+	 (fboundp generic-p)
+	 (funcall generic-p symbol))))
+(defun ilisp-function-short-description (symbol)
+  (cond ((macro-function symbol)
+	 " (Macro)")
+	((special-form-p symbol)
+	 " (Special Form)")
+	((ilisp-generic-function-p symbol)
+	 " (Generic)")))
+(defun get-function-arglist (symbol)
+  (let ((fun (symbol-function symbol)))
+    (cond ((ilisp-generic-function-p symbol)
+	   (funcall
+			 (or (find-package "PCL") *package*))
+	    fun))
+	  (t
+	   #+allegro
+	   (excl::arglist symbol)
+	   #+(or ibcl kcl ecl gcl)
+	   (help symbol)
+	   #+lucid
+	   (lucid::arglist symbol)
+	   #+lispworks
+	   (system::function-lambda-list symbol)
+	   #-(or allegro lucid kcl ibcl ecl)
+	   (documentation symbol 'function)))))
+(defun ilisp-documentation (symbol package type)
+  "Return the TYPE documentation for SYMBOL in PACKAGE.  If TYPE is
+\(qualifiers* (class ...)), the appropriate method will be found."
+  (ilisp-errors
+   (let* ((real-symbol (ilisp-find-symbol symbol package))
+	  (type (if (and (not (zerop (length type)))
+			 (eq (elt type 0) #\())
+		    (let ((*package* (ilisp-find-package package)))
+		      (read-from-string type))
+		    (ilisp-find-symbol type package))))
+     (when (listp type)
+       (setq real-symbol
+	     (funcall
+	      (find-symbol "FIND-METHOD" (or (find-package "CLOS")
+					     (find-package "PCL")
+					     *package*))
+	      (symbol-function real-symbol)
+	      (reverse
+	       (let ((quals nil))
+		 (dolist (entry type quals)
+		   (if (listp entry)
+		       (return quals)
+		       (setq quals (cons entry quals))))))
+	      (reverse
+	       (let ((types nil))
+		 (dolist (class (first (last type)) types)
+		   (setq types
+			 (cons (funcall
+				(find-symbol "FIND-CLASS"
+					     (or (find-package "CLOS")
+						 (find-package "PCL")
+						 *package*))
+				class) types))))))))
+     (if real-symbol
+	 (if (symbolp real-symbol)
+	     (documentation real-symbol type)
+	     ;; Prevent compiler complaints
+	     (eval `(documentation ,real-symbol)))
+	 (format nil "~A has no ~A documentation" symbol type)))))
+(defun ilisp-macroexpand (expression package)
+  "Macroexpand EXPRESSION as long as the top level function is still a
+  (ilisp-errors
+   (let ((*print-length* nil)
+	 (*print-level* nil)
+	 (*package* (ilisp-find-package package)))
+     (pprint (#-allegro macroexpand #+allegro excl::walk
+			(read-from-string expression))))))
+(defun ilisp-macroexpand-1 (expression package)
+  "Macroexpand EXPRESSION once."
+  (ilisp-errors
+   (let ((*print-length* nil)
+	 (*print-level* nil)
+	 (*package* (ilisp-find-package package)))
+     (pprint (macroexpand-1 (read-from-string expression))))))
+(defun ilisp-trace (symbol package breakp)
+  "Trace SYMBOL in PACKAGE."
+  (declare (ignore breakp)) ; No way to do this in CL.
+  (ilisp-errors
+   (let ((real-symbol (ilisp-find-symbol symbol package)))
+     (when real-symbol (eval `(trace ,real-symbol))))))
+;;; Jason Trenouth: SEP 6 94 -- LispWorks can trace-break
+(defun ilisp-trace (symbol package breakp)
+  "Trace SYMBOL in PACKAGE."
+  (ilisp-errors
+   (let ((real-symbol (ilisp-find-symbol symbol package)))
+     breakp ;; idiom for (declare (ignorable breakp))
+     (when real-symbol (eval `(trace (,real-symbol :break breakp)))))))
+(defun ilisp-untrace (symbol package)
+  "Untrace SYMBOL in PACKAGE."
+  (ilisp-errors
+   (let ((real-symbol (ilisp-find-symbol symbol package)))
+     (when real-symbol (eval `(untrace ,real-symbol))))))
+(defun ilisp-compile-file (file extension)
+  "Compile FILE putting the result in FILE+EXTENSION."
+  (ilisp-errors
+   (compile-file file
+		 :output-file 
+		 (merge-pathnames (make-pathname :type extension) file))))
+(defun ilisp-casify (pattern string lower-p upper-p)
+  "Return STRING with its characters converted to the case of PATTERN,
+continuing with the last case beyond the end."
+  (cond (lower-p (string-downcase string))
+	(upper-p (string-upcase string))
+	(t
+	 (let (case)
+	   (concatenate
+	    'string
+	    (map 'string
+		 #'(lambda (p s)
+		     (setq case (if (upper-case-p p)
+				    #'char-upcase
+				    #'char-downcase))
+		     (funcall case s))
+		 pattern string)
+	    (map 'string case (subseq string (length pattern))))))))
+(defun ilisp-words (string)
+  "Return STRING broken up into words.  Each word is (start end
+  (do* ((length (length string))
+	(start 0)
+	(end t)
+	(words nil))
+       ((null end) (nreverse words))
+    (if (setq end (position-if-not #'alphanumericp string :start start))
+	(setq words (cons (list end (1+ end) t)
+			  (if (= start end)
+			      words
+			      (cons (list start end nil) words)))
+	      start (1+ end))
+	(setq words (cons (list start length nil) words)))))
+(defun ilisp-match-words (string pattern words)
+  "Match STRING to PATTERN using WORDS."
+  (do* ((strlen (length string))
+	(words words (cdr words))
+	(word (first words) (first words))
+	(start1 (first word) (first word))
+	(end1 (second word) (second word))
+	(delimiter (third word) (third word))
+	(len (- end1 start1) (and word (- end1 start1)))
+	(start2 0)
+	(end2 len))
+       ((or (null word) (null start2)) start2)
+    (setq end2 (+ start2 len)
+	  start2
+	  (if delimiter
+	      (position (elt pattern start1) string :start start2)
+	      (when (and (<= end2 strlen)
+			 (string= pattern string
+				  :start1 start1 :end1 end1
+				  :start2 start2 :end2 end2))
+		(1- end2))))
+    (when start2 (incf start2))))
+(defun ilisp-matching-symbols (string package &optional (function-p nil)
+				      (external-p nil)
+				      (prefix-p nil))
+  "Return a list of the symbols that have STRING as a prefix in
+PACKAGE. FUNCTION-P indicates that only symbols with a function value
+should be considered.  EXTERNAL-P indicates that only external symbols
+should be considered.  PREFIX-P means that partial matches should not
+be considered.  The returned strings have the same case as the
+original string."
+  (ilisp-errors
+   (let* ((lower-p (notany #'upper-case-p string))
+	  (upper-p (notany #'lower-case-p string))
+	  (no-casify (eq (ilisp-readtable-case *readtable*) :preserve))
+	  (symbol-string (ilisp-symbol-name string))
+	  (length (length string))
+	  (results nil)
+	  (*print-length* nil)
+	  (*package* (ilisp-find-package package)))
+     (labels
+	 (
+	  ;; Check SYMBOL against PATTERN
+	  (check-symbol (symbol pattern)
+	    (let ((name (symbol-name symbol)))
+	      (when (and (or (not function-p) (fboundp symbol))
+			 (>= (length name) length)
+			 (string= pattern name :end2 length))
+		(push (list (if no-casify
+				name
+				(ilisp-casify pattern name lower-p upper-p)))
+		      results))))
+	  ;; Check SYMBOL against PATTERN using WORDS 
+	  (check-symbol2 (symbol pattern words)
+	    (let ((name (symbol-name symbol)))
+	      (when (and (or (not function-p) (fboundp symbol))
+			 (ilisp-match-words name pattern words))
+		(push (list (if no-casify
+				name
+				(ilisp-casify pattern name lower-p upper-p)))
+		      results)))))
+       (if external-p
+	   (do-external-symbols (symbol *package*)
+	     (check-symbol symbol symbol-string))
+	   (progn
+	     ;; KCL does not go over used symbols.
+	     #+(or kcl ibcl ecl)
+	     (dolist (used-package (package-use-list *package*))
+	       (do-external-symbols (symbol used-package)
+		 (check-symbol symbol symbol-string)))
+	     (do-symbols (symbol *package*)
+	       (check-symbol symbol symbol-string))))
+       (unless (or results prefix-p)
+	 (let ((words (ilisp-words symbol-string)))
+	   (if external-p
+	       (do-external-symbols (symbol *package*)
+		 (check-symbol2 symbol symbol-string words))
+	       (progn
+		 ;; KCL does not go over used symbols.
+		 #+(or kcl ibcl ecl)
+		 (dolist (used-package (package-use-list *package*))
+		   (do-external-symbols (symbol used-package)
+		     (check-symbol2 symbol symbol-string words)))
+		 (do-symbols (symbol *package*)
+		   (check-symbol2 symbol symbol-string words))))))
+       (prin1 results)
+       nil))))
+(eval-when (load eval)
+  (when
+      #+cmu (eval:interpreted-function-p #'ilisp-matching-symbols)
+      #-cmu (not (compiled-function-p #'ilisp-matching-symbols))
+      (format *standard-output*
+	      "\"ILISP: File is not compiled, use M-x ilisp-compile-inits\"")))
+;;; end of file -- cl-ilisp.lisp --

File cmulisp.lisp

View file
+;;; -*- Mode: Lisp -*-
+;;; cmulisp.lisp --
+;;; This file is part of ILISP.
+;;; Version: 5.8
+;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
+;;;               1993, 1994 Ivan Vasquez
+;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
+;;;               1996 Marco Antoniotti and Rick Campbell
+;;; Other authors' names for which this Copyright notice also holds
+;;; may appear later in this file.
+;;; Send mail to 'ilisp-request@naggum.no' to be included in the
+;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
+;;; mailing list were bugs and improvements are discussed.
+;;; ILISP is freely redistributable under the terms found in the file
+;;; Todd Kaufmann    May 1990
+;;; Make CMU CL run better within GNU inferior-lisp (by ccm).
+(in-package "ILISP")
+;;;% CMU CL does not define defun as a macro
+(defun ilisp-compile (form package filename)
+  "Compile FORM in PACKAGE recording FILENAME as the source file."
+  (ilisp-errors
+   (ilisp-eval
+    (format nil "(funcall (compile nil '(lambda () ~A)))" form)
+    package filename)))