view lib-src/=wakeup.c @ 1656:a532c5a23984

* xdisp.c (redisplay): Call FRAME_SAMPLE_VISIBILITY to set the visible and iconified flags appropriately for each frame. (message1): Call FRAME_SAMPLE_VISIBILITY to set the visible and iconified flags for the minibuffer frame. * xdisp.c (redisplay): Use FOR_EACH_FRAME to apply redisplay_windows to the root window of each frame. This makes a #ifdef MULTI_FRAME unneeded, but it also means we recompute buffer_shared from scratch even on non-MULTI_FRAME configurations. Don't skip elements of Vframe_list that aren't frames; go ahead and crash here. * xdisp.c (redisplay): Remove #ifdef MULTI_FRAME around the code which updates separate minibuffer frames specially; there's nothing there that won't work on a single-frame configuration.
author Jim Blandy <jimb@redhat.com>
date Sun, 06 Dec 1992 22:20:47 +0000
parents f756ede77561
children 44df7395bed8
line wrap: on
line source

/* Program to produce output at regular intervals.  */

#include <stdio.h>
#include <time.h>

struct tm *localtime ();

main (argc, argv)
     int argc;
     char **argv;
{
  int period = 60;
  long when;
  struct tm *tp;

  if (argc > 1)
    period = atoi (argv[1]);

  while (1)
    {
      /* Make sure wakeup stops when Emacs goes away.  */
      if (getppid () == 1)
	exit (0);
      printf ("Wake up!\n");
      fflush (stdout);
      /* If using a period of 60, produce the output when the minute
	 changes. */
      if (period == 60)
	{
	  time (&when);
	  tp = localtime (&when);
	  sleep (60 - tp->tm_sec);
	}
      else
	sleep (period);
    }
}