Opened 11 years ago

Closed 10 years ago

#489 closed defect (wontfix)

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

Reported by: Alan Post Owned by:
Priority: minor Milestone:
Component: core libraries Version: 4.6.x
Keywords: Cc: alanpost@…
Estimated difficulty:

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.

Change History (3)

comment:1 Changed 11 years ago by Alan Post

Cc: alanpost@… added

comment:2 Changed 11 years ago by sjamaan

Milestone: 4.7.0

comment:3 Changed 10 years ago by felix winkelmann

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.