[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New file template
From: |
Daryl Lee |
Subject: |
Re: New file template |
Date: |
Fri, 1 Jul 2011 20:54:53 -0600 |
On Jul 1, 2011, at 6:50 PM, Ben Abbott wrote:
> On Jul 1, 2011, at 3:39 PM, Daryl Lee wrote:
>
>> Now that I've configured Octave to launch my preferred editor, I see that
>> when I say "edit newfile.m" it creates a very complete initial template,
>> ready for me to fill in all the gaps. Is there a way for me to modify that
>> template according to my own needs? Or maybe choose "on the fly" among
>> several? For instance, I may do some work for open source projects, some
>> with my employer's copyright, and some with a client's copyright. Am I
>> limited to just starting with the existing template and editing the newly
>> created file as needed?
>
> Take a look at what "help edit" describes.
>
> Regarding the license portion ...
>
>> `license'
>>
>> `gpl'
>> GNU General Public License (default).
>>
>> `bsd'
>> BSD-style license without advertising clause.
>>
>> `pd'
>> Public domain.
>>
>> `"text"'
>> Your own default copyright and license.
>>
>> Unless you specify `pd', edit will prepend the copyright
>> statement with "Copyright (C) yyyy Function Author".
>
> So you should be able to place your own license text in place of the GPL
> license (the default).
>
> edit ("license", "## place your license terms here")
>
> After that when you create a new m-file you should see license at the top.
>
> To change the copyright to another individual or entity ..
>
> edit ("author", "new.copyright.holder")
>
> Ben
>
I'll bet I could make a function that would let me choose easily from several
choices and the function would then call edit(...) a few times to set license
texts, author strings, etc.? That would be pretty powerful. Thanks.
--
Daryl Lee