Commits

Anonymous committed 530b772

Updated files to sync with ilisp 5.12.0 release.

Comments (0)

Files changed (31)

 Larry Stead,
 Jason Trenouth,
 Christof Ullwer,
+Reini Urban,
 Bjorn Victor,
 Edmund Weitz,
 Fred White,
 -------------------------------------------------------------------------------
 
 This file is part of ILISP.
-Version: 5.11.1
-Date:    2001-06-06
+Version: 5.12.0
+Date:    2002-05-28
 
 Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
               1993, 1994 Ivan Vasquez
 
 ILISP HISTORY
 ===============================================================================
+Version: 5.12.
+
+Even Newer Version.
+
+Please refer to the ChangeLog entries to see what relevant changes
+have happened.  These changes include some help for Window users and
+other stuff involving so many cool changes that I'm going to give up
+now ;)
+
+===============================================================================
 Version: 5.11.
 
 New Version.
         (setq allegro-program "/usr/local/acl5/lisp")
         (setq lucid-program "/usr/misc/.lucid/bin/lisp")))
 
-Kent Pitman and The Harlequin Group Ltd. have made publicly available on
-the Web the Common Lisp HyperSpec, an HTML version of the full text of the
-ANSI Common Lisp specification.  Daniel Barlow, Stephen Carney and Erik
-Naggum independently developed Emacs Lisp packages for looking up Lisp
-symbols in the HyperSpec and displaying the relevant sections with a Web
-browser.  ILISP includes all of them in the `extra' directory of the
-distribution tree. By default ILISP uses Naggum's package.  If you want to
-use one of the others, see the comments at the beginning of the
-corresponding files.
+Kent Pitman and Xanalys Inc. have made publicly available on the Web the
+Common Lisp HyperSpec, an HTML version of the full text of the ANSI Common
+Lisp specification.  Daniel Barlow, Stephen Carney and Erik Naggum
+independently developed Emacs Lisp packages for looking up Lisp symbols in
+the HyperSpec and displaying the relevant sections with a Web browser.
+ILISP includes all of them in the `extra' directory of the distribution
+tree. By default ILISP uses Naggum's package.  If you want to use one of
+the others, see the comments at the beginning of the corresponding files.
 
 The `ilisp.emacs' file provides sample instructions for making Naggum's
 package access a local copy of the HyperSpec. Since the package relies on
 the `browse-url' Emacs package, make sure that the latter is properly
 configured.
 
+Digital Press has made publicly available online, as a service to the Lisp
+community, the full text of the book ``Common Lisp, The Language'' (by Guy
+L. Steele Jr., 2nd edition, Digital Press, 1990, ISBN 1-55558-041-6;
+a.k.a. ``CLtL2'') in a number of formats, including HTML.  ILISP provides
+support, contributed by Utz-Uwe Haus, for looking up Lisp symbols in the
+HTML version of the book and displaying the relevant sections with a Web
+browser.  See the file `extra/cltl2.el' for more information on configuring
+this feature.
+
+The `ilisp.emacs' file provides sample instructions for making ILISP's
+CLtL2 support access a local copy of the book.  What has been said above
+about `browse-url' configuration also applies to CLtL2 lookup.
+
+Note that, althouth Steele's book is a well written and useful resource,
+it covers the Common Lisp language in the state it was a few years
+before ANSI standardization.  If you need an accurate description of
+ANSI Common Lisp, see the above mentioned HyperSpec instead.
+
 Previous versions of ILISP provided commands for accessing the online
 Common Lisp documentation shipped with Franz Inc.'s Allegro CL product
 (`fi:clman' module). The public availability of the HyperSpec, and the
 
 o KCL, AKCL, Ibuki, GCL, and ECL
 
+        Be sure to get the latest CVS version of ECL.
+
 	- DEFPACKAGE
 	  You need to have your system configured with a
 	  DEFPACKAGE. You can either generate an image which contains
 	of this setting.
 
 
-o Harlequin/Xanalys LispWorks
+o Xanalys LispWorks (formerly Harlequin LispWorks)
 
         On Windows and Linux, the LispWorks executable should be resaved
         without the GUI.  In addition, on Windows it MUST be resaved as a
         the following:
 
           (load-all-patches)
-          (save-image "lw41-console" :console t :environment nil)
+          (save-image "lw42-console" :console t :environment nil)
           (quit)
 
         and run it using:
 
-          <dir>/lispworks-4100 -init <dir>/console.lisp
+          <dir>/lispworks-4200 -init <dir>/console.lisp
 
