mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 15:00:21 +02:00
* Make readline run-time options accessible.
This commit is contained in:
parent
efb07c899c
commit
e9bab9df3d
4 changed files with 130 additions and 83 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2001-01-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
This patch fixes a problem reported by Martin Grabmueller about
|
||||||
|
the impossibility to access readline's run-time options.
|
||||||
|
|
||||||
|
* readline.scm: Added a comment about guile's behaviour if one of
|
||||||
|
the ports used by readline are closed.
|
||||||
|
|
||||||
|
(readline-options readline-enable readline-disable,
|
||||||
|
readline-set!): These are now defined here instead of in
|
||||||
|
boot-9.scm.
|
||||||
|
|
||||||
2001-01-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2001-01-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* readline.scm (set-readline-input-port!,
|
* readline.scm (set-readline-input-port!,
|
||||||
|
|
|
@ -21,11 +21,15 @@
|
||||||
;;;; Extensions based upon code by
|
;;;; Extensions based upon code by
|
||||||
;;;; Andrew Archibald <aarchiba@undergrad.math.uwaterloo.ca>.
|
;;;; Andrew Archibald <aarchiba@undergrad.math.uwaterloo.ca>.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(define-module (ice-9 readline)
|
(define-module (ice-9 readline)
|
||||||
:use-module (ice-9 session)
|
:use-module (ice-9 session)
|
||||||
:use-module (ice-9 regex)
|
:use-module (ice-9 regex)
|
||||||
:no-backtrace)
|
:no-backtrace)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Dynamically link the glue code for accessing the readline library,
|
;;; Dynamically link the glue code for accessing the readline library,
|
||||||
;;; but only when it isn't already present.
|
;;; but only when it isn't already present.
|
||||||
|
|
||||||
|
@ -39,9 +43,30 @@
|
||||||
'()
|
'()
|
||||||
'()))
|
'()))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;; Run-time options
|
||||||
|
|
||||||
|
(export
|
||||||
|
readline-options
|
||||||
|
readline-enable
|
||||||
|
readline-disable)
|
||||||
|
(export-syntax
|
||||||
|
readline-set!)
|
||||||
|
|
||||||
|
(define-option-interface
|
||||||
|
(readline-options-interface
|
||||||
|
(readline-options readline-enable readline-disable)
|
||||||
|
(readline-set!)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; MDJ 980513 <djurfeldt@nada.kth.se>:
|
;;; MDJ 980513 <djurfeldt@nada.kth.se>:
|
||||||
;;; There should probably be low-level support instead of this code.
|
;;; There should probably be low-level support instead of this code.
|
||||||
|
|
||||||
|
;;; Dirk:FIXME:: If the-readline-port, input-port or output-port are closed,
|
||||||
|
;;; guile will enter an endless loop or crash.
|
||||||
|
|
||||||
(define prompt "")
|
(define prompt "")
|
||||||
(define prompt2 "")
|
(define prompt2 "")
|
||||||
(define input-port (current-input-port))
|
(define input-port (current-input-port))
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
2001-01-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
This patch fixes a problem reported by Martin Grabmueller about
|
||||||
|
the impossibility to access readline's run-time options.
|
||||||
|
|
||||||
|
* boot-9.scm (define-option-interface): New macro. Allows to
|
||||||
|
conveniently define a group of option interface functions.
|
||||||
|
|
||||||
|
(readline-options readline-enable readline-disable,
|
||||||
|
readline-set!): Moved to guile-readline/readline.scm.
|
||||||
|
|
||||||
2001-01-24 Gary Houston <ghouston@arglist.com>
|
2001-01-24 Gary Houston <ghouston@arglist.com>
|
||||||
|
|
||||||
* boot-9.scm: don't import (ice-9 rdelim) here. it's done
|
* boot-9.scm: don't import (ice-9 rdelim) here. it's done
|
||||||
|
|
|
@ -2015,31 +2015,8 @@
|
||||||
|
|
||||||
;;; {Run-time options}
|
;;; {Run-time options}
|
||||||
|
|
||||||
((let* ((names '((eval-options-interface
|
(define define-option-interface
|
||||||
(eval-options eval-enable eval-disable)
|
(let* ((option-name car)
|
||||||
(eval-set!))
|
|
||||||
|
|
||||||
(debug-options-interface
|
|
||||||
(debug-options debug-enable debug-disable)
|
|
||||||
(debug-set!))
|
|
||||||
|
|
||||||
(evaluator-traps-interface
|
|
||||||
(traps trap-enable trap-disable)
|
|
||||||
(trap-set!))
|
|
||||||
|
|
||||||
(read-options-interface
|
|
||||||
(read-options read-enable read-disable)
|
|
||||||
(read-set!))
|
|
||||||
|
|
||||||
(print-options-interface
|
|
||||||
(print-options print-enable print-disable)
|
|
||||||
(print-set!))
|
|
||||||
|
|
||||||
(readline-options-interface
|
|
||||||
(readline-options readline-enable readline-disable)
|
|
||||||
(readline-set!))
|
|
||||||
))
|
|
||||||
(option-name car)
|
|
||||||
(option-value cadr)
|
(option-value cadr)
|
||||||
(option-documentation caddr)
|
(option-documentation caddr)
|
||||||
|
|
||||||
|
@ -2055,7 +2032,7 @@
|
||||||
(display (option-documentation option))
|
(display (option-documentation option))
|
||||||
(newline)))
|
(newline)))
|
||||||
|
|
||||||
;; Below follows the macros defining the run-time option interfaces.
|
;; Below follow the macros defining the run-time option interfaces.
|
||||||
|
|
||||||
(make-options (lambda (interface)
|
(make-options (lambda (interface)
|
||||||
`(lambda args
|
`(lambda args
|
||||||
|
@ -2085,27 +2062,49 @@
|
||||||
(begin (,interface (append (,interface)
|
(begin (,interface (append (,interface)
|
||||||
(list '(,'unquote name)
|
(list '(,'unquote name)
|
||||||
(,'unquote exp))))
|
(,'unquote exp))))
|
||||||
(,interface))))))
|
(,interface)))))))
|
||||||
)
|
|
||||||
(procedure->macro
|
(procedure->macro
|
||||||
(lambda (exp env)
|
(lambda (exp env)
|
||||||
(cons 'begin
|
(cons 'begin
|
||||||
(apply append
|
(let* ((option-group (cadr exp))
|
||||||
(map (lambda (group)
|
(interface (car option-group)))
|
||||||
(let ((interface (car group)))
|
|
||||||
(append (map (lambda (name constructor)
|
(append (map (lambda (name constructor)
|
||||||
`(define ,name
|
`(define ,name
|
||||||
,(constructor interface)))
|
,(constructor interface)))
|
||||||
(cadr group)
|
(cadr option-group)
|
||||||
(list make-options
|
(list make-options
|
||||||
make-enable
|
make-enable
|
||||||
make-disable))
|
make-disable))
|
||||||
(map (lambda (name constructor)
|
(map (lambda (name constructor)
|
||||||
`(defmacro ,name
|
`(defmacro ,name
|
||||||
,@(constructor interface)))
|
,@(constructor interface)))
|
||||||
(caddr group)
|
(caddr option-group)
|
||||||
(list make-set!)))))
|
(list make-set!)))))))))
|
||||||
names)))))))
|
|
||||||
|
(define-option-interface
|
||||||
|
(eval-options-interface
|
||||||
|
(eval-options eval-enable eval-disable)
|
||||||
|
(eval-set!)))
|
||||||
|
|
||||||
|
(define-option-interface
|
||||||
|
(debug-options-interface
|
||||||
|
(debug-options debug-enable debug-disable)
|
||||||
|
(debug-set!)))
|
||||||
|
|
||||||
|
(define-option-interface
|
||||||
|
(evaluator-traps-interface
|
||||||
|
(traps trap-enable trap-disable)
|
||||||
|
(trap-set!)))
|
||||||
|
|
||||||
|
(define-option-interface
|
||||||
|
(read-options-interface
|
||||||
|
(read-options read-enable read-disable)
|
||||||
|
(read-set!)))
|
||||||
|
|
||||||
|
(define-option-interface
|
||||||
|
(print-options-interface
|
||||||
|
(print-options print-enable print-disable)
|
||||||
|
(print-set!)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue