jed-users mailing list

[2011 Date Index] [2011 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [Jed-users-l] diffmode, custom_color and custom_variable


On 10.01.11, Manfred Hanke wrote:

...

> >> If I use a mere `set_color', diffmode.sl will still override it.

You are right. Thanks for pointing this out.

While the recommended way to customize a "custom_variable" is:

  variable foo = 3;
  
a custom_color needs:

  add_color_object("foo");
  set_color("foo", "blue", "red");
  
similar to a buffer-local variable:
  
  create_blocal_var("foo");
  set_blocal_var(3, "foo");   % ! first argument is value !

However, buffer-local variables can be defined and set at once with
 
  define_blocal_var("foo", 3);

While custom_color() will also define and set the color object in one
function, it is not well suited for use in jed.rc, as it does not
change existing definitions.

I now changed the documentation to diffmode:

--- /home/milde/.jed/lib/diffmode.sl~	2009-12-08 23:42:45.000000000 +0100
+++ /tmp/diffmode11702.3341.sl	2011-01-10 20:38:56.000000000 +0100
@@ -84,6 +84,7 @@
 % "diff_deleted", "diff_added", "diff_oldfile", "diff_newfile", "diff_cmd" in
 % jed.rc, e.g.
 %
+%        add_color_object("diff_deleted");
 %        set_color("diff_deleted", "blue", "red");
 %


@ John: feature request:

A new function:

  define define_color(color, fg, bg)
  {
     add_color_object(color);
     set_color(color, fg, bg);
  }


> > While I don't see a return value either, I see the use of it only in
> > the S-Lang library, as similar to custom_color(), it provides a
> > fallback definition.

> I'm really sorry if I created some confusion here! From my experience 
> described above, I came to the conclusion that -- as I have to call 
> add_color followed by set_color -- custom_color was made for me, and 
> that the statement in the documentation was probably a mistake...
> I appologize, this thought was quite arrogant! ;-)

No need to apologize, you helped to clear my understanding of the
color customization and highlighted some weaknesses in the documentation.

Günter
_______________________________________________
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]