Re: Add user-init option to include a custom init snippet (not replacing the whole init file) (issue1901042)

2010-08-22 Thread reinhold . kainhofer

On 2010/07/28 14:09:54, c_sorensen_byu.edu wrote:

>> On 2010/07/27 20:16:58, Neil Puttock wrote:
>>> user-include ?
>> How about custom-definitions or user-definitions (no, sounds too

much

>> like it defines users)?
> How about --user-startup or --custom-startup?
How about --extra-init, or --include-init ?


I now changed the option name to -dinclude-settings, which describes it
best IMO. I have also pushed this to master.

http://codereview.appspot.com/1901042/

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


Re: Add user-init option to include a custom init snippet (not replacing the whole init file) (issue1901042)

2010-07-28 Thread Carl Sorensen
On 7/28/10 4:49 AM, "Ian Hulin"  wrote:

> Hi Reinhold,
> On 28/07/10 01:43, reinhold.kainho...@gmail.com wrote:
>> Reviewers: Neil Puttock,
>> 
>> 
>> http://codereview.appspot.com/1901042/diff/2001/3001
>> File ly/init.ly (right):
>> 
>> http://codereview.appspot.com/1901042/diff/2001/3001#newcode26
>> ly/init.ly:26: #(if (ly:get-option 'user-init)
>> On 2010/07/27 20:16:58, Neil Puttock wrote:
>>> user-include ?
>> 
>> Hmm, actually, I don't like either user-init (indicates it's part of the
>> init sequence and has similar uses as the --init command line option;
>> also it sounds too technical) nor user-include (to me that sounds like
>> setting an include path)...
>> 
>> How about custom-definitions or user-definitions (no, sounds too much
>> like it defines users)?
> How about --user-startup or --custom-startup?
> 
> The real problem you have here is that we use --init option to supersede
> the whole startup/initialization file.  This one is an additional one to
> do just for this user session, so user-startup says what it does on the can.

How about --extra-init, or --include-init ?

Carl


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


Re: Add user-init option to include a custom init snippet (not replacing the whole init file) (issue1901042)

2010-07-28 Thread Ian Hulin

Hi Reinhold,
On 28/07/10 01:43, reinhold.kainho...@gmail.com wrote:

Reviewers: Neil Puttock,


http://codereview.appspot.com/1901042/diff/2001/3001
File ly/init.ly (right):

http://codereview.appspot.com/1901042/diff/2001/3001#newcode26
ly/init.ly:26: #(if (ly:get-option 'user-init)
On 2010/07/27 20:16:58, Neil Puttock wrote:

user-include ?


Hmm, actually, I don't like either user-init (indicates it's part of the
init sequence and has similar uses as the --init command line option;
also it sounds too technical) nor user-include (to me that sounds like
setting an include path)...

How about custom-definitions or user-definitions (no, sounds too much
like it defines users)?

How about --user-startup or --custom-startup?

The real problem you have here is that we use --init option to supersede
the whole startup/initialization file.  This one is an additional one to
do just for this user session, so user-startup says what it does on the can.

Cheers,

Ian

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


Re: Add user-init option to include a custom init snippet (not replacing the whole init file) (issue1901042)

2010-07-27 Thread Graham Percival
On Wed, Jul 28, 2010 at 12:43:08AM +, reinhold.kainho...@gmail.com wrote:
> On 2010/07/27 20:16:58, Neil Puttock wrote:
>> user-include ?
>
> Hmm, actually, I don't like either user-init (indicates it's part of the
> init sequence and has similar uses as the --init command line option;
> also it sounds too technical) nor user-include (to me that sounds like
> setting an include path)...
>
> How about custom-definitions or user-definitions (no, sounds too much
> like it defines users)?

Don't forget that this is aimed at lilypond users, not C
programmers -- they're used to seeing&writing \include "".  I
can't imagine many people getting confused with an include path.

I suppose you could use file-include or include-file if you
prefer, but I definitely encourage using "include" somewhere in
the option name.

