guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1.6.0 problems with libguilereadline-v-12 and fix


From: Thien-Thi Nguyen
Subject: Re: 1.6.0 problems with libguilereadline-v-12 and fix
Date: Thu, 19 Sep 2002 15:17:15 -0700

   From: Thien-Thi Nguyen <address@hidden>
   Date: Thu, 19 Sep 2002 12:58:22 -0700

   currently investigating, will get back later w/ report.

ok, check out the patch below.  it extracts option interface init to new
proc `%define-option-interface' and adds a call to that to the readline
init flow.

note that you should apply it from the top of the build tree and then do
"make" to recompose ice-9/boot-9.scm before "make install".

these readline bugs touch upon a hole in our testing; we have mechanism
to do "expect"-like tests but do not make use of it.  i guess this means
someone needs to do that... (grumble grumble :-).

thi

_________________________________________
cd ~/build/GNU/guile/hack/core-1-4/
cvs diff -rdynamic-readline-broken ice-9/boot-9/runtime-options.scm 
guile-readline/readline.scm
Index: ice-9/boot-9/runtime-options.scm
===================================================================
RCS file: /home/ttn/cvs/guile-core/ice-9/boot-9/runtime-options.scm,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** ice-9/boot-9/runtime-options.scm    29 Aug 2002 06:28:26 -0000      1.2
--- ice-9/boot-9/runtime-options.scm    19 Sep 2002 21:57:42 -0000      1.3
***************
*** 43,138 ****
  
  ;;; {Run-time options}
  
! ((let* ((names '((eval-options-interface
!                 (eval-options eval-enable eval-disable)
!                 (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-documentation caddr)
! 
!       (print-option (lambda (option)
!                       (display (option-name option))
!                       (if (< (string-length
!                               (symbol->string (option-name option)))
!                              8)
!                           (display #\tab))
!                       (display #\tab)
!                       (display (option-value option))
!                       (display #\tab)
!                       (display (option-documentation option))
!                       (newline)))
! 
!       ;; Below follows the macros defining the run-time option interfaces.
! 
!       (make-options (lambda (interface)
!                       `(lambda args
!                          (cond ((null? args) (,interface))
!                                ((list? (car args))
!                                 (,interface (car args)) (,interface))
!                                (else (for-each ,print-option
!                                                (,interface #t)))))))
! 
!       (make-enable (lambda (interface)
!                      `(lambda flags
!                         (,interface (append flags (,interface)))
!                         (,interface))))
  
!       (make-disable (lambda (interface)
                        `(lambda flags
!                          (let ((options (,interface)))
!                            (for-each (lambda (flag)
!                                        (set! options (delq! flag options)))
!                                      flags)
!                            (,interface options)
!                            (,interface)))))
! 
!       (make-set! (lambda (interface)
!                    `((name exp)
!                      (,'quasiquote
!                       (begin (,interface (append (,interface)
!                                                  (list '(,'unquote name)
!                                                        (,'unquote exp))))
!                              (,interface))))))
!       )
!    (procedure->macro
       (lambda (exp env)
         (cons 'begin
!            (apply append
!                   (map (lambda (group)
!                          (let ((interface (car group)))
!                            (append (map (lambda (name constructor)
!                                           `(define ,name
!                                              ,(constructor interface)))
!                                         (cadr group)
!                                         (list make-options
!                                               make-enable
!                                               make-disable))
!                                    (map (lambda (name constructor)
!                                           `(defmacro ,name
!                                              ,@(constructor interface)))
!                                         (caddr group)
!                                         (list make-set!)))))
!                        names)))))))
  
  ;;; runtime-options.scm ends here
--- 43,137 ----
  
  ;;; {Run-time options}
  
! (define %define-option-interface
!   (let* ((option-name car)
!        (option-value cadr)
!        (option-documentation caddr)
! 
!        (print-option (lambda (option)
!                        (display (option-name option))
!                        (if (< (string-length
!                                (symbol->string (option-name option)))
!                               8)
!                            (display #\tab))
!                        (display #\tab)
!                        (display (option-value option))
!                        (display #\tab)
!                        (display (option-documentation option))
!                        (newline)))
! 
!        ;; Below follow the macros defining the run-time option interfaces.
! 
!        (make-options (lambda (interface)
!                        `(lambda args
!                           (cond ((null? args) (,interface))
!                                 ((list? (car args))
!                                  (,interface (car args)) (,interface))
!                                 (else (for-each ,print-option
!                                                 (,interface #t)))))))
  
!        (make-enable (lambda (interface)
                        `(lambda flags
!                          (,interface (append flags (,interface)))
!                          (,interface))))
! 
!        (make-disable (lambda (interface)
!                        `(lambda flags
!                           (let ((options (,interface)))
!                             (for-each (lambda (flag)
!                                         (set! options (delq! flag options)))
!                                       flags)
!                             (,interface options)
!                             (,interface)))))
! 
!        (make-set! (lambda (interface)
!                     `((name exp)
!                       (,'quasiquote
!                        (begin (,interface (append (,interface)
!                                                   (list '(,'unquote name)
!                                                         (,'unquote exp))))
!                               (,interface)))))))
!     (procedure->memoizing-macro
       (lambda (exp env)
         (cons 'begin
!            (let* ((option-group (cadr exp))
!                   (interface (car option-group)))
!              (append (map (lambda (name constructor)
!                             `(define ,name
!                                ,(constructor interface)))
!                           (cadr option-group)
!                           (list make-options
!                                 make-enable
!                                 make-disable))
!                      (map (lambda (name constructor)
!                             `(defmacro ,name
!                                ,@(constructor interface)))
!                           (caddr option-group)
!                           (list make-set!)))))))))
! 
! (%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!)))
  
  ;;; runtime-options.scm ends here
Index: guile-readline/readline.scm
===================================================================
RCS file: /home/ttn/cvs/guile-core/guile-readline/readline.scm,v
retrieving revision 1.5
retrieving revision 1.6
diff -c -r1.5 -r1.6
*** guile-readline/readline.scm 29 Aug 2002 06:15:22 -0000      1.5
--- guile-readline/readline.scm 19 Sep 2002 22:07:52 -0000      1.6
***************
*** 59,64 ****
--- 59,66 ----
  
  (load-guile-internal-module "guilereadline")
  
+ ;; todo: move this before `define-module' once registration is external.
+ ;;       see (ice-9 threads) for example.
  (or (feature? 'readline)
      (error "readline is not provided in this Guile installation"))
  
***************
*** 208,212 ****
--- 210,227 ----
                      (set-readline-prompt! "" "")
                      (set-readline-read-hook! #f)))))
        (set! (using-readline?) #t))))
+ 
+ ;; Define the options.
+ 
+ (%define-option-interface
+   (readline-options-interface
+    (readline-options readline-enable readline-disable)
+    (readline-set!)))
+ 
+ (export readline-options-interface
+         readline-options
+         readline-enable
+         readline-disable
+         readline-set!)
  
  ;;; readline.scm ends here

Compilation exited abnormally with code 1 at Thu Sep 19 15:08:47




reply via email to

[Prev in Thread] Current Thread [Next in Thread]