-        When the `lw41-console' image has been created, it can be used as
+        When the `lw42-console' image has been created, it can be used as
         the value of the `lispworks-program' variable in ILISP.
 
-        If you are using LispWorks 4.1.19 with Emacs 20.4 or higher on
-        Windows, then you will need an additional patch
-        `emacs20-terminal-io', available from <lisp-support@xanalys.com>,
-        because Emacs has changed the coding-system used for comint
-        buffers.  The LispWorks for Windows 4.1.20 patch bundle includes
-        some more patches (LSC #7270, LSC #7727 and LSC #7291) that make it
-        work with ILISP.  For more information check the README file which
-        comes with the bundle.
+        If you are using LispWorks 4.1 with Emacs 20.4 or higher on
+        Windows, then ensure you're at patch level 4.1.20. This patch
+        bundle includes patches (LSC #7270, LSC #7727 and LSC #7291)
+        that make it work with ILISP.  For more information check the
+        README file which comes with the bundle.
+
+        LispWorks users who wish to use the CAPI (LispWorks GUI toolkit)
+        via ILISP can create a suitable image with this script (call it
+        'console-capi.lisp'):
+
+          (in-package "CL-USER")
+          (load-all-patches)
+          (compile (defun my-restart () 
+                     #+Unix
+                     (capi:ensure-motif-libraries)
+                     (mp:initialize-multiprocessing)))
+          (save-image "lw-ilisp-capi" :restart-function 'my-restart 
+                                      :environment nil
+                                      #+Win32 :console #+Win32 t)
+          (quit)
+
+        This is because the CAPI requires multiprocessing, and on some Unix
+        platforms the GUI libraries that CAPI uses are normally loaded on
+        startup of the IDE, which we're bypassing with :environment nil for
+        ILISP.
 
 
 o Lucid
 
 o CLISP
 
-        Unless you add the following form to your ~/.clisprc file:
-
-          (pushnew (pathname ".lisp") system::*source-file-types*)
-
-        the ILISP command `M-x ilisp-compile-inits' will not be able to
-        compile CLISP's initialization files.
-
         (The list below was provided by Valentino Kyriakides)
 
         The following lists some unusual ILISP behaviour related to CLISP.
 # -*- Mode: Makefile -*-
 
 # Makefile --
+#
 # This file is part of ILISP.
-# Version: 5.10.1
+# Please refer to the file COPYING for copyrights and licensing
+# information.
+# Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
+# of present and past contributors.
 #
-# Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
-#               1993, 1994 Ivan Vasquez
-#               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
-#               1996-2000 Marco Antoniotti and Rick Campbell
-#
-# Send mail to 'majordomo@cons.org' to be included in the
-# ILISP mailing list.
+# $Id$
 
 # Note: this makefile assumes GNU make
 
 #==============================================================================
 # Various Variables
 
-Version = 5.10.1
+Version = 5.12.0
 
 # Use whichever you like most
 #EMACS = xemacs
 #EMACS = /usr/local/bin/emacs
 EMACS = emacs
 
+# If your operating system does not support file links (e.g. Windows),
+# change this to an ordinary copy command
+LN = ln -s
+
 # The SHELL variable is used only for making the distribution.
 SHELL = /bin/csh
 
              HISTORY        \
              Makefile       \
              ilisp.emacs    \
+             icompile.bat   \
              INSTALLATION   \
              COPYING        \
              GETTING-ILISP  \
-             Welcome
+             Welcome        \
+	     ChangeLog      \
+	     ACKNOWLEDGMENTS
 
-LoadFiles = custom-ilisp.elc ilisp-def.elc ilisp-sym.elc \
+# maybe add custom-ilisp.elc to LoadFiles later.
+LoadFiles = ilisp-def.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-sbcl.elc \
+ ilisp-cl.elc ilisp-cmu.elc ilisp-sbcl.elc ilisp-cl-easy-menu.elc\
  ilisp-acl.elc ilisp-kcl.elc ilisp-luc.elc ilisp-sch.elc ilisp-hlw.elc \
- ilisp-xls.elc ilisp-chs.elc
+ ilisp-xls.elc ilisp-chs.elc ilisp-openmcl.elc ilisp-ccl.elc
 
 
 DocFiles = docs/Makefile \
 	   docs/README \
 	   docs/doc-changes.txt \
-           docs/ilisp-refcard.tgz \
+           docs/ilisp-refcard.tex \
            docs/ilisp.texi
 
+
+FaslFiles = *.fasl *.fas *.lib *.x86f *.sparcf *.pfsl
+
 #==============================================================================
 # Rules
 
 	cd docs; $(MAKE)
 
 clean: 
-	-$(RM) *.elc *~ extra/*.elc extra/*~
+	-$(RM) *.elc *~ extra/*.elc extra/*~ TAGS \
+	$(FaslFiles)
 	(cd docs; $(MAKE) clean)
 
 loadfile:
             $(patsubst %,$(Ilisp_tar_dir)/%,$(OtherFiles))              \
             $(Ilisp_tar_dir)/*.el                                       \
             $(Ilisp_tar_dir)/*.lisp                                     \
+            $(Ilisp_tar_dir)/*.scm                                      \
             $(patsubst %,$(Ilisp_tar_dir)/%,$(DocFiles))                \
             $(Ilisp_tar_dir)/extra/README                               \
-            $(Ilisp_tar_dir)/extra/hyperspec-*.el                       \
             $(Ilisp_tar_dir)/extra/hyperspec.el                         \
+	    $(Ilisp_tar_dir)/extra/cltl2.el				\
             $(Ilisp_tar_dir)/pictures/ilisp-icon.*                      \
         )
 
 
 ;; MNA: ecl (ecls-0.5) still had special-form-p in COMMON-LISP,
 ;; which produced an error, when redefined.
-#+(and :ANSI-CL (not :ecl))
+#+(and (or :CORMANLISP :ANSI-CL) (not :ecl))
 (defun special-form-p (symbol)
   "Backward compatibility for non ANSI CL's."
   (special-operator-p symbol))
     (read-from-string form)))
 |#
 
+;;; 2000-09-29 11:28:36 rurban
+;;; I needed this for Xemacs/cmd.exe/cormanlisp which swallows all my backslashes.
+;;; Slashes do work fine on NT.
+(defun ilisp-w32-fix-filename (filename)
+  "Pathslash hack: replace all '\\' by '/' in filenames.
+Convert cygwin paths also.
+This will only work on Microsoft NT, not on a Win95 based OS."
+  ;; (setq filename "r:\\gnu\\XEMACS~1.35\\lisp\\replace.elc")
+  ;; (setq filename "/cygdrive/r/xx") => "r:/"
+  (do ((pos (position #\\ filename) (position #\\ filename)))
+      ((null pos) filename)
+    (setf (aref filename pos) #\/))
+  (if (string-equal "/cygdrive/" (subseq filename 0 10))
+      (setf filename (concatenate 'string (subseq filename 10 11) ":" (subseq filename 11)))
+      filename))
+
 ;;;
 (defun ilisp-eval (form package filename)
   "Evaluate FORM in PACKAGE recording FILENAME as the source file."
 	  (if (and at-location colon-location)
 	      (subseq filename (1+ colon-location))
 	      filename))
+	 #+:cormanlisp
+	 (filename (ilisp-w32-fix-filename filename))
 	 (*package* (ilisp-find-package package))
 	 #+allegro (excl::*source-pathname* filename)
 	 #+allegro (excl::*redefinition-warnings* nil)
        (if results (prin1 results) (princ "()"))
        nil))))
 
-
+#-:cormanlisp
 (eval-when (load eval)
   (when
       #+(and :CMU (or :CMU17 :CMU18))
 		    ;; The code hereafter fixes the problem.
 		    
 		    (if handler
-			(save-excursion
+			(save-current-buffer
 			  (setq handler
 				(funcall handler comint-errorp wait-p
 					 message output last))))
-;;; completer.el --- powerful completion mechanism
-
-;; Partial completion mechanism for XEmacs.  Version 3.04.
-;; Copyright (C) 1990, 1991, 1992 Chris McConnell <chrimc@microsoft.com>
-;; Copyright (C) 2000 Ben Wing.
-
-;; Author: Chris Mcconnell <chrimc@microsoft.com>
-;; Latest XEmacs Author: Ben Wing
-;; Maintainer: Ben Wing
-;; Keywords: minibuffer, completion
+;;; -*- Mode: Emacs-Lisp -*-
+;;;%Header
+;;;
+;;; Rcs_Info: completer.el,v 3.23 1993/09/03 02:05:07 ivan Rel $
+;;;
+;;; Partial completion mechanism for GNU Emacs and XEmacs.  Version 3.05
+;;; Copyright (C) 1990, 1991, 1992 Chris McConnell, ccm@cs.cmu.edu.
+;;; Copyright (C) 2000 Ben Wing.
+;;; Copyright (C) 2002 Marco Antoniotti and the ILISP Maintainers
+;;;
+;;; Author: Chris Mcconnell <chrimc@microsoft.com>
+;;; Latest XEmacs Author: Ben Wing
+;;; Maintainer: The ILISP Maintainers
+;;; Keywords: minibuffer, completion
 
 ;;; Thanks to Bjorn Victor for suggestions, testing, and patches for
 ;;; file completion. 
 
-;;; This file is part of XEmacs.
+;;; This file should be part of GNU Emacs and XEmacs.
 
-;;; XEmacs is distributed in the hope that it will be useful,
+;;; GNU Emacs and XEmacs are distributed in the hope that they 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
-;;; XEmacs, 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 XEmacs so you
+;;; GNU Emacs and XEmacs, but only under the conditions described in the
+;;; GNU Emacs and XEmacs General Public License.   A copy of this license is
+;;; supposed to have been given to you along with GNU Emacs or XEmacs 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.
 	    'display-completion-list)))
 
 
+(unless (fboundp 'minibuffer-prompt-end)
+  (defun minibuffer-prompt-end ()
+    "Return the buffer position of the end of the minibuffer prompt.
+Return (point-min) if current buffer is not a mini-buffer."
+    (point-min)))
+
 ;;;%Utilities
 (defun completer-message (message &optional point)
   "Display MESSAGE at optional POINT for two seconds."
     (sit-for 2)
     (delete-region point end)
     (if (and quit-flag 
-	     ;;(not (eq 'lucid-19 ilisp-emacs-version-id))
-	     (not (string-match "XEmacs" emacs-version))
+	     ;; (not (eq 'lucid-19 ilisp-emacs-version-id))
+	     ;; (not (string-match "Lucid" emacs-version))
+	     (not (memq +ilisp-emacs-version-id+
+			'(xemacs lucid-19 lucid-19-new)))
 	     )
 	(setq quit-flag nil
 	      unread-command-char 7))))
 
 ;;;
 (defun completer-deleter (regexp choices &optional keep)
-  "Destructively remove strings that match REGEXP in CHOICES and
-return the modified list.  If optional KEEP, then keep entries that
+  "Destructively remove strings that match REGEXP in CHOICES.
+Return the modified list.  If optional KEEP, then keep entries that
 match regexp."
   (let* ((choiceb choices)
 	 choicep)
 
 ;;;%%Regexp
 (defun completer-regexp (string delimiters any)
-  "Convert STRING into a regexp with words delimited by characters in
-DELIMITERS.  Any delimiter in STRING that is the same as ANY will
-match any delimiter."
+  "Convert STRING into a regexp with words delimited by chars in DELIMITERS.
+Any delimiter in STRING that is the same as ANY will match any delimiter."
   (let* ((delimiter-reg (concat "[" delimiters "]"))
 	 (limit (length string))
 	 (pos 0)
 
 ;;;%Matcher
 (defun completer-matches (string choices delimiters any)
-    "Return STRING's matches in CHOICES using DELIMITERS and wildcard
-ANY to segment the strings."
+    "Return STRING's matches in CHOICES.
+DELIMITERS and the wildcard ANY are used  to segment the strings."
     (let* ((regexp (concat "[" delimiters "]"))
 	   (from nil)
 	   (to 0)
 
 ;;;
 (defun completer-choice (string choices delimiters use-words)
-  "Return the best match of STRING in CHOICES with DELIMITERS between
-words and T if it is unique.  A match is unique if it is the only
+  "Return a list with best match of STRING in CHOICES and T if it is unique.
+DELIMITERS are used to separate words.  A match is unique if it is the only
 possibility or when USE-WORDS the only possibility with the same
 number of words.  The shortest string of multiple possibilities will be
 the best match."
 ;;;%Completer
 ;;;%%Utilities
 (defun completer-region (delimiters)
-  "Return the completion region bounded by characters in DELIMITERS
-for the current buffer assuming that point is in it."
-  (cons (save-excursion (skip-chars-backward delimiters) (point))
-	(save-excursion (skip-chars-forward delimiters) (point))))
+  "Return the completion region bounded by characters in DELIMITERS.
+The search is for the current buffer assuming that point is in it."
+  (cons (save-excursion (skip-chars-backward delimiters (minibuffer-prompt-end))
+                        (point))
+	(save-excursion (skip-chars-forward delimiters)
+                        (point))))
 	 
 ;;;
 (defun completer-last-component (string)
   "Return the start of the last filename component in STRING."
-  (let ((last (1- (length string)) )
+  (let ((last (1- (length string)))
 	(match 0)
 	(end 0))
-    (while (and (setq match (string-match completer-path-separator-regexp string end)) (< match last))
+    (while (and (setq match (string-match completer-path-separator-regexp string end))
+		(< match last))
       (setq end (1+ match)))
     end))
 
 ;;;
 (defun completer-match-record (string matches delimiters any dir mode)
-  "Return (match lcs choices unique) for STRING in MATCHES with
+  "Return (match lcs choices unique) for STRING in MATCHES.
 DELIMITERS or ANY wildcards and DIR if a filename when in MODE."
   (let ((pattern (if dir
 		     (substring string (completer-last-component string))
 
 ;;;%%Complete file
 (defun completer-extension-regexp (extensions)
-  "Return a regexp that matches to a string that ends with any string from EXTENSIONS list."
+  "Return a regexp that matches a string ending with any string in EXTENSIONS."
   (concat "\\(" (mapconcat 'regexp-quote extensions "\\|") "\\)\\'"))
 
 ;;;
 
 ;;;
 (defun completer-cache (path pred words any mode)
-  "Check to see if PATH is in path cache with PRED, WORDS, ANY and
-MODE."
+  "Check to see if PATH is in path cache with PRED, WORDS, ANY and MODE."
   (let* ((last nil)
 	 (ptr completer-path-cache)
 	 (size 0) 
 		      (cons (cons path choices) completer-path-cache))))
 	  choices))))
 
-;;;
+
 (defun completer-file (string pred words any mode)
-  "Return (match common-substring matches unique-p) for STRING using
-read-file-name-internal for choices that pass PRED using WORDS to
+  "Return (match common-substring matches unique-p) for STRING.
+It uses 'READ-FILE-NAME-INTERNAL' for choices that pass PRED using WORDS to
 delimit words.  Optional ANY is a delimiter that matches any of the
 delimiters in WORD.  If optional MODE is nil or 'help then possible
 matches will always be returned."
-  ;; canonicalize slashes under windows-nt for proper completion
-  (if (eq system-type 'windows-nt)
-      (setq string (replace-in-string string "/" "\\\\")))
+  ;; Canonicalize slashes under windows-nt for proper completion
+  (when (eq system-type 'windows-nt)
+    (setq string (replace-in-string string "/" "\\\\")))
   (let* ((case-fold-search completion-ignore-case)
 	 (last (and (eq mode 'exit-ok) (completer-last-component string)))
 	 (position
-	  ;; find beginning of first directory component.
-	  (cond
-	   ;; CMU RFS filenames like /../computername/foo/bar.c
-	   ((string-match "^/\\.\\./[^/]*/" string)
-	    (match-end 0))
-	   ;; windows-nt filenames like \\computername\foo\bar.c, or
-	   ;; cygwin filenames like //d/foo/bar.c
-	   ((and (memq system-type '(windows-nt cygwin32))
-		 (string-match "[/\\][/\\][^/\\]*[/\\]" string))
-	    (match-end 0))
-	   ;; windows-nt filenames like c:\foo\bar.c or c:bar.c
-	   ((and (eq system-type 'windows-nt)
-		 (string-match "[A-Za-z]:[/\\]?" string))
-	    (match-end 0))
-	   (t
-	    ;; normal absolute or relative names, or names beginning
-	    ;; with ~/
-	    (string-match
-	     (concat "[^~" completer-path-separator-regexp-inside-brackets
-		     "]") string))))
+
+	  ;; Original
+	  ;; Special hack for CMU RFS filenames
+	  ;; (if (string-match "^/\\.\\./[^/]*/" string)
+	  ;;    (match-end 0)
+	  ;;  (string-match "[^~/]" string))
+
+	  ;; 2002-05-23
+	  ;; New by Ben Wing
+	  ;; Find beginning of first directory component.
+	  (cond ((string-match "^/\\.\\./[^/]*/" string)
+		 ;; CMU RFS filenames like /../computername/foo/bar.c
+		 (match-end 0))
+
+		((and (memq system-type '(windows-nt cygwin32))
+		      (string-match "[/\\][/\\][^/\\]*[/\\]" string))
+		 ;; windows-nt filenames like \\computername\foo\bar.c, or
+		 ;; cygwin filenames like //d/foo/bar.c
+		 (match-end 0))
+
+		((and (eq system-type 'windows-nt)
+		      (string-match "[A-Za-z]:[/\\]?" string))
+		 ;; windows-nt filenames like c:\foo\bar.c or c:bar.c
+		 (match-end 0))
+
+		(t
+		 ;; normal absolute or relative names, or names beginning
+		 ;; with ~/
+		 (string-match
+		  (concat "[^~" completer-path-separator-regexp-inside-brackets
+			  "]") string)))
+	 )
 	 (new (substring string 0 position))
 	 (user (if (string= new "~")
 		   (setq new (file-name-directory (expand-file-name new)))))
 	 (words (concat words completer-path-separator-regexp-inside-brackets))
 	 (len (length string))
 	 (choices nil)
-	 end
+	 (end nil)
 	 (old-choices (list nil nil nil nil)))
     (while position
-      (let* ((begin (string-match completer-path-separator-regexp string
+      (let* ((begin (string-match completer-path-separator-regexp
+				  string
 				  position))
 	     (exact-p nil))
-	(setq end (if begin (match-end 0))
+	(setq end (when begin (match-end 0))
 	      choices
 	      ;; Ends with a /, so check files in directory
 	      (if (and (memq mode '(nil help)) (= position len))
 		   (let* ((choices
 			   (all-completions new 'read-file-name-internal))
 			  (choicep choices))
-		     (if (member (car choicep) completer-dot-dot-list)
+		     (if (member* (first choicep) completer-dot-dot-list
+				  :test #'string=)
 			 (cdr (cdr choicep))
-			 (while (cdr choicep)
-			   (if (member (car (cdr choicep))
-				       completer-dot-dot-list)
-			       (rplacd choicep nil))
-			   (setq choicep (cdr choicep)))
-			 choices))
+		       (while (cdr choicep)
+			 (if (member* (second choicep) completer-dot-dot-list
+				      :test #'string=)
+			     (rplacd choicep nil))
+			 (setq choicep (cdr choicep)))
+		       choices))
 		   words any new mode)
-		  (if (eq position last)
-		      (let ((new (concat new (substring string position))))
-			(list new new nil t))
-		      (let ((component (substring string position end)))
-			(if (and end
-				 (string-match completer-file-skip component))
-			    ;; Assume component is complete
-			    (list (concat new component) 
-				  (concat new component)
-				  nil t)
-			    (completer-cache
-			     (concat new component)
-			     pred words any mode))))))
+		(if (eq position last)
+		    (let ((new (concat new (substring string position))))
+		      (list new new nil t))
+		  (let ((component (substring string position end)))
+		    (if (and end
+			     (string-match completer-file-skip component))
+			;; Assume component is complete
+			(list (concat new component) 
+			      (concat new component)
+			      nil t)
+		      (completer-cache
+		       (concat new component)
+		       pred words any mode))))))
 	;; Keep going if unique or we match exactly
 	(if (or (car (cdr (cdr (cdr choices))))
 		(setq exact-p
 	    (setq old-choices
 		  (let* ((lcs (car (cdr choices)))
 			 (matches (car (cdr (cdr choices))))
+			 ;; (slash (and lcs (string-match "/$" lcs))))
 			 (slash
 			  (and lcs
 			       (string-match
 				(concat completer-path-separator-regexp "$")
 				lcs))))
+ 
 		    (list nil
 			  (if slash (substring lcs 0 slash) lcs)
 			  (if (and (cdr matches) 
 			  nil))
 		  new (car choices)
 		  position end)
-	    ;; Its ok to not match user names because they may be in
-	    ;; different root directories
-	    (if (and (= position 1) (= (elt string 0) ?~))
-		(setq new (substring string 0 end)
-		      choices (list new new (list new) t)
-		      user nil
-		      position end)
-		(setq position nil)))))
+	  ;; Its ok to not match user names because they may be in
+	  ;; different root directories
+	  (if (and (= position 1) (= (elt string 0) ?~))
+	      (setq new (substring string 0 end)
+		    choices (list new new (list new) t)
+		    user nil
+		    position end)
+	    (setq position nil)))))
     (if (not (car choices))
 	(setq choices old-choices))
     (if (and (car choices)
 	  (while choicep
 	    (if (string-match extensions (car choicep))
 		(setq isext t)
-		(setq noext t))
+	      (setq noext t))
 	    (if (and isext noext)
 		;; There are matches besides extensions
 		(setq choiceb (completer-deleter extensions choiceb)
 		      choicep nil)
-		(setq choicep (cdr choicep))))
+	      (setq choicep (cdr choicep))))
 	  (if (and isext noext)
 	      (setq choices
 		    (completer-match-record 
 ;;;%%Completer
 (defun completer (string table pred words
 			 &optional any mode file-p)
-  "Return (match common-substring matches unique-p) for STRING in
-TABLE for choices that pass PRED using WORDS to delimit words.  If the
-flag completer-complete-filenames is T and the table is
-read-file-name-internal or read-directory-name-internal, then filename
-components will be individually expanded.  Optional ANY is a delimiter
-that can match any delimiter in WORDS.  Optional MODE is nil for
-complete, 'help for help and 'exit for exit."
+  "Return (match common-substring matches unique-p) for STRING in TABLE.
+The choices must also pass PRED using WORDS to delimit words.  If the
+flag 'COMPLETER-COMPLETE-FILENAMES' is T and the table is
+'READ-FILE-NAME-INTERNAL', then filename components will be individually
+expanded.  Optional ANY is a delimiter that can match any delimiter in
+WORDS.  Optional MODE is nil for complete, 'help for help and 'exit
+for exit."
   (if (and (stringp completer-string) 
 	   (string= string completer-string)
 	   (eq table completer-table)
        completer-mode mode
        completer-result
        (if (and completer-complete-filenames
-		(not file-p) (memq table '(read-file-name-internal
-					   read-directory-name-internal)))
+		(not file-p)
+		(memq table '(read-file-name-internal
+			      read-directory-name-internal)))
 	   (completer-file string pred words any mode)
-	   (let* ((file-p (or file-p 
-			      (memq table '(read-file-name-internal
-					    read-directory-name-internal))))
+	   (let* ((file-p (or file-p
+			      (memq table
+				    '(read-file-name-internal
+				      read-directory-name-internal))))
 		  (case-fold-search completion-ignore-case)
 		  (pattern (concat "[" words "]"))
 		  (component (if file-p (completer-last-component string)))
 		 ;; Handle environment variables
 		 (let ((match
 			(getenv (substring string 1 
-					   (string-match completer-path-separator-regexp string)))))
-		   (if match
-		       (setq match
-			     (concat match
-				     completer-path-separator-string)))
+					   ;; (string-match "/" string)))) ; old
+					   (string-match
+					    completer-path-separator-regexp
+					    string))))
+		       )
+		   ;; (if match (setq match (concat match "/"))) ; old
+		   (when match
+		     (setq match
+			   (concat match
+				   completer-path-separator-string)))
+ 
 		   (list match match (list match) match))
 		 (let* ((choices
 			 (all-completions 
 ;;;%%Display choices
 (defun completer-display-choices (choices &optional match message end
 					  display)
-  "Display the list of possible CHOICES with optional MATCH, MESSAGE,
-END and DISPLAY.  If MATCH is non-nil, it will be flagged as the best
-guess.  If there are no choices, display MESSAGE.  END is where to put
-temporary messages.  If DISPLAY is present then it will be called on
-each possible completion and should return a string."
+  "Display the list of possible CHOICES.
+MATCH, MESSAGE, END and DISPLAY are used optionally.  If MATCH is
+non-nil, it will be flagged as the best guess.  If there are no
+choices, display MESSAGE.  END is where to put temporary messages.  If
+DISPLAY is present then it will be called on each possible completion
+and should return a string."
+
   (if choices
       (with-output-to-temp-buffer "*Completions*"
 	(if (cdr choices) 
 ;;;%%Goto
 (defun completer-goto (match lcs choices unique delimiters words 
 			     &optional mode display)
-  "MATCH is the best match, LCS is the longest common substring of all
+  "Go to the part of the string that disambiguates CHOICES.
+MATCH is the best match, LCS is the longest common substring of all
 of the matches.  CHOICES is a list of the possibilities, UNIQUE
 indicates if MATCH is unique.  DELIMITERS are possible bounding
 characters for the completion region.  WORDS are the characters that
 delimit the words for partial matches.  Replace the region bounded by
 delimiters with the match if unique and the lcs otherwise unless
 optional MODE is 'help.  Then go to the part of the string that
-disambiguates choices using WORDS to separate words and display the
+disambiguates CHOICES using WORDS to separate words and display the
 possibilities if the string was not extended.  If optional DISPLAY is
 present then it will be called on each possible completion and should
 return a string."
 	 (start (car region))
 	 (end (cdr region))
 	 (string (buffer-substring start end))
+	 ;; (file-p (string-match "[^ ]*\\(~\\|/\\|$\\)" string))
 	 (file-p (string-match (if (eq system-type 'windows-nt)
 				   "[^ ]*\\(~\\|/\\|\\\\\\|\\|$\\)"
-				 "[^ ]*\\(~\\|/\\|$\\)") string))
+				 "[^ ]*\\(~\\|/\\|$\\)")
+			       string))
 	 (no-insert (eq mode 'help))
 	 (message t)
 	 (new (not (string= (buffer-substring start (point)) lcs))))
 	;;Not unique
 	(if lcs
 	    (let* ((regexp 
-		    (concat "[" words (if file-p completer-path-separator-regexp-inside-brackets) "]"))
+		    ;; (concat "[" words (if file-p "/") "]")
+		    (concat "["
+			    words
+			    (and file-p completer-path-separator-regexp-inside-brackets)
+			    "]")
+		    )
 		   (words (completer-words regexp lcs))
-		   point)
+		   (point nil))
 	      ;; Go to where its ambiguous
 	      (goto-char start)
-	      (if (not no-insert)
-		  (progn 
-		    (insert lcs)
-		    (setq completer-last-pattern 
-			  (list string delimiters (current-buffer) start)
-			  start (point)
-			  end (+ end (length lcs)))))
+	      (unless no-insert
+		(insert lcs)
+		(setq completer-last-pattern 
+		      (list string delimiters (current-buffer) start)
+		      start (point)
+		      end (+ end (length lcs))))
 	      ;; Skip to the first delimiter in the original string
 	      ;; beyond the ambiguous point and keep from there on
 	      (if (re-search-forward regexp end 'move words)
 			  (if (string-match regexp delimiter)
 			      (insert delimiter))))
 		    (forward-char -1)))
-	      (if (not no-insert) 
-		  (progn
-		    (setq end (- end (- (point) start)))
-		    (delete-region start (point))))))
+	      (unless no-insert
+		(setq end (- end (- (point) start)))
+		(delete-region start (point)))))
 	(if choices
-	    (if (or no-insert (not new))
-		(completer-display-choices choices match nil end display))
-	    (if file-p 
-		(progn 
-		  (if (not (= (point) end)) (forward-char 1))
-		  (if (not (save-excursion (re-search-forward completer-path-separator-regexp end t)))
-		      (goto-char end))))
-	    (if message
-		(progn
-		  (beep)
-		  (completer-message (if no-insert 
-					 " (No completions)"
-					 " (No match)")
-				     end)))))))	    
+	    (when (or no-insert (not new))
+	      (completer-display-choices choices match nil end display))
+	    (when file-p
+	      (when (not (= (point) end)) (forward-char 1))
+	      (unless (save-excursion (re-search-forward completer-path-separator-regexp end t))
+		(goto-char end)))
+	    (when message
+	      (beep)
+	      (completer-message (if no-insert 
+				     " (No completions)"
+				   " (No match)")
+				 end))))))
 
 ;;;%Exported buffer interface
 ;;;%%Complete and go
 
 ;;;%%Undo
 (defun completer-insert (match delimiters &optional buffer undo)
-  "Replace the region bounded with characters in DELIMITERS by MATCH
-and save it so that it can be restored by completer-undo."
+  "Replace the region bounded with characters in DELIMITERS by MATCH.
+Then save it so that it can be restored by completer-undo."
   (let* ((region (completer-region delimiters))
 	 (start (car region))
 	 (end (cdr region)))
 ;;;%Minibuffer specific code
 ;;;%%Utilities
 (defun completer-minibuf-string ()
-  "Remove dead filename specs from the minibuffer as delimited by //
-or ~ or $ and return the resulting string."
+  "Remove dead filename specs from the minibuffer.
+Dead filename should be delimited by // or ~ or $ and return the
+resulting string."
   (save-excursion
     (goto-char (point-max))
     (if (and (memq minibuffer-completion-table
-		   '(read-file-name-internal
-		     read-directory-name-internal))
+		   '(read-file-name-internal read-directory-name-internal))
 	     (re-search-backward
+	      ;; "//\\|/~\\|.\\$"
 	      (if (memq system-type '(windows-nt cygwin32))
-		  ; // is meaningful
-		  "/~\\|.\\$" "//\\|/~\\|.\\$") nil t))
-	(delete-region (point-min) (1+ (point))))
-    (buffer-substring (point-min) (point-max))))
+		  ;; // is meaningful
+		  "/~\\|.\\$"
+		"//\\|/~\\|.\\$")
+	      (minibuffer-prompt-end)
+	      t))
+	(delete-region (minibuffer-prompt-end) (1+ (point))))
+    (buffer-substring (minibuffer-prompt-end) (point-max))))
 
 ;;;
 (defun completer-minibuf-exit ()
 	  (let ((string (completer-minibuf-string)))
 	    (or
 	     (not (string-match
-		   (concat "[" completer-words
-			   completer-path-separator-regexp-inside-brackets "~]")
+		   (concat "["
+			   completer-words
+			   completer-path-separator-regexp-inside-brackets
+			   "~]")
 		   string))
 	      (condition-case ()
 		  (let ((completion
 
 ;;;
 (defun completer-minibuf (&optional mode)
-  "Partial completion of minibuffer expressions.  Optional MODE is
-'help for help and 'exit for exit.
+  "Partial completion of minibuffer expressions.
+Optional MODE is (quote help) for help and (quote exit) for exit.
 
 If what has been typed so far matches any possibility normal
 completion will be done.  Otherwise, the string is considered to be a
 (defvar completer-old-completer
   (lookup-key minibuffer-local-must-match-map "\t")
   "Old binding of TAB in minibuffer completion map.")
+
 (defun completer-complete ()
   "Partial completion minibuffer-complete.
 See completer-minibuf for more information."
 	      guess (car completions)))
     (if guess
 	(progn
-	  (goto-char (point-min))
+	  (goto-char (minibuffer-prompt-end))
 	  (insert guess)
 	  (delete-region (point) (point-max))
 	  (exit-minibuffer))
     ;; added by jwz: don't cache completions in shell buffer!
     (setq completer-string nil)
     (let ((conf (current-window-configuration)));; lemacs change
-      (completer-complete-goto 
-       "^ \t\n\""
-       completer-words
-       'read-file-name-internal
-       default-directory
-       mode)
+      (completer-complete-goto "^ \t\n\""
+			       completer-words
+			       'read-file-name-internal
+			       default-directory
+			       mode)
       ;; lemacs change
-      (if (eq mode 'help) (comint-restore-window-config conf))
+      (when (eq mode 'help) (comint-restore-window-config conf))
       )))
+
 ;(fset 'comint-dynamic-complete 'completer-comint-dynamic-complete)
 (fset 'comint-dynamic-complete-filename
       'completer-comint-dynamic-complete-filename)
 (fset 'comint-dynamic-list-completions 
       'completer-comint-dynamic-list-completions)
 
-;;; Set the functions again if comint is loaded
+;;; Set the functions again if comint is loaded.
 (setq comint-load-hook 
       (cons (function (lambda ()
-;;	      (fset 'comint-dynamic-complete 
-;;		    'completer-comint-dynamic-complete)
+			;; (fset 'comint-dynamic-complete 
+			;;       'completer-comint-dynamic-complete)
 			(fset 'comint-dynamic-complete-filename
 			      'completer-comint-dynamic-complete-filename)
-	      (fset 'comint-dynamic-list-completions 
-		    'completer-comint-dynamic-list-completions)))
-	    (if (and (boundp 'comint-load-hook) comint-load-hook)
-		(if (consp comint-load-hook) 
-		    (if (eq (car comint-load-hook) 'lambda)
-			(list comint-load-hook)
-			comint-load-hook)
-		    (list comint-load-hook)))))
+			(fset 'comint-dynamic-list-completions 
+			      'completer-comint-dynamic-list-completions)))
+	    (when (and (boundp 'comint-load-hook) comint-load-hook)
+	      (if (consp comint-load-hook)
+		  (if (eq (car comint-load-hook) 'lambda)
+		      (list comint-load-hook)
+		    comint-load-hook)
+		(list comint-load-hook)))))
 
 ;;;%lisp-complete-symbol
 (defun lisp-complete-symbol (&optional mode)
-  "Perform partial completion on Lisp symbol preceding point.  That
-symbol is compared against the symbols that exist and any additional
+  "Perform partial completion on Lisp symbol preceding point.
+That symbol is compared against the symbols that exist and any additional
 characters determined by what is there are inserted.  If the symbol
 starts just after an open-parenthesis, only symbols with function
 definitions are considered.  Otherwise, all symbols with function
 ;;;%Hooks
 (provide 'completer)
 (run-hooks 'completer-load-hook)
+
+;;; end of file -- completer.el --
       (let ((start-index
 	     (if with-procedure?
 		 (string-length pattern)
-		 (1+ (string-index doc #\space
-				   (string-length pattern))))))
-	(let ((eol-index (string-index doc #\newline start-index)))
+		 (min (1+ (or (string-index doc #\space
+					    (string-length pattern))
+			      (string-length pattern)))
+		      (or (string-index doc #\newline
+					(string-length pattern))
+			  (string-length pattern))))))
+	(let ((eol-index (or (string-index doc #\newline start-index)
+			     (string-length doc))))
 	  (string-append 
 	   "("
 	   (let loop ((bol-index (+ 1 eol-index))
   ;; meaningful result even if we aren't allowed to read the
   ;; documentation files (EXPENSIVE? = #f).
     (cond
+     ((and (procedure? obj)
+	   (procedure-property obj 'arglist))
+      => (lambda (arglist)
+	   (let ((required-args (car arglist))
+		 (optional-args (cadr arglist))
+		 (keyword-args (caddr arglist))
+		 (allow-other-keys? (cadddr arglist))
+		 (rest-arg (car (cddddr arglist))))
+	     (with-output-to-string
+	       (lambda ()
+		 (define (arg-only arg/default)
+		   (if (pair? arg/default) (car arg/default) arg/default))
+		 (write
+		  (append
+		   (if arglist-only?
+		       '()
+		       (list sym))
+		   required-args
+		   (if (not (null? optional-args))
+		       (cons #:optional (map arg-only optional-args))
+		       '())
+		   (if (not (null? keyword-args))
+		       (cons #:key (map arg-only keyword-args))
+		       '())
+		   (if allow-other-keys?
+		       (list #:allow-other-keys)
+		       '())
+		   (if rest-arg rest-arg '()))))))))
      ((closure? obj)
       (let ((formals (cadr (procedure-source obj))))
 	(if arglist-only? formals (cons sym formals))))
 
 (define-public (ilisp-in-package package)
   (set-current-module (string->module package))
-  (process-use-modules '((guile-ilisp)))
+  (process-use-modules '(((guile-ilisp))))
   *unspecified*)
 
 (define-public (ilisp-eval form package filename line)
 	     (write 'nil)))
 	 (lambda (key . args)
 	   (if (eq? key 'result)
-	       (begin (write (car args)) (newline) (write #t) (newline))
-	       (write 'nil)))))
+	       (begin (write (car args)) (newline) (write #t))
+	       (begin (write 'nil)))))
+  (newline))
 
 (define-public (ilisp-macroexpand-1 expression package)
   (write (save-module-excursion
 ;;; Global definitions/declarations
 
 (defconst +ilisp-emacs-version-id+
-    (cond ((string-match "XEmacs" emacs-version)
-	   'xemacs)
-	  ((string-match "Lucid" emacs-version)
-	   (if (string-match "^19.[0-7][^0-9]" emacs-version)
-	       'lucid-19
-	       'lucid-19-new))
-	  ((string-match "^19" emacs-version)
-	   'fsf-19)
-	  ((string-match "^2[01]" emacs-version)
-	   'fsf-20)
-	  (t 'fsf-18))
-  "The version of Emacs ILISP is running in.
-Declared as '(member fsf-19 fsf-19 fsf-20 lucid-19 lucid-19-new xemacs).
+  (cond ((string-match "XEmacs" emacs-version)
+	 'xemacs)
+	((string-match "Lucid" emacs-version)
+	 (if (string-match "^19.[0-7][^0-9]" emacs-version)
+	     'lucid-19
+	   'lucid-19-new))
+	((string-match "^19" emacs-version)
+	 'fsf-19)
+	((string-match "^20" emacs-version)
+	 'fsf-20)
+	((string-match "^21" emacs-version)
+	 'fsf-21)
+	(t 'fsf-18))
+  "The major version of (X)Emacs ILISP is running in.
+Declared as '(member fsf-19 fsf-19 fsf-20 fsf-21 lucid-19 lucid-19-new xemacs).
 Set in ilcompat.el.")
 
+
 (defconst +ilisp-emacs-minor-version-number+
-    (cond ((eq +ilisp-emacs-version-id+ 'fsf-18) 59)
-	  ((or  (eq +ilisp-emacs-version-id+ 'lucid-19)
-		(eq +ilisp-emacs-version-id+ 'lucid-19-new)
-		)
-	   12)				; Does emacs-minor-version work?
-	  ((eq +ilisp-emacs-version-id+ 'xemacs) 14)
-	  (t emacs-minor-version)))
+  (cond ((eq +ilisp-emacs-version-id+ 'fsf-18) 59)
+	((or  (eq +ilisp-emacs-version-id+ 'lucid-19)
+	      (eq +ilisp-emacs-version-id+ 'lucid-19-new)
+	      )
+	 12)			      ; Does emacs-minor-version work?
+	((eq +ilisp-emacs-version-id+ 'xemacs) 14)
+	(t emacs-minor-version))
+  "The minor version of (X)Emacs ILISP is running in.
+Set in ilcompat.el.")
 
 
 ;;; Load Emacs version specific compatibility modules
       ((eq +ilisp-emacs-version-id+ 'fsf-18) (load "ilfsf18"))
       ((eq +ilisp-emacs-version-id+ 'fsf-19) (load "ilfsf19"))
       ((eq +ilisp-emacs-version-id+ 'fsf-20) (load "ilfsf20"))
+      ((eq +ilisp-emacs-version-id+ 'fsf-21) (load "ilfsf21"))
       )
 
 
 
 (deflocal ild-abort-string nil)
 (deflocal ild-continue-string nil)
+(deflocal ild-step-string nil)
+(deflocal ild-step-string-arg nil)
 (deflocal ild-next-string nil)
 (deflocal ild-next-string-arg nil)
 (deflocal ild-previous-string nil)
 	 (beep))
      (if arg (capitalize-word arg) (capitalize-word 1))))
 
+(defun ild-step (&optional arg)
+ (interactive "P")
+ (if arg
+     (if ild-step-string-arg
+	 (ild-debugger-command (format ild-step-string-arg arg))
+	 (beep))
+     (if ild-step-string
+	 (ild-debugger-command ild-step-string)
+	 (beep))))
+
 (defun ild-next (&optional arg)
  (interactive "P")
  (if arg
 
 (defkey-ilisp "\M-a"    'ild-abort         t  'no-fsf-key)
 (defkey-ilisp "\M-c"    'ild-continue      t  'no-fsf-key)
+(defkey-ilisp "\C-\M-s" 'ild-step          t  'no-fsf-key)
 (defkey-ilisp "\C-\M-n" 'ild-next          t  'no-fsf-key)
 (defkey-ilisp "\C-\M-p" 'ild-previous      t  'no-fsf-key)
 (defkey-ilisp "\C-c<"   'ild-top           t  'no-fsf-key)
 	))
 
 (unless clisp-hs-program
-  (setq clisp-hs-program "clisp -I -q -a")) ; ILISP, quiet, and ANSI.
+  (setq clisp-hs-program "clisp -ansi -I")) ; ANSI mode, ILISP friendly
 
 (provide 'ilisp-chs)
 

ilisp-cl-easy-menu.el

-;;; ilisp-easy-menu.el --- (easy)menu's on Emacs for Ilisp
+;;; Ilisp-easy-menu.el --- (easy)menu's on Emacs for Ilisp
 
 ;;; Copyright (C) 1996 Holger Schauer
 ;;;
 ;; Put it in a place where (X)Emacs can find it and augment your
 ;; .emacs like the following to use it.
 ;; (load-library "ilisp-easy-menu")
-;; This needs to be loaderd prior to Ilisp !
+;; This needs to be loaded prior to Ilisp !
 ;; This should give you the menu in any source code buffer and any inferior 
 ;; ilisp buffer. Be careful: the menu is initialized with add-hook
 ;; on ilisp-mode-hook and lisp-mode-hook, so if you setq these two
 	     (not (featurep 'hyperspec)))
     (load-library "extra/hyperspec")))
 
-(defconst ilisp-cl-easy-menu
+(defvar ilisp-cl-easy-menu
   `("Ilisp"
     [ "Load File" load-file-lisp t ]
     [ "Run Ilisp" run-ilisp t ]
     )
   )
 
+;;; insert "Debug" Menu if ilisp-*enable-ild-support-p*
+;;; enable the commands only if inside the debugging loop
+;;;
+;;; 2000-10-10 17:34:05 rurban
+(defconst ilisp-ild-easy-menu
+    `("Debug"
+     [ "Abort" 	  ild-abort 	(ilisp-ild-p) ]
+     [ "Continue" ild-continue 	(ilisp-ild-p) ]
+     [ "Next" 	  ild-next 	(ilisp-ild-p) ]
+     [ "Previous" ild-previous 	(ilisp-ild-p) ]
+     [ "Top" 	  ild-top 	(ilisp-ild-p) ]
+     [ "Bottom"   ild-bottom 	(ilisp-ild-p) ]
+     [ "Backtrace" ild-backtrace (ilisp-ild-p) ]
+     [ "Locals"   ild-locals 	(ilisp-ild-p) ]
+     [ "Local"    ild-local 	(ilisp-ild-p) ]
+     [ "Return"   ild-return 	(ilisp-ild-p) ]
+     [ "Retry"    ild-retry 	(ilisp-ild-p) ]
+     [ "Trap on exit" ild-trap-on-exit (ilisp-ild-p) ]
+     "--"
+     [ "Fast lisp" fast-lisp t ]
+     [ "Slow lisp" slow-lisp t ]
+     )
+    )
+
+(defun ilisp-ild-p ()
+  t)
+
+(defun ilisp-insert-menu (menu where what)
+  "Insert WHAT into MENU after WHERE"
+  (if (position what menu)
+      menu
+    (let ((i (position (assoc where menu) menu)))
+      (setq i    (1+ i)
+	    menu (append (butlast menu (- (length menu) i))
+			 (list what)
+			 (nthcdr i menu))))))
+  
+(if ilisp-*enable-ild-support-p*
+  (setq ilisp-cl-easy-menu 
+	(ilisp-insert-menu ilisp-cl-easy-menu "Misc" ilisp-ild-easy-menu)))
+
 ;;; ilisp-update-menu
 ;;;
 ;;; 19990818 Marco Antoniotti
   ;; A no-op for the time being.
   )
 
+(defun ilisp-redefine-menu ()
+  (easy-menu-remove ilisp-cl-easy-menu)
+  (easy-menu-define menubar-ilisp ilisp-mode-map 
+		    "Ilisp commands"
+		    ilisp-cl-easy-menu)
+  (easy-menu-add ilisp-cl-easy-menu 'ilisp-mode-map)
+  )
+
 (provide 'ilisp-cl-easy-menu)
 
 ;;; Hooks to add the menu.
 				"lisp commands"
 				ilisp-cl-easy-menu) 
 	      (when (boundp 'lisp-menu)
-		(easy-menu-remove lisp-menu 'lisp-mode-map))
+		(easy-menu-remove lisp-menu))
 	      (easy-menu-add ilisp-cl-easy-menu 'lisp-mode-map)
 	      )))
 
 	ilisp-in-package-command
 	"(in-package \"%s\")"
 
-         ilisp-defpackage-regexp
-         "^[ \t]*(defpackage[ \t\n]*"
- 
          ilisp-hash-form-regexp
          "\\(^[ \t]*#[+-].\\)\\|\\(^[ \t]*(\\(.*::?\\)?defpackage[ \t\n]\\)\\|\\(^[ \t]*(\\(.*::?\\)?in-package[ \t\n]*\\)"
 
 The type of the result is a list.  If FUNCTION-P is T, only symbols
 with function bindings will be considered.  If no package is specified
 the buffer package will be used."
-
-  (let* ((choices 
+  (let* ((choices-string
 	  (ilisp-send 
 	   (format  (ilisp-value 'ilisp-complete-command) 
 		    (lisp-symbol-name symbol) (lisp-symbol-package symbol)
 	       (concat "Complete " 
 		       (if function-p "function ")
 		       (lisp-buffer-symbol symbol)))
-	   'complete)))
+	   'complete))
+	 choices)
     (if (or (ilisp-value 'comint-errorp t)
-            (ignore-errors (string-match ilisp-error-regexp choices)))
-	(progn (lisp-display-output choices)
-	       (error "Error completing %s" (lisp-buffer-symbol symbol))
-               nil)
-	(setq choices (read choices)
-	      choices (if (eq choices 'NIL) nil choices)))
+	    (ignore-errors (string-match ilisp-error-regexp choices-string)))
+	(setq choices 'error)
+      (setq choices (read choices-string)
+	    choices (if (eq choices 'NIL) nil choices)))
+    (unless (listp choices)
+      (lisp-display-output choices-string)
+      (error "Error completing %s" (lisp-buffer-symbol symbol)))
     (setq ilisp-original symbol
 	  ilisp-original-function-p function-p
 	  ilisp-original-table choices)))
   "Restore the prefix from ilisp-mini-prefix at the start of the minibuffer."
   (if ilisp-mini-prefix
       (save-excursion
-	(goto-char (point-min))
+	(goto-char (ilisp-minibuffer-prompt-end))
 	(insert ilisp-mini-prefix)
 	(setq ilisp-mini-prefix nil))))
 
+;;; Support for Emacs 21 minibuffer prompt
+(defun ilisp-minibuffer-prompt-end ()
+  (if (fboundp 'minibuffer-prompt-end)
+      (minibuffer-prompt-end)
+    (point-min)))	       
+
 ;;;
 (defun ilisp-current-choice ()
   "Set up the minibuffer completion table for the current symbol.
 If there is a paren at the start of the minibuffer, or there is not an
 ilisp-table, this will be from the inferior LISP.  Otherwise, it will
 be the ilisp-table."
-  (if (or (null ilisp-table) (eq (char-after 1) ?\())
+  (if (or (null ilisp-table) (eq (char-after (ilisp-minibuffer-prompt-end)) ?\())
       (progn
 	(let* ((symbol-info (lisp-previous-symbol))
 	       (symbol (car symbol-info)))
 		(ilisp-completion-table symbol ilisp-completion-function-p)))
 	(save-excursion 
 	  (skip-chars-backward "^: \(")
-	  (setq ilisp-mini-prefix (buffer-substring (point-min) (point)))
-	  (delete-region (point-min) (point)))
+	  (setq ilisp-mini-prefix (buffer-substring (ilisp-minibuffer-prompt-end) (point)))
+	  (delete-region (ilisp-minibuffer-prompt-end) (point)))
 	;; Nothing can match this table
 	(if (not minibuffer-completion-table)
 	    (setq minibuffer-completion-table '((" ")))))
 (defun ilisp-completion-word ()
   "Inferior LISP minibuffer complete word."
   (interactive)
-  (if (eq (char-after 1) ?\()
+  (if (eq (char-after (ilisp-minibuffer-prompt-end)) ?\()
       (insert " ")
       (ilisp-current-choice)
       (funcall ilisp-completion-word)
   "Only allow a paren if ilisp-paren is T."
   (interactive)
   (if ilisp-paren 
-      (if (or (eq last-input-char ?\() (eq (char-after 1) ?\())
+      (if (or (eq last-input-char ?\() (eq (char-after (ilisp-minibuffer-prompt-end)) ?\())
 	  (insert last-input-char)
 	  (beep))
       (beep)))
 (defun ilisp-completion-exit ()
   "Inferior LISP completion complete and exit."
   (interactive)
-  (if (eq (char-after 1) ?\()
+  (if (eq (char-after (ilisp-minibuffer-prompt-end)) ?\()
       (progn (find-unbalanced-lisp nil)
 	     (exit-minibuffer))
       (if ilisp-no-complete
 	  (exit-minibuffer)
-	  (if (= (point-min) (point-max))
+	  (if (= (ilisp-minibuffer-prompt-end) (point-max))
 	      (exit-minibuffer)
 	      (ilisp-current-choice)
 	      (unwind-protect (funcall ilisp-completion-exit)
 (defvar lisp-program-map nil
   "Minibuffer map for reading a program and arguments.")
 
+
 ;;;
 (defun lisp-read-program (prompt &optional initial)
-  "Read a program with PROMPT and INITIAL.  TAB or Esc-TAB will complete
-filenames."
-  (if (null lisp-program-map)
-      (progn 
-	(if (fboundp 'set-keymap-parent)
-	    (progn
-	      (setq lisp-program-map (make-sparse-keymap))
-	      (set-keymap-parent lisp-program-map minibuffer-local-map))
-	  (setq lisp-program-map (copy-keymap minibuffer-local-map)))
-	(define-key lisp-program-map "\M-\t" 'comint-dynamic-complete)
-	(define-key lisp-program-map "\t" 'comint-dynamic-complete)
-	(define-key lisp-program-map "?" 'comint-dynamic-list-completions)))
+  "Read a program with PROMPT and INITIAL.
+TAB or Esc-TAB will complete filenames."
+  (unless lisp-program-map
+    (if (fboundp 'set-keymap-parent)
+	(progn
+	  (setq lisp-program-map (make-sparse-keymap))
+	  (set-keymap-parent lisp-program-map minibuffer-local-map))
+      (setq lisp-program-map (copy-keymap minibuffer-local-map)))
+    (define-key lisp-program-map "\M-\t" 'comint-dynamic-complete)
+    (define-key lisp-program-map "\t" 'comint-dynamic-complete)
+    (define-key lisp-program-map "?" 'comint-dynamic-list-completions))
   (read-from-minibuffer prompt initial lisp-program-map))
 
+
 ;;;%%ilisp-read-symbol
 (defun ilisp-read-symbol (prompt &optional default function-p no-complete)
   "PROMPT in the minibuffer and return a symbol from the inferior LISP.
 
   (setq ild-abort-string ":abort"
 	ild-continue-string ":go"
+	ild-step-string ":step"
+	ild-step-string-arg nil
 	ild-next-string ":down"
 	ild-next-string-arg nil		; needs work
 	ild-previous-string ":up"
 		       comint-handler
 		       comint-update-status
 		       comint-prompt-status
-		       comint-abort-hook)
+		       comint-abort-hook
+		       comint-use-prompt-regexp-instead-of-fields)
   "List of ilisp local variables.")
 
 (defun lisp-deflocal (local)
 (deflocal ilisp-binary-extension nil
   "*The extension to use for LISP binaries.
 If there is an ilisp-binary-command, this string will be determined at
-initilization time.")
+initialization time.")
 
 (deflocal ilisp-init-binary-command nil
   "Command to return the extension for initialization binary files.")
 (deflocal ilisp-init-binary-extension nil
   "The extension for initialization binary files.
 If there is an ilisp-init-binary-command, this string will be
-determined at initilization time.")
+determined at initialization time.")
 
 (deflocal ilisp-load-command nil
   "Format string for loading a file in LISP given FILE.")
   "Non-nil if epoch is running.")
 
 (defvar ilisp-*version*
-  "5.11.1" ;; ILISP-VERSION marker
+  "5.12.0" ;; ILISP-VERSION marker
   "ILISP version.")
 
 (defvar ilisp-*directory* nil "The directory that ilisp is found in.")
   "Enables/disables use of Franz Inc's 'fi:clman' module.
 Default is NIL.")
 
+(defvar ilisp-*use-cltl2-interface-p* t
+  "Enables/disables loading of the CLtL2 lookup module provided with ILISP.
+Default is T.")
+
 ;;; end of file -- ilisp-def.lisp --
 ;;;     ibcl
 ;;;     ecl
 ;;;     gcl
+;;;   openmcl
 ;;; scheme
 ;;;   oaklisp
 ;;;   Scheme->C (still "in fieri")
   ;; Comint defaults
   (set-ilisp-input-ring-size 200)
   (setq comint-prompt-regexp "^[^<> ]*>+:? *"
-
+	comint-use-prompt-regexp-instead-of-fields t ; Emacs 21 fields don't seem to work with comint-ipc (?)
 	comint-get-old-input 'ilisp-get-old-input
 	comint-input-sentinel (function ignore)
 	comint-input-filter 'ilisp-input-filter
 	 'call)
        t)))
 
+;;; 2002-05-20 09:38:07 rurban
+;;; Ivan's ange-ftp hack: "/user@server:~/xx.lisp" => "~/xx.lisp"  
+;;; Reini's cygwin hack: "/cygdrive/r/xx.lisp"     => "r:/xx.lisp"
+(defun file-name-hack (file-name)
+  "Strip ange-ftp and cygwin pathnames prefixes for the native local lisp"
+  (cond ((string-match "/.*?@.*:" file-name)
+	 (substring file-name (match-end 0)))
+	((not (eq system-type 'cygwin32)) file-name) ; verified on XEmacs
+	;; assume cygwin clisp on cygwin (X)Emacs
+	((eq ilisp-dialect 'clisp-hs) file-name)
+	;; => w32 path for non-cygwin lisps only.
+	((string-equal "/cygdrive/" (subseq file-name 0 10))
+	 (concat (subseq file-name 10 11) ":" (subseq file-name 11)))
+	(t file-name)))
+
 ;;;
 (defun compile-file-lisp (file-name &optional extension)
   "Compile a Lisp file in the current inferior LISP and go there."
   (setq lisp-prev-l/c-dir/file (cons (file-name-directory    file-name)
 				     (file-name-nondirectory file-name)))
   (ilisp-init t)
-  ;; Ivan's hack for ange-ftp pathnames...
-  (let ((file-name
-	 (if (string-match "/.*?@.*:" file-name)
-	     (substring file-name (match-end 0))
-	   file-name)))
+  (let ((file-name (file-name-hack file-name)))
     (ilisp-send
      (format (ilisp-value 'ilisp-compile-file-command) file-name
 	     (or extension (ilisp-value 'ilisp-binary-extension)))
         (when (file-readable-p binary)
           (setq file-name binary))))
     (switch-to-lisp t t)
-    ;; Ivan's hack for ange-ftp pathnames...
-    (let ((file-name
-           (if (string-match "/.*?@.*:" file-name)
-               (substring file-name (match-end 0))
-             file-name)))
+    (let ((file-name (file-name-hack file-name)))
       (comint-sender
        (ilisp-process)
        (format (ilisp-value 'ilisp-load-command) file-name))
       (message "Loading %s" file-name))))
 
 
-
 ;;;%Source
 ;;;%File operations
 ;;;
                    (string-equal package "#+") (string-equal package "#-")
                    double-quote-pos;; there is no output  for strings only.
                    (not (and symbol (stringp symbol) (> (length symbol) 0)))
-                   (string-match "^\. " symbol))))
+                   (string-match "^\. " symbol)
+                   (string-match "^\\\\" symbol))))
 
         (goto-char old-point)
         (unless (no-arglist-output-p)
 ;;; $Id$
 
 
-;;; Old history log.
-
-;;; 2000-03-03 Martin Atzmueller
-;;; use imenu for displaying a fancy function/definition list.
-
+(require 'imenu)
 
 ;;; modified for a better display of function+arglist! 
 ;;; let tokens contain spaces and test with string-equal.
 		 (buffer-substring beg end)))
 	   (error nil)))))
 
-
-; (defun ilisp-imenu-create-lisp-index ()
-;   ;; `imenu-create-index-function' is set to this.
-;   ;; generates a nested index of definitions.
-;   (let ((index-fun-alist '())
-; 	(index-var-alist '())
-;         (index-const-alist '())
-; 	(index-type-alist '())
-; 	(index-unknown-alist '())
-; 	prev-pos)
-;     (goto-char (point-max))
-;     (imenu-progress-message prev-pos 0)
-;     ;; Search for the function
-;     (while (beginning-of-defun)
-;       (imenu-progress-message prev-pos nil t)
-; 	  (save-match-data
-; 	    (and (looking-at "(def")
-; 		 (save-excursion
-; 	       (down-list 1)
-; 		   (cond
-; 		((looking-at "def\\(var\\|constant\\|parameter\\)")
-; 		     (forward-sexp 2)
-; 		     (push (ilisp-imenu-general--name-and-position)
-; 			   index-var-alist))
-; 		((looking-at "def\\(un\\|macro\\|method\\|generic\\)")
-; 		     (forward-sexp 2)
-; 		     (push (ilisp-imenu-function--name-and-position)
-; 			   index-fun-alist))
-; 		((looking-at "def\\(type\\|struct\\|class\\|ine-condition\\)")
-; 		     (forward-sexp 2)
-;  		 (if (= (char-after (1- (point))) ?\))
-; 			 (progn
-;  		       (forward-sexp -1)
-; 			   (down-list 1)
-;  		       (forward-sexp 1)))
-; 		     (push (ilisp-imenu-general--name-and-position)
-; 			   index-type-alist))
-;                 ((looking-at "def")
-;                  (forward-sexp 2)
-; 		     (push (ilisp-imenu-function--name-and-position)
-; 			   index-fun-alist))
-; 		    (t
-; 		     (forward-sexp 2)
-; 		     (push (ilisp-imenu-general--name-and-position)
-; 		       index-unknown-alist)))))))
-;     (imenu-progress-message prev-pos 100)
-;     (and index-var-alist
-; 	 (push (cons "Variables" index-var-alist)
-; 	       index-fun-alist))
-;     (and index-type-alist
-;  	 (push (cons "Types" index-type-alist)
-;   	       index-fun-alist))
-;     (and index-unknown-alist
-; 	 (push (cons "Syntax-unknown" index-unknown-alist)
-; 	       index-fun-alist))
-;     index-fun-alist))
-
-
-
 ;;;---
 
 ;;;###autoload
 
 
 ;;; ECL -- Beppe Attardi's developments over AKCL
+;;;        Currently maintained by Juan Jose Garcia-Ripoll
 
 (defdialect ecl "EcoLisp Common LISP" akcl
-  (setq comint-prompt-regexp "^>+"
-	ilisp-binary-extension "o"
-        ilisp-init-binary-extension "ecl.o"
-	ilisp-binary-command "\"o\""
-	ilisp-init-binary-command "\"ecl.o\""
-	)
+  (setq comint-prompt-regexp "^\\([A-Z].*\\)?>+ "
+        ilisp-error-regexp "Broken at [^\n]*"
+        comint-fix-error ":pop\n(progn (terpri) (values))") ; kludge
 
   ;; ILD Support.
 
     (ilisp-bind-ilisp-key-for-map keymap "A" 'fi:clman-apropos "\M-a")
     (ilisp-bind-ilisp-key-for-map keymap "D" 'fi:clman "\M-d"))
   (when ilisp-*use-hyperspec-interface-p*
-    (ilisp-bind-ilisp-key-for-map keymap "H" 'hyperspec-lookup "\M-h")))
+    (ilisp-bind-ilisp-key-for-map keymap "H" 'hyperspec-lookup "\M-h"))
+  (when ilisp-*use-cltl2-interface-p*
+    (ilisp-bind-ilisp-key-for-map keymap "L" 'cltl2-lookup "\M-l")))
 
 
 ;;
   ;;       case she presumably knows what she wants. -Karl Fogel, 3 Feb 2000
   (cond ((eq +ilisp-emacs-version-id+ 'fsf-18))
 	((or (eq +ilisp-emacs-version-id+ 'fsf-19)
-	     (eq +ilisp-emacs-version-id+ 'fsf-20))
+	     (eq +ilisp-emacs-version-id+ 'fsf-20)
+	     (eq +ilisp-emacs-version-id+ 'fsf-21))
 	 (defkey-ilisp (read "[?\\S-\\C-a]") 'arglist-lisp)
 	 (defkey-ilisp (read "[?\\S-\\C-c]") 'compile-defun-lisp)
 	 (defkey-ilisp (read "[?\\S-\\C-d]") 'documentation-lisp)
 					; constant.
     (message ";;; Emacs Version %s" +ilisp-emacs-version-id+)
 
-    (if (eq +ilisp-emacs-version-id+ 'xemacs)
-	(setq load-path (cons "../xemacs-base" load-path)))
+    (when (eq +ilisp-emacs-version-id+ 'xemacs)
+      (setq load-path (cons "../xemacs-base" load-path)))
 
     (if (eq +ilisp-emacs-version-id+ 'fsf-18)
         (load "comint-v18")
-      (load "comint"))
+      ;; (load "comint")
+      (require 'comint))
 
     ;; Try to generate bytecodes for emacs 19.
     ;; I am no expert on the Byte Compiler.  Anyone who is please send
     ;; me mail.
     ;; Marco Antoniotti <marcoxa@icsi.berkeley.edu>
 
-    (if (eq +ilisp-emacs-version-id+ 'fsf-18)
-	(setq byte-compile-emacs18-compatibility t)
-      (setq byte-compile-generate-emacs19-bytecodes t
-	    byte-compile-warnings '(redefine callargs unresolved)))
+    ;; (if (eq +ilisp-emacs-version-id+ 'fsf-18)
+    ;;	(setq byte-compile-emacs18-compatibility t))
+
 
     ;; Compile compatibility files
     
            (byte-compile-file "illuc19.el"))
           ((eq +ilisp-emacs-version-id+ 'xemacs)
            (byte-compile-file "ilxemacs.el"))
+          ((eq +ilisp-emacs-version-id+ 'fsf-21)
+           (byte-compile-file "ilfsf21.el"))
           ((eq +ilisp-emacs-version-id+ 'fsf-20)
            (byte-compile-file "ilfsf20.el"))
           ((eq +ilisp-emacs-version-id+ 'fsf-19)
 		   "ilisp-mnb"
 
 		   ;; ILD Support.
-		   ;; "ild"
+		   "ild"
 
 		   ;; Dialects.
 		   "ilisp-cl"
+		   "ilisp-ccl"
 		   "ilisp-cmu"
 		   "ilisp-sbcl"
 		   "ilisp-chs"
 		   "ilisp-hlw"
 		   "ilisp-luc"
 		   "ilisp-xls"
+		   "ilisp-openmcl"
 		   "ilisp-sch"
+		   "ilisp-cl-easy-menu"
+		   "ilisp-scheme-easy-menu"
+		   "ilisp-imenu"
+		   "extra/hyperspec"
+		   "extra/cltl2"
 
 		   )))
       (dolist (f files)
-	(byte-compile-file (format "%s.el" f) 0)
-	(load f))
-      ;; Main mode file
-      (byte-compile-file "ilisp.el"))
-
-    (message "Done compiling and loading ILISP.")))
+        (byte-compile-file (format "%s.el" f) 0))
+      ;;Main mode file
+      (byte-compile-file "ilisp.el")
+      (message "Done compiling and loading ILISP."))))
 
 ;;; end of file -- ilisp-mak.el --
 
 (defun ilisp-make-output-frame (name)
   (when (and window-system ilisp-*use-frame-for-output*)
-    (make-frame `((name . ,name)
-		  (minibuffer . nil)
-		  (visibility . nil)
-		  (unsplittable . t)
-		  (menu-bar-lines . 0)
-		  (icon-type . ,(ilisp-find-ilisp-icon))))))
+    (let ((new-frame
+	   (make-frame `((name . ,name)
+			 (minibuffer . nil)
+			 (visibility . nil)
+			 (unsplittable . t)
+			 (menu-bar-lines . 0)
+			 ;; Use of icon-type is currently disabled due to a bug
+			 ;; in at least Emacs 21.1 running on Windows.
+			 ;; (icon-type . ,(ilisp-find-ilisp-icon))
+			 )))
+	   )
+      (when (eq +ilisp-emacs-version-id+ 'xemacs)
+	(set-frame-properties new-frame '(default-toolbar-visible-p nil
+					  default-gutter-visible-p nil
+					  menubar-visible-p nil
+					  has-modeline-p t))
+	)
+      new-frame)))
 
 
 (defvar ilisp-display-output-function 'ilisp-display-output-default
        ))
 
 
-;;; Useless
-;;; (push (cons t ilisp-output) ilisp-*command-to-ilisp-output-sink-table*)
-
-
 ;;; arglist-output
 
 (defvar ilisp-arglist-output nil "Output sink for Arglist messages.")
 	       ilisp-*command-to-ilisp-output-sink-table*)))
 
 
-;;; (push (cons 'arglist-lisp ilisp-arglist-output)
-;;;      ilisp-*command-to-ilisp-output-sink-table*)
-
 (ilisp-set-sink-for-command 'arglist-lisp
 			    ilisp-arglist-output)
 
-;;; (push (cons 'ilisp-arglist-message-lisp-space ilisp-arglist-output)
-;;;      ilisp-*command-to-ilisp-output-sink-table*)
-
 (ilisp-set-sink-for-command 'ilisp-arglist-message-lisp-space
 			    ilisp-arglist-output)
 
 	    (setq ilisp-last-buffer buffer))
 	  (comint-insert 
 	   (concat 
-	    (if ilisp-last-message
-		(concat ";;; " ilisp-last-message "\n"))
+	    (when ilisp-last-message
+              (concat ";;; " ilisp-last-message "\n"))
 	    (comint-remove-whitespace output)
 	    "\n"
 	    ilisp-last-prompt))
 	  (setq ilisp-last-message nil))
       (when (window-point window)
 	(select-window window)
-	(set-buffer buffer))
-      )))
+	(set-buffer buffer)))))
 
 
-
-;;; Changed according to suggestions by Robert P. Goldman
-(defun* lisp-pop-to-buffer (pbuffer &optional (ilisp-output-sink nil))
+(defun lisp-pop-to-buffer (pbuffer &optional ilisp-output-sink set-input-focus-p)
   "Like pop-to-buffer, but select a screen that buffer was shown in.
 ilisp-output-sink is the last ilisp-output-sink visited/active or nil
 if this is not relevant."
   (let* ((buffer (or pbuffer
 		     (when ilisp-output-sink
 		       (ilisp-output-sink-buffer ilisp-output-sink))))
-         (ilisp-window (if ilisp-epoch-running
-                           (epoch::get-buffer-window buffer)
-			 (get-buffer-window buffer))))
-    (if ilisp-window
-	(select-window ilisp-window)
-      ;; It is not currently displayed, so find some place to display
-      ;; it.
-      (progn
-	(cond (ilisp-epoch-running
-	       ;; Select a screen that the buffer has been displayed in before
-	       ;; or the current screen otherwise.
-	       (epoch::select-screen
-		;; allowed-screens in epoch 3.2, was called screens before that
-		(or (car (save-excursion
-			   (ignore-errors ; hack!
-			     (set-buffer buffer))
-			   (symbol-value 'allowed-screens)))
-		    (epoch::current-screen))))
-
-	      ;; Next clauses patterned after a suggestion by R. P. Goldman.
-	      ((or (eq +ilisp-emacs-version-id+ 'fsf-19)
-		   (eq +ilisp-emacs-version-id+ 'fsf-20))
-	       (let* ((window (get-buffer-window buffer t))
-		      (frame (if window (window-frame window))))
-		 (if (eq 'x (framep frame))
-		     (progn
-		       (raise-frame frame)
-		       (select-frame frame)))))
-	      (t nil))			; fsf-18, but also lucid and
-					; xemacs.
-					; I do not know how to make
-					; them work
-					; Marco Antoniotti, Jan 4th 1995
-	(if ilisp-output-sink
-	    (ilisp-bury-output ilisp-output-sink))
-	(pop-to-buffer buffer)))
+         (window (if ilisp-epoch-running
+                     (epoch::get-buffer-window buffer)
+                   (get-buffer-window buffer t)))
+         (frame  (when window (window-frame window))))
+    (cond ((not window)
+           (when ilisp-output-sink
+             (ilisp-bury-output ilisp-output-sink)) ; is this neccessary?
+           (pop-to-buffer buffer))
+          (set-input-focus-p
+           (if (fboundp 'select-frame-set-input-focus)
+               (select-frame-set-input-focus frame)
+             (raise-frame frame)
+             (select-frame frame)
+             (focus-frame frame))
+           (select-window window))
+          (t (when (or (memq (frame-visible-p frame) '(nil icon))
+                       (when (fboundp 'frame-iconified-p)
+                         (frame-iconified-p frame)))
+               (raise-frame frame)
+               (raise-frame (selected-frame)))
+             (select-frame frame)
+             (select-window window)))
     (set-buffer buffer)))
 
-;(defun lisp-pop-to-buffer (buffer)
-;  "Like pop-to-buffer, but select a screen that buffer was shown in.
-; Also, first bury any typeout-window."
-;  (let ((ilisp-window (if ilisp-epoch-running
-;			  (epoch::get-buffer-window buffer)
-;			  (get-buffer-window buffer))))
-;    (if ilisp-window
-;	(select-window ilisp-window)
-;	;; It is not currently displayed, so find some place to display it.
-;	(if ilisp-epoch-running
-;	    ;; Select a screen that the buffer has been displayed in before
-;	    ;; or the current screen otherwise.
-;	    (epoch::select-screen
-;	     ;; allowed-screens in epoch 3.2, was called screens before that
-;	     (or (car (save-excursion
-;			(set-buffer buffer)
-;			(symbol-value 'allowed-screens)))
-;		 (epoch::current-screen))))
-;	;; Do not pop to the output buffer.
-;	(ilisp-bury-output)
-;	(pop-to-buffer buffer)))
-;  (set-buffer buffer))
-
-
-;;; switch-to-lisp 
 
 (defun switch-to-lisp (eob-p &optional ilisp-only)
   "If in an ILISP buffer, switch to the last non-ILISP buffer visited.
   (interactive "P")
   (if (and (not ilisp-only) ilisp-last-buffer 
 	   (memq major-mode ilisp-modes))
-      (lisp-pop-to-buffer ilisp-last-buffer)
-      (if (not (memq major-mode ilisp-modes))
-	  (setq ilisp-last-buffer (current-buffer)))
-      (lisp-pop-to-buffer (ilisp-buffer))
-      (cond (eob-p (goto-char (point-max))))))
+      (lisp-pop-to-buffer ilisp-last-buffer nil t)
+    (unless (memq major-mode ilisp-modes)
+      (setq ilisp-last-buffer (current-buffer)))
+    (lisp-pop-to-buffer (ilisp-buffer) nil t)
+    (when eob-p
+      (goto-char (point-max)))))
 
 ;;; end of file -- ilisp-out.el --
 ;;; $Id$
 
 ;;;%%%Steel Bank Common Lisp
-
+    
 (defvar ilisp-sbcl-init-file
   ;; Note: The init file source extension (".lisp") needs to be
   ;; present in the filename, otherwise ILISP-LOAD-OR-SEND gets
   ;; decide where to append the compiled-file extension.
   "sbcl")
 
+;;; dummy sbcl-check-prompt
+;; the real function-definition is set later.
+(defun sbcl-check-prompt (old new)
+  nil)
+
+;;; sbcl-check-prompt function for SBCL-0.6.x or earlier.
+;;;
 ;;; WHN threatens to change the format of the break prompt one day soon, 
 ;;; but as of 0.6.12.21 this hasn't happened yet
-(defun sbcl-check-prompt (old new)
+(defun sbcl-check-prompt-sbcl<07 (old new)
   "Compare the break level printed at the beginning of the prompt."
   (let* ((was-in-break (and old (string-match "]+" old)))
- 	 (old-level (if was-in-break
- 			(- (match-end 0) (match-beginning 0))
- 			0))
- 	 (is-in-break (string-match "]+" new))
- 	 (new-level (if is-in-break
- 			(- (match-end 0) (match-beginning 0))
- 			0)))
+         (old-level (if was-in-break
+                      (- (match-end 0) (match-beginning 0))
+                      0))
+         (is-in-break (string-match "]+" new))
+         (new-level (if is-in-break
+                      (- (match-end 0) (match-beginning 0))
+                      0)))
     (<= new-level old-level)))
 
+;;; sbcl-check-prompt function for SBCL-0.7.x or later (probably).
+;;;
+;;; WHN not only threatened to change the format of the break prompt,
+;;; but now he has done it, in sbcl 0.7, as it seems.
+;;; So, we should finally take care of that.
+
+(defun match-and-extract (prompt)
+  (let ((level-1-regexp "]")
+        (level-2-n-regexp "\\(\\[[0-9]+\\]\\)"))
+    (let* ((level-2-p
+             (string-match level-2-n-regexp prompt))
+           (level-1-p
+             (unless level-2-p
+               (string-match level-1-regexp
+                             prompt)))
+           (no-level (unless (or level-1-p level-2-p) 0)))
+      (cond (level-1-p 1)
+            (level-2-p
+              ;; level 2 or greater,
+              ;; e.g. x[y] prompt
+              (string-to-int
+               (subseq prompt (1+ (match-beginning 0)) 
+                       (1- (match-end 0)))))
+            (t
+              no-level)))))
+    
+(defun sbcl-check-prompt-sbcl>=07 (old new)
+  "Compare the break level printed at the beginning of the prompt."
+  ;; SBCL has the new break prompt sequence such as
+  ;; 0] -> 0[2].
+  (let* ((old-level (if old
+                      (match-and-extract old)
+                      0))
+         (new-level (if new
+                      (match-and-extract new)
+                      0)))
+    (<= new-level old-level)))
+
+;;; SBCL Versioning stuff - e.g. distinguishing between some versions ...
+
+(defvar ilisp-*sbcl<07-version* nil)
+;; Distinguish SBCL-0.6.x (or earlier) vs. SBCL-0.7.x (and probably later).
+
+(defvar ilisp-*determine-version-lisp-string* 
+  "(find-package :sb-eval)") ; in SBCL-0.7.x an Interpreter didn't exist in the
+                             ; SB-EVAL package any more.
+
+(defun set-determined-sbcl-version ()
+  ;; do we have a SBCL-version less than 0.7.x?
+  (let ((result (car (comint-send
+                      (ilisp-process) i