GNU bug report logs -
#9664
(format #t "~3tX") fails in the REPL
Previous Next
Reported by: rixed <at> happyleptic.org
Date: Mon, 3 Oct 2011 20:05:02 UTC
Severity: normal
Done: Andy Wingo <wingo <at> pobox.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 9664 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
When an expression is evaluated, the port-column is not 0. You can see
this by typing (write (port-column (current-output-port))) at the
repl. This means that when you do ~3t, it will not generate any spaces
as it is already past column 3.
This can be fixed by resetting port-position before we evaluate the REPL
expression.
--
Ian Price
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
[0001-Reset-port-column-before-evaluating-at-REPL.patch (text/x-patch, inline)]
From 7a457be8c43051817b18d425a76b296f0f1fc730 Mon Sep 17 00:00:00 2001
From: Ian Price <ianprice90 <at> googlemail.com>
Date: Tue, 4 Oct 2011 00:30:39 +0100
Subject: [PATCH] Reset port column before evaluating at REPL.
* module/system/repl/repl.scm (run-repl): Column-dependant commands
like the '~t' directive to format behave unexpectedly if column
number isn't reset.
---
module/system/repl/repl.scm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm
index 1cffa71..d028f38 100644
--- a/module/system/repl/repl.scm
+++ b/module/system/repl/repl.scm
@@ -190,6 +190,7 @@
(run-hook before-eval-hook exp)
(call-with-error-handling
(lambda ()
+ (set-port-column! (current-output-port) 0)
(with-stack-and-prompt thunk))
#:on-error (repl-option-ref repl 'on-error)))
(lambda (k) (values))))
--
1.7.6.4
This bug report was last modified 13 years and 249 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.