From ce9a6ecea72d9a2eb5cf7bdd0e2fd39fdc42b2d9 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Tue, 17 May 2005 17:02:04 +0000
Subject: [PATCH] Change pprinter for declare to line up the variables neatly,
 if they extend over multiple lines.

---
 code/pprint.lisp | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/code/pprint.lisp b/code/pprint.lisp
index 595f04e58..4ec0be20a 100644
--- a/code/pprint.lisp
+++ b/code/pprint.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pprint.lisp,v 1.53 2005/05/12 18:49:02 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pprint.lisp,v 1.54 2005/05/17 17:02:04 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1394,8 +1394,38 @@
 
 (defun pprint-declare (stream list &rest noise)
   (declare (ignore noise))
-  (funcall (formatter "~:<~W~^~@_ ~:I~W~@{ ~_~W~}~:>")
-	   stream list))
+  (pprint-logical-block (stream list :prefix "(" :suffix ")")
+    ;; Output "declare"
+    (output-object (pprint-pop) stream)
+    (pprint-exit-if-list-exhausted)
+    (pprint-newline :miser stream)
+    (write-char #\space stream)
+    (pprint-indent :current 0 stream)
+    ;; Print out each spec.
+    (loop
+       (let ((spec (pprint-pop)))
+	 ;; If the spec begins with TYPE, we indent it so that vars
+	 ;; are lined up after the actual type.  Otherwise, we just
+	 ;; make them all line up after the first symbol of the
+	 ;; spec.
+	 (pprint-logical-block (stream spec :prefix "(" :suffix ")")
+	   (when (eq (car spec) 'type)
+	     (output-object (pprint-pop) stream)
+	     (pprint-exit-if-list-exhausted)
+	     (pprint-newline :miser stream)
+	     (write-char #\space stream))
+	   (output-object (pprint-pop) stream)
+	   (pprint-exit-if-list-exhausted)
+	   (pprint-newline :miser stream)
+	   (write-char #\space stream)
+	   (pprint-indent :current 0 stream)
+	   (loop
+	      (output-object (pprint-pop) stream)
+	      (pprint-exit-if-list-exhausted)
+	      (write-char #\space stream)
+	      (pprint-newline :fill stream))))
+       (pprint-exit-if-list-exhausted)
+       (pprint-newline :linear stream))))
 
 (defun pprint-defun (stream list &rest noise)
   (declare (ignore noise))
-- 
GitLab