guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for ice-9/format.scm (~&)


From: Matthias Koeppe
Subject: Patch for ice-9/format.scm (~&)
Date: 05 Jun 2001 13:49:36 +0200

This little patch fixes the behavior of the ~& (fresh line) format
directive.  FORMAT used to maintain the current column in a global
variable, thus formats to different ports and other means of output
did not mix very well (see my recent test-suite addition).  This patch
makes FORMAT get the initial output column from the port via
PORT-COLUMN. (See a separate message for a patch that enables
PORT-COLUMN on output ports.) 

Index: ice-9/format.scm
===================================================================
RCS file: /cvs/guile/guile-core/ice-9/format.scm,v
retrieving revision 1.9
diff -u -r1.9 format.scm
--- ice-9/format.scm    2001/05/25 00:15:32     1.9
+++ ice-9/format.scm    2001/06/05 08:33:54
@@ -177,6 +177,8 @@
   (set! format:port port)              ; global port for output routines
   (set! format:case-conversion #f)     ; modifier case conversion procedure
   (set! format:flush-output #f)                ; ~! reset
+  (set! format:output-col              ; get current column from port
+       (or (port-column port) 0))
   (let ((arg-pos (format:format-work fmt args))
        (arg-len (length args)))
     (cond

-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]