- Subject: Re: [Jed-users-l] diffmode, custom_color and custom_variable
- From: Manfred Hanke <Manfred.Hanke@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 08 Jan 2011 11:29:11 +0100
Hi,
Günter Milde wrote:
> I recommend to use autoload() instead of require() whenever possible,
Thanks for your advice -- and, by the way, for maintaining jedmodes!
I thought before that I have to load diffmode.sl already at startup in
order to customize the colors and disable the Diff_Use_Tree feature
(just as you do), but see now how clever the custom_{variable,color}
functions are: Even if diffmode.sl is loaded /after/ I set my
definitions, these values will be kept and not overwritten.
However, I don't see how the following works for you:
> I have in my jed.rc:
[...]
> set_color("diff_block", "black", "lightgray"); % @@
> set_color("diff_white", "black", "lightgray");
If I use a mere `set_color', diffmode.sl will still override it.
But I've just learned that using `custom_color' instead will do the job.
And another comment for John: I think the last two paragraphs of the
documentation of `custom_variable' are wrong. The function does not have
a return value, and as I take it now, users *are* encouraged to use
it... ;-) (A patch is attached below.)
Cheers,
Manfred
> custom_variable: library function
>
> SYNOPSIS
> custom_variable
>
> USAGE
> Integer_Type custom_variable (String_Type name, Any_Type value)
>
> DESCRIPTION
> This function is used to create a new public global variable called
> `name', initialized to `value', unless it exists. If the variable
> already exists but is not initialized, then it is initialized to
> `value'. This is quite useful for slang files with user configurable
> variables. These variables can be defined and initialized by users
> before evaluating the file, or can be defined and initialized to
> a default value in a file using this function.
>
> This function returns 2 if the variable `name' has been defined and
> initialized, or 1 if it has only been intialized. If the variable
> `name' has already been defined and initialized, this function does
> nothing and returns 0. If `name' is an invalid variable name, this
> function does nothing and returns -1.
>
> This function should be only used by slang programmers, not users.
>
> SEE ALSO
> custom_color
> diff --git a/lib/site.sl b/lib/site.sl
> index a628bb6..e6fc1ab 100644
> --- a/lib/site.sl
> +++ b/lib/site.sl
> @@ -186,7 +186,7 @@ variable LAST_SEARCH = Null_String;
> %!%+
> %\function{custom_variable}
> %\synopsis{custom_variable}
> -%\usage{Integer_Type custom_variable (String_Type name, Any_Type value)}
> +%\usage{custom_variable (String_Type name, Any_Type value)}
> %\description
> % This function is used to create a new public global variable called
> % \var{name}, initialized to \var{value}, unless it exists. If the variable
> @@ -195,14 +195,6 @@ variable LAST_SEARCH = Null_String;
> % variables. These variables can be defined and initialized by users
> % before evaluating the file, or can be defined and initialized to
> % a default value in a file using this function.
> -%
> -% This function returns 2 if the variable \var{name} has been defined and
> -% initialized, or 1 if it has only been intialized. If the variable
> -% \var{name} has already been defined and initialized, this function does
> -% nothing and returns 0. If \var{name} is an invalid variable name, this
> -% function does nothing and returns -1.
> -%
> -% This function should be only used by slang programmers, not users.
> %\seealso{custom_color}
> %!%-
> public define custom_variable (name, value)
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l
[2011 date index]
[2011 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]