view lib-src/=wakeup.c @ 1548:cbed5e520f81

version 1.28.8 (fortran-indent-to-column): Make turning of lines that begin with `fortran-continuation-string' into properly formated continuation lines work for fortran TAB mode. Cleaned up some doc strings. (fortran-abbrev-help, fortran-prepare-abbrev-list-buffer): Use `insert-abbrev-table-description' and make buffer in abbrevs-mode. Many changes since version 1.28.3. Added auto-fill-mode, support for some Fortran 90 statements. Adjust comments to conform to new gnu conventions. (fortran-mode): Fix `comment-line-start-skip' by changing \\1 to \\2 and include cpp statements in matching. Changes for auto fill. (fortran-auto-fill-mode, fortran-do-auto-fill, fortran-break-line): New functions to implement auto fill. (fortran-indent-line, fortran-reindent-then-newline-and-indent): Added auto fill support. (find-comment-start-skip, is-in-fortran-string-p): New functions. (fortran-electric-line-number): Works better in overwrite mode. (fortran-indent-comment, fortran-indent-line, fortran-indent-to-column): Use find-comment-start-skip instead of searching for `comment-start-skip'. (fortran-mode, calculate-fortran-indent): Added indentation for fortran 90 statements. (fortran-next-statement, fortran-previous-statement): Bug fixes. (fortran-mode, calculate-fortran-indent, fortran-setup-tab-format-style, fortran-setup-fixed-format-style): `fortran-comment-line-column' meaning changed. Now defaults to 0.
author Richard M. Stallman <rms@gnu.org>
date Thu, 05 Nov 1992 20:25:10 +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);
    }
}