0.8.11.2:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 8 Jun 2004 11:38:41 +0000 (11:38 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 8 Jun 2004 11:38:41 +0000 (11:38 +0000)
Make ED customizeable, similar to REQUIRE
... ED functions should attempt to implement the standard for ED
where practical;
... point to documentation when ED or REQUIRE fail.

NEWS
doc/manual/beyond-ansi.texinfo
package-data-list.lisp-expr
src/code/condition.lisp
src/code/module.lisp
src/code/target-misc.lisp
src/compiler/fndb.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 56a74b6..e3abb05 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2519,6 +2519,9 @@ changes in sbcl-0.8.11 relative to sbcl-0.8.10:
        print using #P"..." syntax.
 
 changes in sbcl-0.8.12 relative to sbcl-0.8.11:
+  * the behaviour of the standard function ED is now customizeable by
+    third parties through a hook variable: see ED's documentation
+    string for information on the protocol.
   * fixed bug 335: ATANH now computes the inverse hyperbolic tangent
     even for difficult arguments.  (reported by Peter Graves)
 
index a8c8a28..3a60c57 100644 (file)
@@ -319,6 +319,13 @@ following way:
 @include fun-common-lisp-require.texinfo
 @include var-sb-ext-star-module-provider-functions-star.texinfo
 
+Although SBCL does not provide a resident editor, the @code{ed}
+function can be customized to hook into user-provided editing
+mechanisms as follows:
+
+@include fun-common-lisp-ed.texinfo
+@include var-sb-ext-star-ed-functions-star.texinfo
+
 @node  Tools To Help Developers
 @comment  node-name,  next,  previous,  up
 @subsection Tools To Help Developers
index 3c64ce4..713f5da 100644 (file)
@@ -647,6 +647,7 @@ like *STACK-TOP-HINT* and unsupported stuff like *TRACED-FUN-LIST*."
 
              ;; miscellaneous useful supported extensions
              "QUIT"
+            "*ED-FUNCTIONS*"
             "*MODULE-PROVIDER-FUNCTIONS*"
             "WITH-TIMEOUT" "TIMEOUT"
             
@@ -811,7 +812,7 @@ retained, possibly temporariliy, because it might be used internally."
             "PACKAGE-AT-VARIANCE" "ARRAY-INITIAL-ELEMENT-MISMATCH"
             "TYPE-WARNING" "LOCAL-ARGUMENT-MISMATCH"
             "FORMAT-ARGS-MISMATCH" "FORMAT-TOO-FEW-ARGS-WARNING"
-            "FORMAT-TOO-MANY-ARGS-WARNING"
+            "FORMAT-TOO-MANY-ARGS-WARNING" "EXTENSION-FAILURE"
 
              ;; ..and DEFTYPEs..
              "INDEX" "LOAD/STORE-INDEX"
index 0ab79c7..f8e70f3 100644 (file)
 ;;; (:ansi-cl :glossary "similar")
 ;;;
 ;;; (:sbcl :node "...")
+;;; (:sbcl :variable *ed-functions*)
 ;;;
 ;;; FIXME: this is not the right place for this.
 (defun print-reference (reference stream)
      (format stream ", ")
      (destructuring-bind (type data) (cdr reference)
        (ecase type
-        (:node (format stream "Node ~S" data)))))
+        (:node (format stream "Node ~S" data))
+        (:variable (format stream "Variable ~S" data)))))
     ;; FIXME: other documents (e.g. AMOP, Franz documentation :-)
     ))
 (define-condition reference-condition ()
 (define-condition format-too-many-args-warning
     (format-args-mismatch simple-style-warning)
   ())
+
+(define-condition extension-failure (reference-condition simple-error)
+  ())
 \f
 ;;;; restart definitions
 
index c9f1861..866b7b3 100644 (file)
@@ -24,7 +24,6 @@
 
 (defvar *module-provider-functions* '(module-provide-contrib)
   "See function documentation for REQUIRE")
-
 \f
 ;;;; PROVIDE and REQUIRE
 
            (t
             (unless (some (lambda (p) (funcall p module-name))
                           *module-provider-functions*)
-              (error "Don't know how to load ~A" module-name)))))
+              (error 'extension-failure
+                     :format-control "Don't know how to ~S ~A"
+                     :format-arguments (list 'require module-name)
+                     :references
+                     (list
+                      '(:sbcl :variable *module-provider-functions*)))))))
     (set-difference *modules* saved-modules)))
 \f
 ;;;; miscellany
index 8c798e2..7b07e83 100644 (file)
@@ -151,6 +151,24 @@ are running on, or NIL if we can't find any useful information."
   "Return a string with the long form of the site name, or NIL if not known."
   *long-site-name*)
 \f
+;;;; ED
+(defvar *ed-functions* nil
+  "See function documentation for ED.")
+
+(defun ed (&optional x)
+  "Starts the editor (on a file or a function if named).  Functions
+from the list *ED-FUNCTIONS* are called in order with X as an argument
+until one of them returns non-NIL; these functions are responsible for
+signalling a FILE-ERROR to indicate failure to perform an operation on
+the file system."
+  (dolist (fun *ed-functions*
+          (error 'extension-failure
+                 :format-control "Don't know how to ~S ~A"
+                 :format-arguments (list 'ed x)
+                 :references (list '(:sbcl :variable *ed-functions*))))
+    (when (funcall fun x)
+      (return t))))
+\f
 ;;;; dribble stuff
 
 ;;; Each time we start dribbling to a new stream, we put it in
index a4a2661..d0f3312 100644 (file)
 (defknown describe (t &optional (or stream (member t nil))) (values))
 (defknown inspect (t) (values))
 (defknown room (&optional (member t nil :default)) (values))
-(defknown ed (&optional (or symbol cons filename) &key (:init t) (:display t))
+(defknown ed (&optional (or symbol cons filename))
   t)
 (defknown dribble (&optional filename &key (:if-exists t)) (values))
 
index e1f2b9f..fc137e7 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.11.1"
+"0.8.11.2"