diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index ce95db053..0427f05c5 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,8 @@ +1998-11-01 Mikael Djurfeldt + + * emacs.scm (format): Bugfix: Handle multiple arguments + correctly. (Thanks to Thien-Thi Nguyen.) + 1998-11-01 Mikael Djurfeldt * boot-9.scm (exit-hook): New hook: Is run at the very end of an diff --git a/ice-9/emacs.scm b/ice-9/emacs.scm index d814711e0..9fa2e236d 100644 --- a/ice-9/emacs.scm +++ b/ice-9/emacs.scm @@ -206,7 +206,8 @@ (define (format template . rest) (let loop ((chars (string->list template)) - (result '())) + (result '()) + (rest rest)) (cond ((null? chars) (list->string (reverse result))) ((char=? (car chars) #\%) (loop (cddr chars) @@ -215,8 +216,9 @@ (case (cadr chars) ((#\S) (object->string (car rest))) ((#\s) (object->string (car rest) display))))) - result))) - (else (loop (cdr chars) (cons (car chars) result)))))) + result) + (cdr rest))) + (else (loop (cdr chars) (cons (car chars) result) rest))))) (define (error-args->string args) (let ((msg (apply format (caddr args) (cadddr args))))