[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make default margin values depend on paper size.

From: Carl . D . Sorensen
Subject: Make default margin values depend on paper size.
Date: Mon, 07 Sep 2009 16:37:48 +0000

I like what you've done.

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

File scm/paper.scm (right):
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.
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))
Line 232: ((value-symbol (string->symbol (string-append (car value)
I you were using symbols, you'd have

  (string->symbol (string-append
                       (symbol->string (car value))
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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]