Hi,

Is this the proper place to post small patches?

The patch below fixes a small annoyance in epic5 1.0.

I'm using a terminal application called jterm which
notices if the window contents changes.  This is very
useful, because I'm often on channels with few people
and lots of idle periods (i.e. nobody says anything).
If someone says something, my terminal app notices and
indicates it with a special notification mechanism.
So I can put the IRC windows in the background and
don't have to watch them all the time or have to check
them manually every now and then.

The problem is that the clock in the status line is
updated once per minute, and this is noticed by the
terminal app.

So I removed %T from $status_format (I don't need it;
there's already a clock on my desktop).  It doesn't
help, the status line is still refreshed once per
minute.

Next thing I tried was "set -status_clock".  Didn't
change anything either.

Finally I did "set clock off".  This did help, but now
the $Z variable and "on timer" events stopped working.
I don't really need $Z, but I need timer events for my
customized logging.

The patch below seems to solve the problem.  It's simple:
In the reset_clock() function (in source/clock.c), do
not call update_all_status() if the $status_clock
variable is empty.  In rare circumstances I still seem
to get a notification from my terminal even though the
contents of the IRC window don't have change apparently,
but I'm not sure what might be causing this.  Anyway,
this happens only seldom, so it's not a big problem.

Of course, if there is a better way to solve the problem,
I'll be glad to hear about it.

Best regards
   Oliver

--- source/clock.c.orig 2008-11-26 04:26:34.000000000 +0100
+++ source/clock.c      2009-02-20 15:26:27.000000000 +0100
@@ -143,6 +143,8 @@
 
 void   reset_clock (void *stuff)
 {
+       char *  sclock;
+
        if (x_debug & DEBUG_BROKEN_CLOCK)
                reset_broken_clock();
        else if (get_int_var(METRIC_TIME_VAR))
@@ -150,7 +152,9 @@
        else
                reset_standard_clock();
 
-       update_all_status();
+       sclock = get_string_var(STATUS_CLOCK_VAR);
+       if (sclock && *sclock)
+               update_all_status();
 }
 
 /* update_clock: figures out the current time and returns it in a nice format 
*/
_______________________________________________
List mailing list
List@epicsol.org
http://epicsol.org/mailman/listinfo/list

Reply via email to