[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044)
From: |
markpolesky |
Subject: |
Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044) |
Date: |
Fri, 30 May 2014 09:11:57 +0000 |
https://codereview.appspot.com/95710044/diff/20001/scm/documentation-lib.scm
File scm/documentation-lib.scm (right):
https://codereview.appspot.com/95710044/diff/20001/scm/documentation-lib.scm#newcode112
scm/documentation-lib.scm:112: (or (vector? val) ; vector is an ly-type
On 2014/05/30 08:38:23, dak wrote:
Comment makes no sense.
Would this pseudocode suffice?
; (ly-type? vector) => #t
The problem is that we need to make sure that most LilyPond internal
"datatypes" don't get displayed with @verbatim, since (pretty-print)
doesn't work on them, and they'll sail right past the page/screen
margin. I'm not sure what else to call them; I'm referring to things
that look like #<Mom > or #<simple-closure > etc.
So this prevents that problem:
(not (ly-type? val))
but causes another problem, namely that vectors would end up not getting
(pretty-print), which is the point after all. Hence the conditional:
(or (vector? val) ...
If the pseudocode I proposed above is still too abstruse, I welcome your
suggestions.
https://codereview.appspot.com/95710044/diff/20001/scm/documentation-lib.scm#newcode138
scm/documentation-lib.scm:138: (lambda (port) (pretty-print val port
#:display? #t))
On 2014/05/30 08:38:23, dak wrote:
Wouldn't #:display? #t show a partial value of "string" as string
without
quotes? The examples in the issue report don't contain strings, so
it's hard to
guess.
That's correct, no quotes, hence the added quotes a few lines below:
(string-append "\"" str "\"")
An example is in the BarLine node, which after processing looks like
this in internals.texi:
@item @code{glyph} (string):
@code{"|"}
https://codereview.appspot.com/95710044/diff/20001/scm/documentation-lib.scm#newcode144
scm/documentation-lib.scm:144: (string-regexp-substitute "\n " "\n "
str)))
On 2014/05/30 08:38:23, dak wrote:
pretty-print has a key #:per-line-prefix. Would that be easier to
use?
Yes, thank you.
https://codereview.appspot.com/95710044/
- Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), markpolesky, 2014/05/30
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), dak, 2014/05/30
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044),
markpolesky <=
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), markpolesky, 2014/05/30
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), dak, 2014/05/30
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), markpolesky, 2014/05/30
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), dak, 2014/05/31
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), dak, 2014/05/31
- Re: Issue 3935: Use (pretty-print) for some IR props. (issue 95710044), markpolesky, 2014/05/31