Skip to content

Commit 93bc015

Browse files
author
Shannon Spires
committed
In format-logical-block, the check for non-empty *format-arguments* should
only happen in the (not asign) case. Per GZ. Fixes Issue #112.
1 parent a68ec36 commit 93bc015

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lib/format.lisp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -980,22 +980,22 @@ and (nthcdr *format-arguments-variance* *format-arguments*)")
980980
(when end-atsign (setq body-string (format-fill-transform body-string)))
981981
(format-check-simple prefix)
982982
(format-check-simple suffix)
983-
(unless *format-arguments*
984-
(setq *format-index* start)
985-
(format-error "Missing argument"))
986983
(let ((args (if (not atsign)
987-
; This piece of garbage is needed to avoid double length counting from (formatter ...) things
988-
; but also to allow (flet . t) not to barf.
989-
; Was formerly simply (if *format-arguments* (pop-format-arg))
990-
; Actually wanna not count the arg iff the ~< is at the top level
991-
; in a format string i.e. "is this the first ~< in THIS string?"
992-
(when *format-arguments*
993-
(if (and (listp *format-arguments*)
994-
(first-block-p start))
995-
(pop *format-arguments*) ; dont count
996-
(pop-format-arg))) ; unless not listp or not first
997-
(prog1 *format-arguments*
998-
(setq *format-arguments* nil))))
984+
; This piece of garbage is needed to avoid double length counting from (formatter ...) things
985+
; but also to allow (flet . t) not to barf.
986+
; Was formerly simply (if *format-arguments* (pop-format-arg))
987+
; Actually wanna not count the arg iff the ~< is at the top level
988+
; in a format string i.e. "is this the first ~< in THIS string?"
989+
(if *format-arguments*
990+
(if (and (listp *format-arguments*)
991+
(first-block-p start))
992+
(pop *format-arguments*) ; dont count
993+
(pop-format-arg)) ; unless not listp or not first
994+
(progn
995+
(setq *format-index* start)
996+
(format-error "Missing argument")))
997+
(prog1 *format-arguments*
998+
(setq *format-arguments* nil))))
999999
(*format-control-string* body-string)
10001000
(*format-top-level* (and atsign *format-top-level*)))
10011001
(let ((*logical-block-p* t)

0 commit comments

Comments
 (0)