Cheers,
- Graham

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


Re: Add user-init option to include a custom init snippet (not replacing the whole init file) (issue1901042)

2010-07-27 Thread reinhold . kainhofer

Reviewers: Neil Puttock,


http://codereview.appspot.com/1901042/diff/2001/3001
File ly/init.ly (right):

http://codereview.appspot.com/1901042/diff/2001/3001#newcode26
ly/init.ly:26: #(if (ly:get-option 'user-init)
On 2010/07/27 20:16:58, Neil Puttock wrote:

user-include ?


Hmm, actually, I don't like either user-init (indicates it's part of the
init sequence and has similar uses as the --init command line option;
also it sounds too technical) nor user-include (to me that sounds like
setting an include path)...

How about custom-definitions or user-definitions (no, sounds too much
like it defines users)?

http://codereview.appspot.com/1901042/diff/2001/3001#newcode27
ly/init.ly:27: (begin
On 2010/07/27 20:16:58, Neil Puttock wrote:

remove


Oops, right. I had a debug statement there, too, which I removed in the
second revision, so the begin is not necessary any more

Description:
Add user-init option to include a custom init snippet (not replacing the
whole init file)

This allows the user to apply the same set of options/definitions to
different files. In particular,
  lilypond -duser-include=myinclude.ily file.ly
will compile file.ly, but read and execut myinclude.ily before file.ly
is processed. That way, e.g. global paper changes can be easily done,
and a file can be run several times, each time with a different
user-include file containing different settings.

This feature is similar to the --init=DATEI feature, except that --init
will replace the whole init sequence (thus your init file will copy all
of lilypond's init.ly), while -duser-include will only add some
definitions to the normal init sequence in init.ly (i.e. the file is
included using scheme in init.ly).

Please review this at http://codereview.appspot.com/1901042/show

Affected files:
  M ly/init.ly
  M scm/lily.scm


Index: ly/init.ly
diff --git a/ly/init.ly b/ly/init.ly
index  
20416624c2f54c73ab03b9ef4246d42571f3d914..cda58c1ea243d600f24879dd7d706997a9983b39  
100644

--- a/ly/init.ly
+++ b/ly/init.ly
@@ -22,6 +22,13 @@
 #(define book-filename #f)
 #(define book-output-suffix #f)
 #(use-modules (scm clip-region))
+
+#(if (ly:get-option 'user-init)
+ (begin
+   (ly:parser-include-string parser
+ (format "\\include \"~a\"" (ly:get-option 'user-init)))
+))
+
 \maininput
 %% there is a problem at the end of the input file

Index: scm/lily.scm
diff --git a/scm/lily.scm b/scm/lily.scm
index  
332f816b9030665775312557be792a822708eb11..247f7daab4b2a47fd95e6dc6afe071e708ff8b31  
100644

--- a/scm/lily.scm
+++ b/scm/lily.scm
@@ -169,6 +169,8 @@ second.  Dump results to `FILE.stacks' and
 `FILE.graph'.")
 (trace-scheme-coverage #f
 "Record coverage of Scheme files in `FILE.cov'.")
+(user-init #f
+"Global settings file, included before the score is processed.")
 (verbose ,(ly:command-line-verbose?)
 "Value of the --verbose flag (read-only).")
 (warning-as-error #f



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


Add user-init option to include a custom init snippet (not replacing the whole init file) (issue1901042)

2010-07-27 Thread n . puttock


http://codereview.appspot.com/1901042/diff/2001/3001
File ly/init.ly (right):

http://codereview.appspot.com/1901042/diff/2001/3001#newcode26
ly/init.ly:26: #(if (ly:get-option 'user-init)
user-include ?

http://codereview.appspot.com/1901042/diff/2001/3001#newcode27
ly/init.ly:27: (begin
remove

http://codereview.appspot.com/1901042/diff/2001/3001#newcode28
ly/init.ly:28: (ly:parser-include-string parser
indent

http://codereview.appspot.com/1901042/show

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