Skip to content

Commit

Permalink
Merge pull request #113 from svspire/issue112
Browse files Browse the repository at this point in the history
Fix issue #112
  • Loading branch information
Shannon Spires authored Mar 6, 2018
2 parents 1ec62d3 + 93bc015 commit 31a25ea
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/format.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -980,22 +980,22 @@ and (nthcdr *format-arguments-variance* *format-arguments*)")
(when end-atsign (setq body-string (format-fill-transform body-string)))
(format-check-simple prefix)
(format-check-simple suffix)
(unless *format-arguments*
(setq *format-index* start)
(format-error "Missing argument"))
(let ((args (if (not atsign)
; This piece of garbage is needed to avoid double length counting from (formatter ...) things
; but also to allow (flet . t) not to barf.
; Was formerly simply (if *format-arguments* (pop-format-arg))
; Actually wanna not count the arg iff the ~< is at the top level
; in a format string i.e. "is this the first ~< in THIS string?"
(when *format-arguments*
(if (and (listp *format-arguments*)
(first-block-p start))
(pop *format-arguments*) ; dont count
(pop-format-arg))) ; unless not listp or not first
(prog1 *format-arguments*
(setq *format-arguments* nil))))
; This piece of garbage is needed to avoid double length counting from (formatter ...) things
; but also to allow (flet . t) not to barf.
; Was formerly simply (if *format-arguments* (pop-format-arg))
; Actually wanna not count the arg iff the ~< is at the top level
; in a format string i.e. "is this the first ~< in THIS string?"
(if *format-arguments*
(if (and (listp *format-arguments*)
(first-block-p start))
(pop *format-arguments*) ; dont count
(pop-format-arg)) ; unless not listp or not first
(progn
(setq *format-index* start)
(format-error "Missing argument")))
(prog1 *format-arguments*
(setq *format-arguments* nil))))
(*format-control-string* body-string)
(*format-top-level* (and atsign *format-top-level*)))
(let ((*logical-block-p* t)
Expand Down

0 comments on commit 31a25ea

Please sign in to comment.