Mercurial > emacs
comparison src/msdos.c @ 14783:e7b489e4f25d
(check_timer): Remove code for dos-display-time.
(syms_of_msdos): Delete dos-display-time Lisp var.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 07 Mar 1996 20:21:29 +0000 |
parents | 77ed54321a41 |
children | b99490300747 |
comparison
equal
deleted
inserted
replaced
14782:8988aa71854e | 14783:e7b489e4f25d |
---|---|
2551 | 2551 |
2552 #ifndef HAVE_SELECT | 2552 #ifndef HAVE_SELECT |
2553 #include "sysselect.h" | 2553 #include "sysselect.h" |
2554 | 2554 |
2555 static struct time last_time = {120, 120, 120, 120}; | 2555 static struct time last_time = {120, 120, 120, 120}; |
2556 static int modeline_time_displayed = 0; | |
2557 | |
2558 Lisp_Object Vdos_display_time; | |
2559 | 2556 |
2560 static void | 2557 static void |
2561 check_timer (t) | 2558 check_timer (t) |
2562 struct time *t; | 2559 struct time *t; |
2563 { | 2560 { |
2573 if (hour == last_time.ti_hour | 2570 if (hour == last_time.ti_hour |
2574 && min == last_time.ti_min | 2571 && min == last_time.ti_min |
2575 && sec == last_time.ti_sec) | 2572 && sec == last_time.ti_sec) |
2576 return; | 2573 return; |
2577 | 2574 |
2578 if (!NILP (Vdos_display_time)) | |
2579 { | |
2580 int interval; | |
2581 Lisp_Object dti = XSYMBOL (Fintern_soft (build_string ("display-time-interval"), Qnil))->value; | |
2582 int delta_time = ((hour - last_time.ti_hour) * 3600 | |
2583 + (min - last_time.ti_min) * 60 | |
2584 + (sec - last_time.ti_sec)); | |
2585 | |
2586 /* Who knows what the user may put into `display-time-interval'? */ | |
2587 if (!INTEGERP (dti) || (interval = XINT (dti)) <= 0) | |
2588 interval = 60; | |
2589 | |
2590 /* When it's time to renew the display, fake a `wakeup' call. */ | |
2591 if (!modeline_time_displayed /* first time */ | |
2592 || delta_time >= interval /* or if we were busy for a long time */ | |
2593 || interval == 1 /* and every `interval' seconds hence */ | |
2594 || interval == 60 && sec == 0 /* (usual cases first) */ | |
2595 || (hour * 3600 + min * 60 + sec) % interval == 0) | |
2596 call2 (intern ("display-time-filter"), Qnil, | |
2597 build_string ("Wake up!\n")); | |
2598 | |
2599 modeline_time_displayed = 1; | |
2600 } | |
2601 else if (modeline_time_displayed) | |
2602 { | |
2603 modeline_time_displayed = 0; | |
2604 Fset (intern ("display-time-string"), build_string ("")); | |
2605 | |
2606 /* Force immediate redisplay of modelines. */ | |
2607 update_mode_lines++; | |
2608 redisplay_preserve_echo_area (); | |
2609 } | |
2610 | |
2611 last_time = *t; | 2575 last_time = *t; |
2612 } | 2576 } |
2613 | 2577 |
2614 #ifndef EMACS_TIME_ZERO_OR_NEG_P | 2578 #ifndef EMACS_TIME_ZERO_OR_NEG_P |
2615 #define EMACS_TIME_ZERO_OR_NEG_P(time) \ | 2579 #define EMACS_TIME_ZERO_OR_NEG_P(time) \ |
2774 { | 2738 { |
2775 recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil); | 2739 recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil); |
2776 staticpro (&recent_doskeys); | 2740 staticpro (&recent_doskeys); |
2777 | 2741 |
2778 defsubr (&Srecent_doskeys); | 2742 defsubr (&Srecent_doskeys); |
2779 | |
2780 DEFVAR_LISP ("dos-display-time", &Vdos_display_time, | |
2781 "*When non-nil, `display-time' is in effect on DOS systems."); | |
2782 Vdos_display_time = Qnil; | |
2783 } | 2743 } |
2784 | 2744 |
2785 #endif /* MSDOS */ | 2745 #endif /* MSDOS */ |