Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2103)

Issue 115065: Make default margin values depend on paper size.

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 7 months ago by xmichael-k
Modified:
14 years, 7 months ago
Reviewers:
carl.d.sorensen
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Make default margin values depend on paper size.

Patch Set 1 #

Patch Set 2 : Extended range of paper settings that are scaled. #

Total comments: 4

Patch Set 3 : Improve error checking and code style #

Patch Set 4 : More improvements concerning error checking and code style #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -8 lines) Patch
M scm/paper.scm View 1 2 3 1 chunk +17 lines, -8 lines 0 comments Download

Messages

Total messages: 1
Carl
14 years, 7 months ago (2009-09-07 16:37:48 UTC) #1
I like what you've done.

I've put a couple of comments in.  They are not mandatory, but just for your
consideration.

Carl

http://codereview.appspot.com/115065/diff/1001/1003
File scm/paper.scm (right):

http://codereview.appspot.com/115065/diff/1001/1003#newcode220
Line 220: (scaleable-values (list
I think it would be better to use symbols, rather than strings, here.  I don't
have a strong preference for this; obviously these strings are only used locally
to define symbols later on.

But the things they stand for are symbols elsewhere in the code, so I'd prefer
using symbols here.

http://codereview.appspot.com/115065/diff/1001/1003#newcode221
Line 221: (cons "left-margin" w)
I think you could alternatively do (either with symbols or strings):

(scaleable-values `((left-margin . ,w)
                                    (right-margin . ,w)
                                    (top-margin . ,h)
                                    ...
                                    (short-indent . ,w))

http://codereview.appspot.com/115065/diff/1001/1003#newcode232
Line 232: ((value-symbol (string->symbol (string-append (car value)
"-default")))
I you were using symbols, you'd have

(value-symbol 
  (string->symbol (string-append
                       (symbol->string (car value))
                       "-default")))

http://codereview.appspot.com/115065/diff/1001/1003#newcode244
Line 244: (module-define! m 'left-margin-default-scaled (cdr (assoc
"left-margin" scaled-values)))
This is a potential error waiting to cause problems for  a user.  assoc can
return #f, and (cdr #f) is an error. 

If you use assoc-get, you can supply a default value, e.g.
(module-define! m 'left-margin-default-scaled (assoc-get 'left-margin
scaled-values default-value))

where default-value is whatever the reasonable default value would be if things
somehow got broken.

I realize that you have just built the list here, so you're in control and it
can be argued that this is not necessary.  I'm not demanding this change, just
asking you to consider it.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b