summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ice-9/ChangeLog5
-rw-r--r--ice-9/emacs.scm8
2 files changed, 10 insertions, 3 deletions
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 <mdj@mdj.nada.kth.se>
+
+ * emacs.scm (format): Bugfix: Handle multiple arguments
+ correctly. (Thanks to Thien-Thi Nguyen.)
+
1998-11-01 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
* 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))))