* boot-9.scm: Don't assume that this file is loaded just before
authorJim Blandy <jimb@red-bean.com>
Mon, 19 Oct 1998 13:49:29 +0000 (13:49 +0000)
committerJim Blandy <jimb@red-bean.com>
Mon, 19 Oct 1998 13:49:29 +0000 (13:49 +0000)
entering a read-eval-print loop.  Turn code to load (ice-9 emacs)
into...
(load-emacs-interface): New function.
(top-repl): Call it, if use-emacs-interface is defined and true.
At this point, we *do* know we're about to enter a REPL.

ice-9/boot-9.scm

index 5d1cfba..5fe0b5e 100644 (file)
 
 
 \f
+;;; {Load emacs interface support if emacs option is given.}
+
+(define (load-emacs-interface)
+  (if (memq 'debug-extensions *features*)
+      (debug-enable 'backtrace))
+  (define-module (guile-user) :use-module (ice-9 emacs)))
+
+\f
 ;;; {I/O functions for Tcl channels (disabled)}
 
 ;; (define in-ch (get-standard-channel TCL_STDIN))
 ;; this is just (scm-style-repl) with a wrapper to install and remove 
 ;; signal handlers.
 (define (top-repl) 
+
+  ;; Load emacs interface support if emacs option is given.
+  (if (and (module-defined? the-root-module 'use-emacs-interface)
+          use-emacs-interface)
+      (load-emacs-interface))
+
   (let ((old-handlers #f)
        (signals `((,SIGINT . "User interrupt")
                   (,SIGFPE . "Arithmetic error")
     (define-module (guile-user) :use-module (ice-9 threads)))
 
 \f
-;;; {Load emacs interface support if emacs option is given.}
-;;;
-;;; *fixme* This is a temporary solution.
-;;;
-
-(if (and (module-defined? the-root-module 'use-emacs-interface)
-        use-emacs-interface)
-    (begin
-      (if (memq 'debug-extensions *features*)
-         (debug-enable 'backtrace))
-      (define-module (guile-user) :use-module (ice-9 emacs))))
-
-\f
 ;;; {Load regexp code if regexp primitives are available.}
 
 (if (memq 'regex *features*)