From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 03 16:04:46 2011 Received: (at submit) by debbugs.gnu.org; 3 Oct 2011 20:04:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RAokn-000235-KP for submit@debbugs.gnu.org; Mon, 03 Oct 2011 16:04:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RAojJ-00020i-4y for submit@debbugs.gnu.org; Mon, 03 Oct 2011 16:03:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAoht-0003nE-Tg for submit@debbugs.gnu.org; Mon, 03 Oct 2011 16:01:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:42100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAoht-0003nA-SH for submit@debbugs.gnu.org; Mon, 03 Oct 2011 16:01:45 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAoht-0004hL-1c for bug-guile@gnu.org; Mon, 03 Oct 2011 16:01:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAohr-0003mv-VK for bug-guile@gnu.org; Mon, 03 Oct 2011 16:01:45 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:42600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAohr-0003mP-E0 for bug-guile@gnu.org; Mon, 03 Oct 2011 16:01:43 -0400 Received: from yeeloong (unknown [82.67.194.89]) by smtp5-g21.free.fr (Postfix) with SMTP id B6FBDD48245 for ; Mon, 3 Oct 2011 22:01:30 +0200 (CEST) Received: by yeeloong (sSMTP sendmail emulation); Mon, 03 Oct 2011 21:59:48 +0200 Date: Mon, 3 Oct 2011 21:59:48 +0200 From: rixed@happyleptic.org To: bug-guile@gnu.org Subject: (format #t "~3tX") fails in the REPL Message-ID: <20111003195947.GA7571@yeeloong.happyleptic.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Guile-Version: 2.0.2.39-335c8 User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 03 Oct 2011 16:04:42 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) The ~t formater is not working according to spec in the REPL. Try this for instance: (format #t "~10tA~20tB~30tC~40tD") will print: AB C D Although it works from a script or when outputing to a sting. Also, it works after a newline. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 04 12:06:39 2011 Received: (at 9664) by debbugs.gnu.org; 4 Oct 2011 16:06:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RB7Vu-0002Fl-Em for submit@debbugs.gnu.org; Tue, 04 Oct 2011 12:06:39 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RB2ll-00021e-AF for 9664@debbugs.gnu.org; Tue, 04 Oct 2011 07:02:43 -0400 Received: by wyh21 with SMTP id 21so367390wyh.3 for <9664@debbugs.gnu.org>; Tue, 04 Oct 2011 04:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=N3/VBHXopu+pycpSgxwblyR87x2WBo188ojL3PavgVY=; b=Nvjw2udRZoeLPnnJQwky/JLK8DheeQU62ASrMLfRgmNqNpsYi58wHFiYuVUBR04mTp nYGYeR91u1jUp/n+xfdOEJvVz5en7t98xVuszquKvY8vkWmac/a5hxpgGFuW1b0ZiMlY uPskZDLmLkzkd9oMTTRyxAPCAiQpI/9YY8CF4= Received: by 10.216.179.7 with SMTP id g7mr929700wem.64.1317726072257; Tue, 04 Oct 2011 04:01:12 -0700 (PDT) Received: from Kagami.home (host86-177-158-54.range86-177.btcentralplus.com. [86.177.158.54]) by mx.google.com with ESMTPS id y10sm2648741wbm.14.2011.10.04.04.01.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Oct 2011 04:01:10 -0700 (PDT) From: Ian Price To: 9664@debbugs.gnu.org Subject: bug#9664: (format #t "~3tX") fails in the REPL Date: Tue, 04 Oct 2011 11:59:11 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 9664 X-Mailman-Approved-At: Tue, 04 Oct 2011 12:06:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) --=-=-= 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" --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Reset-port-column-before-evaluating-at-REPL.patch Content-Description: reset column number >From 7a457be8c43051817b18d425a76b296f0f1fc730 Mon Sep 17 00:00:00 2001 From: Ian Price 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 05 14:18:39 2011 Received: (at 9664) by debbugs.gnu.org; 5 Oct 2011 18:18:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBW3D-0003k5-CJ for submit@debbugs.gnu.org; Wed, 05 Oct 2011 14:18:39 -0400 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62] helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBW3A-0003jx-2x for 9664@debbugs.gnu.org; Wed, 05 Oct 2011 14:18:37 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 1663E8660; Wed, 5 Oct 2011 14:18:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=7ncIWgE93gSCluWTMh/gfu0rmB4=; b=jd+R// 6Cszn66UpvPtlPYjhxqBK48aYOeT5n7nYnz/jUjrBi/uZYS6YNE76GxT/Dt/9zZu 3P47n7D8WlvZB/xtsXNLafQO3yCVUp4JATghIavnf+jMrfBl+p0CW6pMI6Bzq3Qa 9e44sjfc0ZF0tPdlXSPSZuTg6fBLPUVj11gUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=uvh9fWJNwoeWTqotj+tfeWvuivqe/9Jk SG7YarIUUu/zHV3tfwaoFMuN4+0vzmyrsmVdN8u+bF5jGh907pLELwnTIkoGmEsI WZpCRzBdESDxNyq5DTGJPQ0aarbzm1br4EZWw073k22IDC4X263sTdjVm3E17eFr RGcVnCpum1c= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 0F03A865F; Wed, 5 Oct 2011 14:18:31 -0400 (EDT) Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 82EDA865E; Wed, 5 Oct 2011 14:18:30 -0400 (EDT) From: Andy Wingo To: rixed@happyleptic.org Subject: Re: bug#9664: (format #t "~3tX") fails in the REPL References: <20111003195947.GA7571@yeeloong.happyleptic.org> Date: Wed, 05 Oct 2011 20:18:26 +0200 In-Reply-To: <20111003195947.GA7571@yeeloong.happyleptic.org> (rixed@happyleptic.org's message of "Mon, 3 Oct 2011 21:59:48 +0200") Message-ID: <87r52rti8d.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pobox-Relay-ID: 6DB84CF6-EF7E-11E0-80B8-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 9664 Cc: 9664@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On Mon 03 Oct 2011 21:59, rixed@happyleptic.org writes: > The ~t formater is not working according to spec in the REPL. > Try this for instance: > > (format #t "~10tA~20tB~30tC~40tD") > > will print: > > AB C D > > Although it works from a script or when outputing to a sting. > > Also, it works after a newline. It appears that there is some difference between the readline-enabled reader and the normal one. $ meta/guile -q scheme@(guile-user)> (port-column (current-output-port)) $1 = 21 It is 0 with the readline reader. I don't think the set-port-column! fix is right. Why is the newline not being chomped after the `(read)', I wonder? Andy -- http://wingolog.org/ From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 16 17:15:57 2011 Received: (at 9664-done) by debbugs.gnu.org; 16 Nov 2011 22:15:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQnls-0007lR-V1 for submit@debbugs.gnu.org; Wed, 16 Nov 2011 17:15:57 -0500 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62] helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQnlq-0007lI-2s for 9664-done@debbugs.gnu.org; Wed, 16 Nov 2011 17:15:55 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 5C91D8BC5; Wed, 16 Nov 2011 17:15:06 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=e57lZUpU4oLbL7xufn8LdTjP5Tg=; b=mtL3Dk 8prl1hBisTZIUDwJ6oM9d1h7Pv3x8G+0/H7Sz2zL7BH8XcA6n5teWmy+x+L1wH0V He/8SDkHqNtAYNXBb5sEJjp4W13MgFAErgmlPwE6Sr87pFDPGceD5QzMhS9ZoTEB byz7IsR/nn2+oHba6z6agFXRAcZWvPcqR7bDI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=NEkVHMJwo+0Q1xVCWUyT/XtbRwxs4vjf u6RBdZzyxuS99scGlk0oNSNCWgPffV4AeNgAu0q+VwLLbhl76Vg95wmNGEhUhIrD 0dkZSYRPQk3ADFPClUV1nrzec0yORpxOuM/GfJlYibOsqUWJ4aoyiXVZ0qioRh+w LRre9At51YA= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 55EFE8BC4; Wed, 16 Nov 2011 17:15:06 -0500 (EST) Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 9A71C8BC0; Wed, 16 Nov 2011 17:15:04 -0500 (EST) From: Andy Wingo To: rixed@happyleptic.org Subject: Re: bug#9664: (format #t "~3tX") fails in the REPL References: <20111003195947.GA7571@yeeloong.happyleptic.org> <87r52rti8d.fsf@pobox.com> Date: Wed, 16 Nov 2011 23:15:00 +0100 In-Reply-To: <87r52rti8d.fsf@pobox.com> (Andy Wingo's message of "Wed, 05 Oct 2011 20:18:26 +0200") Message-ID: <87r517k93v.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pobox-Relay-ID: 6F68E8BA-10A0-11E1-AABA-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 9664-done Cc: 9664-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) On Wed 05 Oct 2011 20:18, Andy Wingo writes: > It appears that there is some difference between the readline-enabled > reader and the normal one. > > $ meta/guile -q > scheme@(guile-user)> (port-column (current-output-port)) > $1 = 21 > > It is 0 with the readline reader. > > I don't think the set-port-column! fix is right. Why is the newline not > being chomped after the `(read)', I wonder? That isn't the right question, it turns out. 21 is the length of the `scheme@(guile-user)> ' prompt. We need to set the output port column to 0 after printing a prompt. In the readline case it's different because readline is the part that prints the prompt. Fixed in stable-2.0. Thanks for the report, Andy -- http://wingolog.org/ From unknown Sat Aug 16 21:12:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 15 Dec 2011 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator