1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

* emacs.scm (format): Bugfix: Handle multiple arguments

correctly.  (Thanks to Thien-Thi Nguyen.)
This commit is contained in:
Mikael Djurfeldt 1998-11-01 04:52:58 +00:00
parent d0b7bad785
commit 0b6925feca
2 changed files with 10 additions and 3 deletions

View file

@ -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> 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 * boot-9.scm (exit-hook): New hook: Is run at the very end of an

View file

@ -206,7 +206,8 @@
(define (format template . rest) (define (format template . rest)
(let loop ((chars (string->list template)) (let loop ((chars (string->list template))
(result '())) (result '())
(rest rest))
(cond ((null? chars) (list->string (reverse result))) (cond ((null? chars) (list->string (reverse result)))
((char=? (car chars) #\%) ((char=? (car chars) #\%)
(loop (cddr chars) (loop (cddr chars)
@ -215,8 +216,9 @@
(case (cadr chars) (case (cadr chars)
((#\S) (object->string (car rest))) ((#\S) (object->string (car rest)))
((#\s) (object->string (car rest) display))))) ((#\s) (object->string (car rest) display)))))
result))) result)
(else (loop (cdr chars) (cons (car chars) result)))))) (cdr rest)))
(else (loop (cdr chars) (cons (car chars) result) rest)))))
(define (error-args->string args) (define (error-args->string args)
(let ((msg (apply format (caddr args) (cadddr args)))) (let ((msg (apply format (caddr args) (cadddr args))))