2009/8/11 Michael Käppler <xmichae...@web.de>:

> here is the first draft of a patch concerning the margin settings for
> review.

Some comments:

+           "Checks whether @code{left-margin}, @code{right-margin}
and @code{line-width)"

{line-width}

This and the following docstring lines are too long.

+  Real paper_width = scm_to_double (lookup_variable (ly_symbol2scm
("paper-width")));

+  Real left_margin_default = scm_to_double (lookup_variable
(ly_symbol2scm ("left-margin-default")));

+  Real right_margin_default = scm_to_double (lookup_variable
(ly_symbol2scm ("right-margin-default")));

These are unsafe, since they return SCM_UNSPECIFIED instead of a Real
if the paper variables aren't defined; using robust_scm2double () here
will ensure a default is returned.

You can see the consequences of variable lookup failure by running
bookparts.ly 
(http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=blob;f=input/regression/bookparts.ly;h=a814fb5e072911540ecf2ab44a7b7b09dae61835;hb=HEAD).
 This snippet also fails to get a sane value for paper-height in
layout->page-init.

Regards,
Neil


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to