mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-07 04:30:18 +02:00
(top-repl): Revert part of the 2001-05-19 change.
When defining the guile-user module, do not use any modules. Add them to guile-user when `top-repl' is called.
This commit is contained in:
parent
ee2718a9ec
commit
615bfe7277
1 changed files with 66 additions and 57 deletions
|
@ -2838,19 +2838,37 @@
|
||||||
(lambda (v) (fluid-set! using-readline? v)))))
|
(lambda (v) (fluid-set! using-readline? v)))))
|
||||||
|
|
||||||
(define (top-repl)
|
(define (top-repl)
|
||||||
|
(let ((guile-user-module (resolve-module '(guile-user))))
|
||||||
|
|
||||||
;; Load emacs interface support if emacs option is given.
|
;; Load emacs interface support if emacs option is given.
|
||||||
(if (and (module-defined? the-root-module 'use-emacs-interface)
|
(if (and (module-defined? the-root-module 'use-emacs-interface)
|
||||||
(module-ref the-root-module 'use-emacs-interface))
|
(module-ref the-root-module 'use-emacs-interface))
|
||||||
(load-emacs-interface))
|
(load-emacs-interface))
|
||||||
|
|
||||||
|
;; Use some convenient modules (in reverse order)
|
||||||
|
|
||||||
|
(if (provided? 'regex)
|
||||||
|
(module-use! guile-user-module (resolve-module '(ice-9 regex))))
|
||||||
|
(if (provided? 'threads)
|
||||||
|
(module-use! guile-user-module (resolve-module '(ice-9 threads))))
|
||||||
|
;; load debugger on demand
|
||||||
|
(module-use! guile-user-module
|
||||||
|
(make-autoload-interface guile-user-module
|
||||||
|
'(ice-9 debugger) '(debug)))
|
||||||
|
(module-use! guile-user-module (resolve-module '(ice-9 session)))
|
||||||
|
(module-use! guile-user-module (resolve-module '(ice-9 debug)))
|
||||||
|
;; so that builtin bindings will be checked first
|
||||||
|
(module-use! guile-user-module (resolve-module '(guile)))
|
||||||
|
|
||||||
|
(set-current-module guile-user-module)
|
||||||
|
|
||||||
(let ((old-handlers #f)
|
(let ((old-handlers #f)
|
||||||
(signals (if (provided? 'posix)
|
(signals (if (provided? 'posix)
|
||||||
`((,SIGINT . "User interrupt")
|
`((,SIGINT . "User interrupt")
|
||||||
(,SIGFPE . "Arithmetic error")
|
(,SIGFPE . "Arithmetic error")
|
||||||
(,SIGBUS . "Bad memory access (bus error)")
|
(,SIGBUS . "Bad memory access (bus error)")
|
||||||
(,SIGSEGV .
|
(,SIGSEGV
|
||||||
"Bad memory access (Segmentation violation)"))
|
. "Bad memory access (Segmentation violation)"))
|
||||||
'())))
|
'())))
|
||||||
|
|
||||||
(dynamic-wind
|
(dynamic-wind
|
||||||
|
@ -2890,7 +2908,7 @@
|
||||||
(sigaction (car sig-msg)
|
(sigaction (car sig-msg)
|
||||||
(car old-handler)
|
(car old-handler)
|
||||||
(cdr old-handler))))
|
(cdr old-handler))))
|
||||||
signals old-handlers)))))
|
signals old-handlers))))))
|
||||||
|
|
||||||
(defmacro false-if-exception (expr)
|
(defmacro false-if-exception (expr)
|
||||||
`(catch #t (lambda () ,expr)
|
`(catch #t (lambda () ,expr)
|
||||||
|
@ -2905,15 +2923,6 @@
|
||||||
|
|
||||||
;; Place the user in the guile-user module.
|
;; Place the user in the guile-user module.
|
||||||
;;
|
;;
|
||||||
(define-module (guile-user)
|
(define-module (guile-user))
|
||||||
:use-module (guile) ;so that bindings will be checked here first
|
|
||||||
:use-module (ice-9 session)
|
|
||||||
:use-module (ice-9 debug)
|
|
||||||
:autoload (ice-9 debugger) (debug)) ;load debugger on demand
|
|
||||||
|
|
||||||
(if (provided? 'threads)
|
|
||||||
(use-modules (ice-9 threads)))
|
|
||||||
(if (provided? 'regex)
|
|
||||||
(use-modules (ice-9 regex)))
|
|
||||||
|
|
||||||
;;; boot-9.scm ends here
|
;;; boot-9.scm ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue