Summary

pretty-print-width not honored by pretty-print in some cases.

Metadata

Description

I'm printing out some fairly large symbolic expressions. They are printing well past column 79, even in cases where I can see formatting that could be done to bring them under 79 columns. Here is a recent example:

 (text (paragraphs
         (paragraph
           (sentence
             (term (sumti (LA-clause
                            (cmavo (LA "la"))
                            (CMENE-clause cmene "frank"))))
             (selbri (BRIVLA-clause (gismu "cusku")))
             (term (sumti (LU-clause
                            (cmavo (LU "lu"))
                            (text (paragraphs
                                    (paragraph
                                      (sentence
                                        (term (sumti (KOhA-clause (cmavo (KOhA "mi")))))
                                        (selbri (BRIVLA-clause (gismu "prami")))
                                        (term (sumti (KOhA-clause
                                                       (cmavo (KOhA "do"))
                                                       (TO-clause
                                                         (cmavo (TO "to'i"))
                                                         (UI-clause (cmavo (UI "sa'a")))
                                                         (text (paragraphs
                                                                 (paragraph
                                                                   (sentence
                                                                     (term (sumti (KOhA-clause (cmavo (KOhA "do")))))
                                                                     (selbri (GOhA-clause (cmavo (GOhA "du"))))
                                                                     (term (sumti (LA-clause
                                                                                    (cmavo (LA "la"))
                                                                                    (CMENE-clause cmene "djein"))))))))
                                                         (TOI-clause (cmavo (TOI "toi")))))))))))
                            (LIhU-clause (cmavo (LIhU "li'u"))))))))))

I would expect some of the earlier constructs, like the first (text ...) element, or the (term ...) elements under (sentence ...) to be folded like (paragraphs (paragraph (sentence ...))) is.

Changes and comments

[2011-02-04 13:18:20 UTC] alanpost set cc to alanpost@sunflowerriver.org

[2011-02-05 15:36:01 UTC] sjamaan removed milestone 4.7.0

[2011-06-18 20:24:41 UTC] felix changed status from new to closed

[2011-06-18 20:24:41 UTC] felix set resolution to wontfix

[2011-06-18 20:24:41 UTC] felix wrote:

We use Marc Feeley's pretty-printer and, to be honest, I'm not very keen on hacking it. A better solution would be an implementation from scratch. `pretty-print` does basically work, it is neither extensible nor particularly great, but works. So, I'd like to close this. Feel free to reopen the ticket, if you think this is critical. In that case we should write a new pretty-printer.