Thank you for providing and maintaining the Geiser package.
The following exception was raised when evaluating a continuation in a Scheme buffer in Emacs using ‘geiser-eval-last-sexp’ (mapped to C-x C-e): *Geiser Debug* buffer: > (kont 2) > > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > In procedure display: Wrong type argument in position 2: #<closed: string > 7f318a27fd90> > > > [Debugging level: 1] This exception is not raised if: 1) The continuation expression is evaluated outside of Emacs using guile, or 2) The continuation expression is evaluated within Emacs in the *Geiser Guile REPL* buffer. In order to reproduce this problem, enter the following Scheme expressions into a Scheme buffer in Emacs with a running Geiser Guile REPL: (define kont #f) (format #t "the return is ~a\n" (call/cc (lambda (k) (set! kont k) 1))) (kont 2) These expressions are copied from the Guile info manual: (info "(guile) Continuations") If the three expressions above are entered into a separate running guile (outside of Emacs), they evaluate without any exceptions raised. Likewise, if they are entered at the prompt in a *Geiser Guile REPL* buffer (within Emacs), there is no exception raised. The problem appears to be in the evaluation of the expression: (format #t "the return is ~a\n" (call/cc (lambda (k) (set! kont k) 1))) If this expression is evaluated in the REPL buffer, then no exception is raised when the (kont 2) expression is evaluated. But if it is evaluated in a Scheme buffer (using C-x C-e), then the evaluation of the expression (kont 2) results in an exception. It is possible to evaluate the "(format #t...)" expression again in the REPL buffer, and the problem is resolved (that is, no exception is raised when evaluating the (kont 2) expression). Here are the messages that are displayed in *Geiser Debug* buffer when each of the three expressions above are evaluated in a Scheme buffer (using ‘geiser-eval-last-sexp’): 1. > (define kont #f) > > => #<unspecified> > 2. > (format #t "the return is ~a\n" (call/cc (lambda (k) (set! kont k) 1))) > > > => #t > > the return is 1 3. > (kont 2) > > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > In procedure display: Wrong type argument in position 2: #<closed: string > 7f318a27fd90> > > > [Debugging level: 1] The following versions were used to generate this problem: guile: 3.0.7 emacs: 28.2 geiser: 0.28.2 geiser-guile: 0.28.1 Please let me know if there is any more information that you need to reproduce this problem or if there is anything that is unclear in the description above. --