                           (append accum-with-vars (list var))))
                 ;; Otherwise, a variable without a binding, like `z' in
                 ;; our example.
+                (when (eq it 'XXX)
+                  (throw 'done accum))
                 (push it vars)))
             (setq vars (nreverse vars))
             (setq bindings-found

                          bindings-found))
                ;; Otherwise, a variable without a binding, like `z' in
                ;; our example.
                (push it vars)))
            (setq vars (nreverse vars))
            (setq bindings-found

  (should
   (equal
    (wh/bound-syms '(let ((x 1))
                      (let (XXX)
                        3)))
    (list 'x)))
  (should
   (equal
    (wh/bound-syms '(let ((x 1))
                      (let ((XXX 2))
                        3)))
    (list 'x))))
