]> code.delx.au - gnu-emacs/commitdiff
Merge from trunk.
authorEli Zaretskii <eliz@gnu.org>
Fri, 12 Oct 2012 09:45:45 +0000 (11:45 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 12 Oct 2012 09:45:45 +0000 (11:45 +0200)
1  2 
lisp/ChangeLog
lisp/mail/rmail.el
src/ChangeLog
src/alloc.c
src/keyboard.c
src/lisp.h
src/makefile.w32-in

diff --combined lisp/ChangeLog
index ef9e06b7d5885fb90b9c7238c91709f0627ea0ce,4424a5fb389bbaadb298400b9cabc67f0cdd0e53..7a73f761fa87af81a8681157b31e0d6a4d42dae5
@@@ -1,3 -1,39 +1,39 @@@
+ 2012-10-12  Glenn Morris  <rgm@gnu.org>
+       * mail/rmailsum.el (rmail-header-summary):
+       Fix 2010-11-26 test for multiline Subject: field.  (Bug#12625)
+ 2012-10-12  Fabián Ezequiel Gallina  <fgallina@cuca>
+       * progmodes/python.el (python-mode-map): Replace
+       subtitute-key-definition with proper command remapping.
+       (python-nav--up-list): Fix behavior for blocks on the same level.
+ 2012-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+       * help-fns.el (describe-function-1): Handle autoloads w/o docstrings.
+       * emacs-lisp/bytecomp.el (byte-compile-eval): Adjust to long-ago
+       changes to the format of load-history.
+       * international/mule-cmds.el (read-char-by-name): Move let-binding of
+       completion-ignore-case in case that var is buffer-local (bug#12615).
+ 2012-10-11  Kenichi Handa  <handa@gnu.org>
+       * international/eucjp-ms.el: Re-generated.
+ 2012-10-10  Kenichi Handa  <handa@gnu.org>
+       * select.el (xselect--encode-string): If a coding is specified for
+       selection, and that is compatible with COMPOUND_TEXT, use it.
+ 2012-10-10  Martin Rudalics  <rudalics@gmx.at>
+       * window.el (switch-to-buffer-preserve-window-point): New option.
+       (switch-to-buffer):
+       Obey `switch-to-buffer-preserve-window-point' (Bug#4041).
  2012-10-09  Stefan Monnier  <monnier@iro.umontreal.ca>
  
        * newcomment.el (comment-start-skip, comment-end-skip, comment-end):
        (rst-indent-comment): Correct :version tag.
        (rst-official-cvs-rev): Correct version string.
  
 +2012-10-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * subr.el (w32notify-handle-event): New function.
 +
  2012-10-07  Glenn Morris  <rgm@gnu.org>
  
        * mail/rmailmm.el (rmail-mime-process-multipart):
diff --combined lisp/mail/rmail.el
index c75a1989e8eb0404c2dba4f08a06cafde71dee34,c75a1989e8eb0404c2dba4f08a06cafde71dee34..a2cb7cb9ee80a1ca54b10151e9f64d2965e5bdc8
@@@ -4707,7 -4707,7 +4707,7 @@@ If prefix argument REVERSE is non-nil, 
  \f
  ;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
  ;;;;;;  rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels
--;;;;;;  rmail-summary) "rmailsum" "rmailsum.el" "bef21a376bd5bd59792a20dd86e6ec34")
++;;;;;;  rmail-summary) "rmailsum" "rmailsum.el" "6cafe6b03e187b5836e3c359322b5cbf")
  ;;; Generated autoloads from rmailsum.el
  
  (autoload 'rmail-summary "rmailsum" "\
diff --combined src/ChangeLog
index 25a4e92a1ca9f77341e308025e533cb1f4446d3a,2a66f5df62c1381f11ab15452921940137d9d9cc..34e730183de50988fbfcf0b928d7e5c47cfda3db
+ 2012-10-12  Glenn Morris  <rgm@gnu.org>
+       * buffer.c (Fset_buffer): Doc fix.  (Bug#12624)
+ 2012-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+       * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
+       * eval.c (Fautoload): Remember previous autoload status in load-history.
+ 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
+       lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
+       * lread.c (load_each_byte, new_backquote_flag, readchar)
+       (read_filtered_event, lisp_file_lexically_bound_p)
+       (safe_to_load_version, Fload, complete_filename_p, openp)
+       (build_load_history, readevalloop, read_escape, read1)
+       (string_to_number, read_vector, read_list):
+       * macros.c (Fstart_kbd_macro):
+       * marker.c (CONSIDER):
+       * menu.c (parse_single_submenu, digest_single_submenu)
+       (find_and_return_menu_selection, Fx_popup_menu):
+       * minibuf.c (read_minibuf_noninteractive, read_minibuf)
+       (Ftry_completion):
+       * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
+       (ns_menu_show):
+       * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
+       (xmenu_show, xdialog_show):
+       Use bool for booleans.
+       * lread.c (safe_to_load_version): Rename from safe_to_load_p,
+       as it's not a predicate.  All uses changed.  Omit unnecessary
+       buffer termination.
+ 2012-10-11  Dmitry Antipov  <dmantipov@yandex.ru>
+       * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
+       (save_excursion_restore): Do not restore mark if it was not saved.
+ 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
+       * marker.c (cached_modiff): EMACS_INT, not int.
+       * w32select.c (waiting_for_input): Declare by including "keyboard.h"
+       instead of having a wrong decl.
+       * nsmenu.m (waiting_for_input): Remove wrong decl.
+ 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
+       keyboard.c, keymap.c: Use bool for booleans.
+       * dispnew.c (sit_for): Distinguish between 3-way display_option
+       and boolean do_display.
+       * keyboard.c (single_kboard, this_command_key_count_reset)
+       (waiting_for_input, echoing, immediate_quit, input_pending)
+       (interrupt_input, interrupts_deferred, pop_kboard)
+       (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
+       (command_loop_1, adjust_point_for_property)
+       (safe_run_hooks_error, input_polling_used, read_char):
+       (help_char_p, readable_events, kbd_buffer_events_waiting)
+       (kbd_buffer_get_event, timer_check_2, make_lispy_event)
+       (lucid_event_type_list_p, get_input_pending):
+       (gobble_input, menu_separator_name_p, menu_bar_item)
+       (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
+       (read_char_minibuf_menu_prompt, access_keymap_keyremap)
+       (keyremap_step, test_undefined, read_key_sequence)
+       (detect_input_pending, detect_input_pending_ignore_squeezables)
+       (detect_input_pending_run_timers, requeued_events_pending_p)
+       (quit_throw_to_read_char, Fset_input_interrupt_mode):
+       * keymap.c (get_keymap, keymap_parent, keymap_memberp)
+       (access_keymap_1, access_keymap, map_keymap, get_keyelt)
+       (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
+       (accessible_keymaps_1, Fkey_description, push_key_description):
+       (shadow_lookup, struct where_is_internal_data)
+       (where_is_internal, Fwhere_is_internal, where_is_internal_1)
+       (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
+       (describe_map, describe_vector):
+       * menu.c (single_menu_item):
+       * nsmenu.m (ns_update_menubar):
+       * process.c (wait_reading_process_output):
+       * search.c (scan_buffer, scan_newline):
+       Use bool for boolean.
+       * keyboard.c (timers_run, swallow_events)
+       (detect_input_pending_run_timers):
+       * process.c (wait_reading_process_output):
+       Use unsigned for counter where wraparound-on-overflow is desired,
+       since unsigned is guaranteed to have that behavior and signed is not.
+       (read_char): Use ptrdiff_t for string length.
+       (get_input_pending): Remove first argument, since it was always
+       the same pointer-to-int (now pointer-to-boolean) &input_pending,
+       and behave as if it had that value.  Return new value of
+       input_pending.  All callers changed.
+       * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
+       immediate_echo.  Use ptrdiff_t for echo_after_prompt, since it's
+       a string length.
+       * keymap.c (push_key_description): Omit last arg, which was always 1.
+       All callers changed.
+       * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
+ 2012-10-10  Juanma Barranquero  <lekktu@gmail.com>
+       * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
+       ($(BLD)/term.$(O)): Update dependencies.
+ 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
+       * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
+       * lisp.h (enum pvec_type): Adjust comments and omit explicit
+       initializer for PVEC_NORMAL_VECTOR.
+ 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
+       Clean out old termopts cruft.
+       * termopts.h (flow_control, meta_key): Remove unused decls.
+       * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
+       Don't include termopts.h.
+ 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
+       * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
+ 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
+       * commands.h (immediate_quit): Remove duplicate decl.
+ 2012-10-09  Jan Djärv  <jan.h.d@swipnet.se>
+       * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
+       caching.
+       (nsfont_open): Remove setting of Vfonts_in_cache.
+       (syms_of_nsfont): Remove initialization of Vfonts_in_cache
  2012-10-09  Eli Zaretskii  <eliz@gnu.org>
  
        * w32fns.c (w32_last_error): Change the return value to DWORD, to
        but it still has blocs in it, don't return it to the system,
        instead of aborting.  (Bug#12402)
  
 +2012-10-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
 +      (WM_EMACS_END): Bump value by 1.
 +
 +      * w32term.c (lispy_file_action, queue_notifications): New functions.
 +      (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
 +      <Qrenamed_to>: New symbols.
 +
 +      * w32notify.c: New file, implement file event notifications for
 +      MS-Windows.
 +
 +      * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
 +      by posting it to the w32_read_socket queue.
 +
 +      * termhooks.h (enum event_kind) [WINDOWSNT]: New event kind
 +      FILE_NOTIFY_EVENT.
 +
 +      * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
 +      (GLOBAL_SOURCES): Add w32notify.c
 +      ($(BLD)/w32notify.$(O)): New set of dependencies.
 +
 +      * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
 +
 +      * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: Handle
 +      FILE_NOTIFY_EVENT.
 +      (syms_of_keyboard) [WINDOWSNT] <Qfile_notify>: New symbol.
 +      (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
 +      w32notify-handle-event by default.
 +
 +      * emacs.c (main) [WINDOWSNT]: Call syms_of_w32notify.
 +
 +      * alloc.c (NSTATICS): Enlarge to 0x660.
 +
  2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
  
        * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
diff --combined src/alloc.c
index dd3a93ae019a0e68e59ef9ff28a0af4cee953251,95be8db16143543d6e380b72274785d48ada13cb..4fd659bd00113cb8f5da02d3e0e3133897bb4592
@@@ -376,7 -376,7 +376,7 @@@ struct gcpro *gcprolist
  /* Addresses of staticpro'd variables.  Initialize it to a nonzero
     value; otherwise some compilers put it into BSS.  */
  
 -#define NSTATICS 0x650
 +#define NSTATICS 0x660
  static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag};
  
  /* Index of next unused slot in staticvec.  */
@@@ -5689,7 -5689,7 +5689,7 @@@ mark_object (Lisp_Object arg
          pvectype = ((ptr->header.size & PVEC_TYPE_MASK)
                      >> PSEUDOVECTOR_SIZE_BITS);
        else
-         pvectype = 0;
+         pvectype = PVEC_NORMAL_VECTOR;
  
        if (pvectype != PVEC_SUBR && pvectype != PVEC_BUFFER)
          CHECK_LIVE (live_vector_p);
@@@ -6311,19 -6311,14 +6311,14 @@@ gc_sweep (void
  
    /* Free all unmarked buffers */
    {
-     register struct buffer *buffer = all_buffers, *prev = 0, *next;
+     register struct buffer *buffer, **bprev = &all_buffers;
  
      total_buffers = 0;
-     while (buffer)
+     for (buffer = all_buffers; buffer; buffer = *bprev)
        if (!VECTOR_MARKED_P (buffer))
        {
-         if (prev)
-           prev->header.next = buffer->header.next;
-         else
-           all_buffers = buffer->header.next.buffer;
-         next = buffer->header.next.buffer;
+         *bprev = buffer->header.next.buffer;
          lisp_free (buffer);
-         buffer = next;
        }
        else
        {
          /* Do not use buffer_(set|get)_intervals here.  */
          buffer->text->intervals = balance_intervals (buffer->text->intervals);
          total_buffers++;
-         prev = buffer, buffer = buffer->header.next.buffer;
+         bprev = &buffer->header.next.buffer;
        }
    }
  
diff --combined src/keyboard.c
index 2a37e510ba49c0fd654641bb9c26ce0a33c4761b,d58178b7561ac4327ae5183decc55eff9723c73b..68656d527e86c8f092eab07d1770dd9cb4856af0
@@@ -86,8 -86,8 +86,8 @@@ KBOARD *initial_kboard
  KBOARD *current_kboard;
  KBOARD *all_kboards;
  
- /* Nonzero in the single-kboard state, 0 in the any-kboard state.  */
- static int single_kboard;
+ /* True in the single-kboard state, false in the any-kboard state.  */
+ static bool single_kboard;
  
  /* Non-nil disable property on a command means
     do not execute it; call disabled-command-function's value instead.  */
@@@ -113,9 -113,9 +113,9 @@@ static Lisp_Object recent_keys
  Lisp_Object this_command_keys;
  ptrdiff_t this_command_key_count;
  
- /* 1 after calling Freset_this_command_lengths.
-    Usually it is 0.  */
- static int this_command_key_count_reset;
+ /* True after calling Freset_this_command_lengths.
+    Usually it is false.  */
+ static bool this_command_key_count_reset;
  
  /* This vector is used as a buffer to record the events that were actually read
     by read_key_sequence.  */
@@@ -140,11 -140,11 +140,11 @@@ static ptrdiff_t before_command_echo_le
  static sys_jmp_buf getcjmp;
  
  /* True while doing kbd input.  */
int waiting_for_input;
bool waiting_for_input;
  
  /* True while displaying for echoing.   Delays C-g throwing.  */
  
- static int echoing;
+ static bool echoing;
  
  /* Non-null means we can start echoing at the next input pause even
     though there is something in the echo area.  */
@@@ -163,8 -163,8 +163,8 @@@ struct kboard *echo_kboard
  
  Lisp_Object echo_message_buffer;
  
- /* Nonzero means C-g should cause immediate error-signal.  */
int immediate_quit;
+ /* True means C-g should cause immediate error-signal.  */
bool immediate_quit;
  
  /* Character that causes a quit.  Normally C-g.
  
@@@ -270,7 -270,7 +270,7 @@@ static Lisp_Object Qhelp_form_show
  static FILE *dribble;
  
  /* Nonzero if input is available.  */
int input_pending;
bool input_pending;
  
  /* Circular buffer for pre-read keyboard input.  */
  
@@@ -315,9 -315,6 +315,9 @@@ static Lisp_Object Qfunction_key
  Lisp_Object Qmouse_click;
  #ifdef HAVE_NTGUI
  Lisp_Object Qlanguage_change;
 +#ifdef WINDOWSNT
 +Lisp_Object Qfile_notify;
 +#endif
  #endif
  static Lisp_Object Qdrag_n_drop;
  static Lisp_Object Qsave_session;
@@@ -375,18 -372,18 +375,18 @@@ static ptrdiff_t echo_length (void)
  static Lisp_Object Qpolling_period;
  
  /* Incremented whenever a timer is run.  */
int timers_run;
unsigned timers_run;
  
  /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt
     happens.  */
  EMACS_TIME *input_available_clear_time;
  
- /* Nonzero means use SIGIO interrupts; zero means use CBREAK mode.
-    Default is 1 if INTERRUPT_INPUT is defined.  */
int interrupt_input;
+ /* True means use SIGIO interrupts; false means use CBREAK mode.
+    Default is true if INTERRUPT_INPUT is defined.  */
bool interrupt_input;
  
  /* Nonzero while interrupts are temporarily deferred during redisplay.  */
int interrupts_deferred;
bool interrupts_deferred;
  
  /* If we support a window system, turn on the code to poll periodically
     to detect C-g.  It isn't actually used when doing interrupt input.  */
@@@ -414,10 -411,10 +414,10 @@@ static EMACS_TIME timer_last_idleness_s
  /* Function for init_keyboard to call with no args (if nonzero).  */
  static void (*keyboard_init_hook) (void);
  
- static void get_input_pending (int *, int);
- static int readable_events (int);
+ static bool get_input_pending (int);
+ static bool readable_events (int);
  static Lisp_Object read_char_x_menu_prompt (ptrdiff_t, Lisp_Object *,
-                                             Lisp_Object, int *);
+                                             Lisp_Object, bool *);
  static Lisp_Object read_char_minibuf_menu_prompt (int, ptrdiff_t,
                                                    Lisp_Object *);
  static Lisp_Object make_lispy_event (struct input_event *);
@@@ -431,7 -428,7 +431,7 @@@ static Lisp_Object modify_event_symbol 
                                          Lisp_Object, const char *const *,
                                          Lisp_Object *, ptrdiff_t);
  static Lisp_Object make_lispy_switch_frame (Lisp_Object);
- static int help_char_p (Lisp_Object);
+ static bool help_char_p (Lisp_Object);
  static void save_getcjmp (sys_jmp_buf);
  static void restore_getcjmp (sys_jmp_buf);
  static Lisp_Object apply_modifiers (int, Lisp_Object);
@@@ -441,7 -438,7 +441,7 @@@ static Lisp_Object restore_kboard_confi
  static void deliver_input_available_signal (int signo);
  #endif
  static void handle_interrupt (bool);
- static _Noreturn void quit_throw_to_read_char (int);
+ static _Noreturn void quit_throw_to_read_char (bool);
  static void process_special_events (void);
  static void timer_start_idle (void);
  static void timer_stop_idle (void);
@@@ -519,7 -516,7 +519,7 @@@ echo_char (Lisp_Object c
  
        if (INTEGERP (c))
        {
-         ptr = push_key_description (XINT (c), ptr, 1);
+         ptr = push_key_description (XINT (c), ptr);
        }
        else if (SYMBOLP (c))
        {
@@@ -928,7 -925,7 +928,7 @@@ pop_kboard (void
  {
    struct terminal *t;
    struct kboard_stack *p = kboard_stack;
-   int found = 0;
+   bool found = 0;
    for (t = terminal_list; t; t = t->next_terminal)
      {
        if (t->kboard == p->kboard)
  void
  temporarily_switch_to_single_kboard (struct frame *f)
  {
-   int was_locked = single_kboard;
+   bool was_locked = single_kboard;
    if (was_locked)
      {
        if (f != NULL && FRAME_KBOARD (f) != current_kboard)
@@@ -1060,12 -1057,7 +1060,7 @@@ cmd_error (Lisp_Object data
    Vprint_length = old_length;
  
    Vquit_flag = Qnil;
    Vinhibit_quit = Qnil;
- #if 0 /* This shouldn't be necessary anymore.  --lorentey  */
-   if (command_loop_level == 0 && minibuf_level == 0)
-     any_kboard_state ();
- #endif
  
    return make_number (0);
  }
@@@ -1152,12 -1144,6 +1147,6 @@@ command_loop (void
      while (1)
        {
        internal_catch (Qtop_level, top_level_1, Qnil);
- #if 0 /* This shouldn't be necessary anymore.  --lorentey  */
-         /* Reset single_kboard in case top-level set it while
-            evaluating an -f option, or we are stuck there for some
-            other reason.  */
-         any_kboard_state ();
- #endif
        internal_catch (Qtop_level, command_loop_2, Qnil);
        executing_kbd_macro = Qnil;
  
@@@ -1268,8 -1254,7 +1257,7 @@@ tracking_off (Lisp_Object old_value
        if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW))
        {
          redisplay_preserve_echo_area (6);
-         get_input_pending (&input_pending,
-                            READABLE_EVENTS_DO_TIMERS_NOW);
+         get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
        }
      }
    return Qnil;
@@@ -1304,7 -1289,7 +1292,7 @@@ usage: (track-mouse BODY...)  */
  #if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
  static
  #endif
int ignore_mouse_drag_p;
bool ignore_mouse_drag_p;
  
  static FRAME_PTR
  some_mouse_moved (void)
     sans error-handling encapsulation.  */
  
  static int read_key_sequence (Lisp_Object *, int, Lisp_Object,
-                               int, int, int);
+                               bool, bool, bool);
  void safe_run_hooks (Lisp_Object);
- static void adjust_point_for_property (ptrdiff_t, int);
+ static void adjust_point_for_property (ptrdiff_t, bool);
  
  /* Cancel hourglass from protect_unwind.
     ARG is not used.  */
@@@ -1362,10 -1347,7 +1350,7 @@@ command_loop_1 (void
    int i;
    EMACS_INT prev_modiff = 0;
    struct buffer *prev_buffer = NULL;
- #if 0 /* This shouldn't be necessary anymore.  --lorentey  */
-   int was_locked = single_kboard;
- #endif
-   int already_adjusted = 0;
+   bool already_adjusted = 0;
  
    kset_prefix_arg (current_kboard, Qnil);
    kset_last_prefix_arg (current_kboard, Qnil);
        if (!NILP (KVAR (current_kboard, defining_kbd_macro))
          && NILP (KVAR (current_kboard, Vprefix_arg)))
        finalize_kbd_macro_chars ();
- #if 0 /* This shouldn't be necessary anymore.  --lorentey  */
-       if (!was_locked)
-         any_kboard_state ();
- #endif
      }
  }
  
     LAST_PT is the last position of point.  */
  
  static void
- adjust_point_for_property (ptrdiff_t last_pt, int modified)
+ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
  {
    ptrdiff_t beg, end;
    Lisp_Object val, overlay, tmp;
       suppress the point adjustment for automatic composition so that a
       user can keep inserting another character at point or keep
       deleting characters around point.  */
-   int check_composition = ! modified, check_display = 1, check_invisible = 1;
+   bool check_composition = ! modified, check_display = 1, check_invisible = 1;
    ptrdiff_t orig_pt = PT;
  
    /* FIXME: cycling is probably not necessary because these properties
        check_display = 0;
        if (check_invisible && PT > BEGV && PT < ZV)
        {
-         int inv, ellipsis = 0;
+         int inv;
+         bool ellipsis = 0;
          beg = end = PT;
  
          /* Find boundaries `beg' and `end' of the invisible area, if any.  */
@@@ -1923,7 -1902,7 +1905,7 @@@ safe_run_hooks_error (Lisp_Object error
    if (SYMBOLP (hook))
      {
        Lisp_Object val;
-       int found = 0;
+       bool found = 0;
        Lisp_Object newval = Qnil;
        for (val = find_symbol_value (hook); CONSP (val); val = XCDR (val))
        if (EQ (fun, XCAR (val)))
@@@ -2053,9 -2032,9 +2035,9 @@@ start_polling (void
  #endif
  }
  
- /* Nonzero if we are using polling to handle input asynchronously.  */
+ /* True if we are using polling to handle input asynchronously.  */
  
- int
+ bool
  input_polling_used (void)
  {
  #ifdef POLL_FOR_INPUT
@@@ -2231,7 -2210,7 +2213,7 @@@ show_help_echo (Lisp_Object help, Lisp_
  \f
  /* Input of single characters from keyboard */
  
- static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
+ static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, bool *used_mouse_menu,
                                         EMACS_TIME *end_time);
  static void record_char (Lisp_Object c);
  
@@@ -2268,9 -2247,9 +2250,9 @@@ do { if (polling_stopped_here) start_po
     not to run input methods, but in other respects to act as if
     not reading a key sequence.
  
-    If USED_MOUSE_MENU is non-null, then we set *USED_MOUSE_MENU to 1
-    if we used a mouse menu to read the input, or zero otherwise.  If
-    USED_MOUSE_MENU is null, we don't dereference it.
+    If USED_MOUSE_MENU is non-null, then set *USED_MOUSE_MENU to true
+    if we used a mouse menu to read the input, or false otherwise.  If
+    USED_MOUSE_MENU is null, don't dereference it.
  
     Value is -2 when we find input on another keyboard.  A second call
     to read_char will read it.
  Lisp_Object
  read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
           Lisp_Object prev_event,
-          int *used_mouse_menu, EMACS_TIME *end_time)
+          bool *used_mouse_menu, EMACS_TIME *end_time)
  {
    Lisp_Object c;
    ptrdiff_t jmpcount;
    Lisp_Object tem, save;
    volatile Lisp_Object previous_echo_area_message;
    volatile Lisp_Object also_record;
-   volatile int reread;
+   volatile bool reread;
    struct gcpro gcpro1, gcpro2;
-   int volatile polling_stopped_here = 0;
+   bool volatile polling_stopped_here = 0;
    struct kboard *orig_kboard = current_kboard;
  
    also_record = Qnil;
  
    if (CONSP (Vunread_command_events))
      {
-       int was_disabled = 0;
+       bool was_disabled = 0;
  
        c = XCAR (Vunread_command_events);
        Vunread_command_events = XCDR (Vunread_command_events);
    /* if redisplay was requested */
    if (commandflag >= 0)
      {
-       int echo_current = EQ (echo_message_buffer, echo_area_buffer[0]);
+       bool echo_current = EQ (echo_message_buffer, echo_area_buffer[0]);
  
        /* If there is pending input, process any events which are not
           user-visible, such as X selection_request events.  */
    if (!NILP (tem))
      {
        struct buffer *prev_buffer = current_buffer;
- #if 0 /* This shouldn't be necessary anymore. --lorentey  */
-       int was_locked = single_kboard;
-       ptrdiff_t count = SPECPDL_INDEX ();
-       record_single_kboard_state ();
- #endif
        last_input_event = c;
        Fcommand_execute (tem, Qnil, Fvector (1, &last_input_event), Qt);
  
           example banishing the mouse under mouse-avoidance-mode.  */
        timer_resume_idle ();
  
- #if 0 /* This shouldn't be necessary anymore. --lorentey  */
-       /* Resume allowing input from any kboard, if that was true before.  */
-       if (!was_locked)
-       any_kboard_state ();
-       unbind_to (count, Qnil);
- #endif
        if (current_buffer != prev_buffer)
        {
          /* The command may have changed the keymaps.  Pretend there
      {
        Lisp_Object keys;
        ptrdiff_t key_count;
-       int key_count_reset;
+       bool key_count_reset;
        struct gcpro gcpro1;
        ptrdiff_t count = SPECPDL_INDEX ();
  
        /* Save the echo status.  */
-       int saved_immediate_echo = current_kboard->immediate_echo;
+       bool saved_immediate_echo = current_kboard->immediate_echo;
        struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause;
        Lisp_Object saved_echo_string = KVAR (current_kboard, echo_string);
-       int saved_echo_after_prompt = current_kboard->echo_after_prompt;
+       ptrdiff_t saved_echo_after_prompt = current_kboard->echo_after_prompt;
  
  #if 0
        if (before_command_restore_flag)
@@@ -3204,9 -3170,9 +3173,9 @@@ record_menu_key (Lisp_Object c
    num_input_events++;
  }
  
- /* Return 1 if should recognize C as "the help character".  */
+ /* Return true if should recognize C as "the help character".  */
  
- static int
+ static bool
  help_char_p (Lisp_Object c)
  {
    Lisp_Object tail;
@@@ -3378,7 -3344,7 +3347,7 @@@ restore_getcjmp (sys_jmp_buf temp
  
  /* Return true if there are any events in the queue that read-char
     would return.  If this returns false, a read-char would block.  */
- static int
+ static bool
  readable_events (int flags)
  {
    if (flags & READABLE_EVENTS_DO_TIMERS_NOW)
@@@ -3717,15 -3683,14 +3686,14 @@@ discard_mouse_events (void
  }
  
  
- /* Return non-zero if there are any real events waiting in the event
+ /* Return true if there are any real events waiting in the event
     buffer, not counting `NO_EVENT's.
  
-    If DISCARD is non-zero, discard NO_EVENT events at the front of
-    the input queue, possibly leaving the input queue empty if there
-    are no real input events.  */
+    Discard NO_EVENT events at the front of the input queue, possibly
+    leaving the input queue empty if there are no real input events.  */
  
- int
- kbd_buffer_events_waiting (int discard)
+ bool
+ kbd_buffer_events_waiting (void)
  {
    struct input_event *sp;
  
        sp = kbd_buffer;
      }
  
-   if (discard)
-     kbd_fetch_ptr = sp;
+   kbd_fetch_ptr = sp;
    return sp != kbd_store_ptr && sp->kind != NO_EVENT;
  }
  
@@@ -3761,7 -3724,7 +3727,7 @@@ clear_event (struct input_event *event
  
  static Lisp_Object
  kbd_buffer_get_event (KBOARD **kbp,
-                       int *used_mouse_menu,
+                       bool *used_mouse_menu,
                        EMACS_TIME *end_time)
  {
    Lisp_Object obj;
                              make_number (event->modifiers)));
          kbd_fetch_ptr = event + 1;
        }
 +      else if (event->kind == FILE_NOTIFY_EVENT)
 +      {
 +        /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK).  */
 +        obj = Fcons (Qfile_notify,
 +                     list2 (list3 (make_number (event->code),
 +                                   XCAR (event->arg),
 +                                   XCDR (event->arg)),
 +                            event->frame_or_window));
 +        kbd_fetch_ptr = event + 1;
 +      }
  #endif
        else if (event->kind == SAVE_SESSION_EVENT)
          {
@@@ -4216,14 -4169,14 +4182,14 @@@ process_special_events (void
     are ripe, and return, without reading any user-visible events.  */
  
  void
- swallow_events (int do_display)
+ swallow_events (bool do_display)
  {
-   int old_timers_run;
+   unsigned old_timers_run;
  
    process_special_events ();
  
    old_timers_run = timers_run;
-   get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
+   get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
  
    if (timers_run != old_timers_run && do_display)
      redisplay_preserve_echo_area (7);
@@@ -4350,7 -4303,7 +4316,7 @@@ timer_check_2 (Lisp_Object timers, Lisp
        EMACS_TIME difference;
        EMACS_TIME timer_difference = invalid_emacs_time ();
        EMACS_TIME idle_timer_difference = invalid_emacs_time ();
-       int ripe, timer_ripe = 0, idle_timer_ripe = 0;
+       bool ripe, timer_ripe = 0, idle_timer_ripe = 0;
  
        /* Set TIMER and TIMER_DIFFERENCE
         based on the next ordinary timer.
@@@ -5454,7 -5407,7 +5420,7 @@@ make_lispy_event (struct input_event *e
  #endif
        {
        int button = event->code;
-       int is_double;
+       bool is_double;
        Lisp_Object position;
        Lisp_Object *start_pos_ptr;
        Lisp_Object start_pos;
          struct frame *fr;
          int fuzz;
          int symbol_num;
-         int is_double;
+         bool is_double;
  
          if (WINDOWP (event->frame_or_window))
            fr = XFRAME (XWINDOW (event->frame_or_window)->frame);
@@@ -6677,11 -6630,11 +6643,11 @@@ parse_solitary_modifier (Lisp_Object sy
    return 0;
  }
  
- /* Return 1 if EVENT is a list whose elements are all integers or symbols.
+ /* Return true if EVENT is a list whose elements are all integers or symbols.
     Such a list is not valid as an event,
     but it can be a Lucid-style event type list.  */
  
- int
+ bool
  lucid_event_type_list_p (Lisp_Object object)
  {
    Lisp_Object tail;
    return NILP (tail);
  }
  \f
- /* Store into *addr a value nonzero if terminal input chars are available.
-    Serves the purpose of ioctl (0, FIONREAD, addr)
+ /* Return true if terminal input chars are available.
+    Also, store the return value into INPUT_PENDING.
+    Serves the purpose of ioctl (0, FIONREAD, ...)
     but works even if FIONREAD does not exist.
     (In fact, this may actually read some input.)
  
     If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse
     movements and toolkit scroll bar thumb drags.  */
  
- static void
- get_input_pending (int *addr, int flags)
+ static bool
+ get_input_pending (int flags)
  {
    /* First of all, have we already counted some input?  */
-   *addr = (!NILP (Vquit_flag) || readable_events (flags));
+   input_pending = (!NILP (Vquit_flag) || readable_events (flags));
  
    /* If input is being read as it arrives, and we have none, there is none.  */
-   if (*addr > 0 || (interrupt_input && ! interrupts_deferred))
-     return;
+   if (!input_pending && (!interrupt_input || interrupts_deferred))
+     {
+       /* Try to read some input and see how much we get.  */
+       gobble_input ();
+       input_pending = (!NILP (Vquit_flag) || readable_events (flags));
+     }
  
-   /* Try to read some input and see how much we get.  */
-   gobble_input ();
-   *addr = (!NILP (Vquit_flag) || readable_events (flags));
+   return input_pending;
  }
  
  /* Put a BUFFER_SWITCH_EVENT in the buffer
@@@ -6780,7 -6737,7 +6750,7 @@@ in
  gobble_input (void)
  {
    int nread = 0;
-   int err = 0;
+   bool err = 0;
    struct terminal *t;
  
    /* Store pending user signal events, if any.  */
@@@ -7350,9 -7307,9 +7320,9 @@@ static const char* separator_names[] = 
    0,
  };
  
- /* Return non-zero if LABEL specifies a separator.  */
+ /* Return true if LABEL specifies a separator.  */
  
- int
+ bool
  menu_separator_name_p (const char *label)
  {
    if (!label)
@@@ -7527,6 -7484,7 +7497,7 @@@ menu_bar_item (Lisp_Object key, Lisp_Ob
  {
    struct gcpro gcpro1;
    int i;
+   bool parsed;
    Lisp_Object tem;
  
    if (EQ (item, Qundefined))
       parse_menu_item, so that if it turns out it wasn't a menu item,
       it still correctly hides any further menu item.  */
    GCPRO1 (key);
-   i = parse_menu_item (item, 1);
+   parsed = parse_menu_item (item, 1);
    UNGCPRO;
-   if (!i)
+   if (!parsed)
      return;
  
    item = AREF (item_properties, ITEM_PROPERTY_DEF);
@@@ -7636,7 -7594,7 +7607,7 @@@ menu_item_eval_property (Lisp_Object se
     parse_menu_item returns true if the item is a menu item and false
     otherwise.  */
  
- int
+ bool
  parse_menu_item (Lisp_Object item, int inmenubar)
  {
    Lisp_Object def, tem, item_string, start;
@@@ -7936,7 -7894,7 +7907,7 @@@ static Lisp_Object QCrtl
  
  static void init_tool_bar_items (Lisp_Object);
  static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*);
- static int parse_tool_bar_item (Lisp_Object, Lisp_Object);
+ static bool parse_tool_bar_item (Lisp_Object, Lisp_Object);
  static void append_tool_bar_item (void);
  
  
@@@ -8069,7 -8027,7 +8040,7 @@@ set_prop (ptrdiff_t idx, Lisp_Object va
  
  
  /* Parse a tool bar item specification ITEM for key KEY and return the
-    result in tool_bar_item_properties.  Value is zero if ITEM is
+    result in tool_bar_item_properties.  Value is false if ITEM is
     invalid.
  
     ITEM is a list `(menu-item CAPTION BINDING PROPS...)'.
  
     A text label to show with the tool bar button if labels are enabled.  */
  
- static int
+ static bool
  parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
  {
    Lisp_Object filter = Qnil;
    Lisp_Object caption;
-   int i, have_label = 0;
+   int i;
+   bool have_label = 0;
  
    /* Definition looks like `(menu-item CAPTION BINDING PROPS...)'.
       Rule out items that aren't lists, don't start with
@@@ -8376,9 -8335,9 +8348,9 @@@ append_tool_bar_item (void
     PREV_EVENT is the previous input event, or nil if we are reading
     the first event of a key sequence.
  
-    If USED_MOUSE_MENU is non-null, then we set *USED_MOUSE_MENU to 1
-    if we used a mouse menu to read the input, or zero otherwise.  If
-    USED_MOUSE_MENU is null, we don't dereference it.
+    If USED_MOUSE_MENU is non-null, set *USED_MOUSE_MENU to true
+    if we used a mouse menu to read the input, or false otherwise.  If
+    USED_MOUSE_MENU is null, don't dereference it.
  
     The prompting is done based on the prompt-string of the map
     and the strings associated with various map elements.
  
  static Lisp_Object
  read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps,
-                        Lisp_Object prev_event, int *used_mouse_menu)
+                        Lisp_Object prev_event, bool *used_mouse_menu)
  {
  #ifdef HAVE_MENUS
    ptrdiff_t mapno;
@@@ -8485,7 -8444,7 +8457,7 @@@ read_char_minibuf_menu_prompt (int comm
    /* FIXME: Use the minibuffer's frame width.  */
    ptrdiff_t width = FRAME_COLS (SELECTED_FRAME ()) - 4;
    ptrdiff_t idx = -1;
-   int nobindings = 1;
+   bool nobindings = 1;
    Lisp_Object rest, vector;
    char *menu;
  
    /* Present the documented bindings, a line at a time.  */
    while (1)
      {
-       int notfirst = 0;
+       bool notfirst = 0;
        ptrdiff_t i = nlength;
        Lisp_Object obj;
        Lisp_Object orig_defn_macro;
              /* Ignore the element if it has no prompt string.  */
              if (INTEGERP (event) && parse_menu_item (elt, -1))
                {
-                 /* 1 if the char to type matches the string.  */
-                 int char_matches;
+                 /* True if the char to type matches the string.  */
+                 bool char_matches;
                  Lisp_Object upcased_event, downcased_event;
                  Lisp_Object desc = Qnil;
                  Lisp_Object s
                          i += 2;
                        }
                      notfirst = 1;
-                     nobindings = 0 ;
+                     nobindings = 0;
  
                      /* If the char to type doesn't match the string's
                         first char, explicitly show what char to type.  */
@@@ -8776,14 -8735,14 +8748,14 @@@ typedef struct keyrema
  
  /* Lookup KEY in MAP.
     MAP is a keymap mapping keys to key vectors or functions.
-    If the mapping is a function and DO_FUNCTION is non-zero, then
+    If the mapping is a function and DO_FUNCALL is true,
     the function is called with PROMPT as parameter and its return
     value is used as the return value of this function (after checking
     that it is indeed a vector).  */
  
  static Lisp_Object
  access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt,
-                       int do_funcall)
+                       bool do_funcall)
  {
    Lisp_Object next;
  
     BUFSIZE is its maximum size.
     FKEY is a pointer to the keyremap structure to use.
     INPUT is the index of the last element in KEYBUF.
-    DOIT if non-zero says that the remapping can actually take place.
+    DOIT if true says that the remapping can actually take place.
     DIFF is used to return the number of keys added/removed by the remapping.
     PARENT is the root of the keymap.
     PROMPT is the prompt to use if the remapping happens through a function.
-    The return value is non-zero if the remapping actually took place.  */
+    Return true if the remapping actually took place.  */
  
- static int
+ static bool
  keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
-              int input, int doit, int *diff, Lisp_Object prompt)
+              int input, bool doit, int *diff, Lisp_Object prompt)
  {
    Lisp_Object next, key;
  
    return 0;
  }
  
- static int
+ static bool
  test_undefined (Lisp_Object binding)
  {
    return (EQ (binding, Qundefined)
     off the switch-frame event until later; the next call to
     read_char will return it.
  
-    If FIX_CURRENT_BUFFER is nonzero, we restore current_buffer
+    If FIX_CURRENT_BUFFER, we restore current_buffer
     from the selected window's buffer.  */
  
  static int
  read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
-                  int dont_downcase_last, int can_return_switch_frame,
-                  int fix_current_buffer)
+                  bool dont_downcase_last, bool can_return_switch_frame,
+                  bool fix_current_buffer)
  {
    Lisp_Object from_string;
    ptrdiff_t count = SPECPDL_INDEX ();
       key sequence.  */
    Lisp_Object orig_keymap;
  
-   /* 1 if we have already considered switching to the local-map property
+   /* Positive if we have already considered switching to the local-map property
       of the place where a mouse click occurred.  */
    int localized_local_map = 0;
  
    /* Likewise, for key_translation_map and input-decode-map.  */
    keyremap keytran, indec;
  
-   /* Non-zero if we are trying to map a key by changing an upper-case
+   /* True if we are trying to map a key by changing an upper-case
       letter to lower case, or a shifted function key to an unshifted
       one.  */
-   int shift_translated = 0;
+   bool shift_translated = 0;
  
    /* If we receive a `switch-frame' or `select-window' event in the middle of
       a key sequence, we put it off for later.
    int original_uppercase_position = -1;
  
    /* Gets around Microsoft compiler limitations.  */
-   int dummyflag = 0;
+   bool dummyflag = 0;
  
    struct buffer *starting_buffer;
  
         : (/* indec.start < t || fkey.start < t || */ keytran.start < t))
      {
        Lisp_Object key;
-       int used_mouse_menu = 0;
+       bool used_mouse_menu = 0;
  
        /* Where the last real key started.  If we need to throw away a
           key that has expanded into more than one element of keybuf
                   return.  Any better way to fix this? -- cyd  */
                || (interrupted_kboard != current_kboard))
              {
-               int found = 0;
+               bool found = 0;
                struct kboard *k;
  
                for (k = all_kboards; k; k = k->next_kboard)
        while (indec.end < t)
        {
          struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-         int done, diff;
+         bool done;
+         int diff;
  
          GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
          done = keyremap_step (keybuf, bufsize, &indec, max (t, mock_input),
        while (fkey.end < indec.start)
          {
            struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-           int done, diff;
+           bool done;
+           int diff;
  
            GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
            done = keyremap_step (keybuf, bufsize, &fkey,
        while (keytran.end < fkey.start)
        {
          struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-         int done, diff;
+         bool done;
+         int diff;
  
          GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
          done = keyremap_step (keybuf, bufsize, &keytran, max (t, mock_input),
@@@ -10283,38 -10245,32 +10258,32 @@@ a special event, so ignore the prefix a
  
  
  \f
- /* Return nonzero if input events are pending.  */
+ /* Return true if input events are pending.  */
  
- int
+ bool
  detect_input_pending (void)
  {
-   if (!input_pending)
-     get_input_pending (&input_pending, 0);
-   return input_pending;
+   return input_pending || get_input_pending (0);
  }
  
- /* Return nonzero if input events other than mouse movements are
+ /* Return true if input events other than mouse movements are
     pending.  */
  
- int
+ bool
  detect_input_pending_ignore_squeezables (void)
  {
-   if (!input_pending)
-     get_input_pending (&input_pending, READABLE_EVENTS_IGNORE_SQUEEZABLES);
-   return input_pending;
+   return input_pending || get_input_pending (READABLE_EVENTS_IGNORE_SQUEEZABLES);
  }
  
- /* Return nonzero if input events are pending, and run any pending timers.  */
+ /* Return true if input events are pending, and run any pending timers.  */
  
- int
- detect_input_pending_run_timers (int do_display)
+ bool
+ detect_input_pending_run_timers (bool do_display)
  {
-   int old_timers_run = timers_run;
+   unsigned old_timers_run = timers_run;
  
    if (!input_pending)
-     get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
+     get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
  
    if (old_timers_run != timers_run && do_display)
      {
@@@ -10345,13 -10301,13 +10314,13 @@@ clear_input_pending (void
    input_pending = 0;
  }
  
- /* Return nonzero if there are pending requeued events.
+ /* Return true if there are pending requeued events.
     This isn't used yet.  The hope is to make wait_reading_process_output
     call it, and return if it runs Lisp code that unreads something.
     The problem is, kbd_buffer_get_event needs to be fixed to know what
     to do in that case.  It isn't trivial.  */
  
- int
+ bool
  requeued_events_pending_p (void)
  {
    return (!NILP (Vunread_command_events));
@@@ -10372,10 -10328,9 +10341,9 @@@ if there is a doubt, the value is t.  *
    /* Process non-user-visible events (Bug#10195).  */
    process_special_events ();
  
-   get_input_pending (&input_pending,
-                    READABLE_EVENTS_DO_TIMERS_NOW
-                    | READABLE_EVENTS_FILTER_EVENTS);
-   return input_pending > 0 ? Qt : Qnil;
+   return (get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW
+                            | READABLE_EVENTS_FILTER_EVENTS)
+         ? Qt : Qnil);
  }
  
  DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
@@@ -10881,7 -10836,7 +10849,7 @@@ handle_interrupt (bool in_signal_handle
  /* Handle a C-g by making read_char return C-g.  */
  
  static void
- quit_throw_to_read_char (int from_signal)
+ quit_throw_to_read_char (bool from_signal)
  {
    /* When not called from a signal handler it is safe to call
       Lisp.  */
@@@ -10911,7 -10866,7 +10879,7 @@@ otherwise Emacs uses CBREAK mode
  See also `current-input-mode'.  */)
    (Lisp_Object interrupt)
  {
-   int new_interrupt_input;
+   bool new_interrupt_input;
  #ifdef USABLE_SIGIO
  #ifdef HAVE_X_WINDOWS
    if (x_display_list != NULL)
@@@ -11409,7 -11364,6 +11377,7 @@@ syms_of_keyboard (void
  
  #ifdef HAVE_NTGUI
    DEFSYM (Qlanguage_change, "language-change");
 +  DEFSYM (Qfile_notify, "file-notify");
  #endif
  
  #ifdef HAVE_DBUS
@@@ -12181,8 -12135,6 +12149,8 @@@ keys_of_keyboard (void
  #if defined (WINDOWSNT)
    initial_define_lispy_key (Vspecial_event_map, "language-change",
                            "ignore");
 +  initial_define_lispy_key (Vspecial_event_map, "file-notify",
 +                          "w32notify-handle-event");
  #endif
  }
  
diff --combined src/lisp.h
index 7812e58782b146d1c794838d7c5834635ed186ea,62e287561cd6aac857c7133d5dd7d8153731fa37..756d08fda3386e11321740003428fcf30198ea21
@@@ -345,15 -345,11 +345,11 @@@ static ptrdiff_t const PSEUDOVECTOR_FLA
        = PSEUDOVECTOR_FLAG;
  
  /* In a pseudovector, the size field actually contains a word with one
-    PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to
-    indicate the actual type.
-    We use a bitset, even tho only one of the bits can be set at any
-    particular time just so as to be able to use micro-optimizations such as
-    testing membership of a particular subset of pseudovectors in Fequal.
-    It is not crucial, but there are plenty of bits here, so why not do it?  */
+    PSEUDOVECTOR_FLAG bit set, and one of the following values extracted
+    with PVEC_TYPE_MASK to indicate the actual type.  */
  enum pvec_type
  {
-   PVEC_NORMAL_VECTOR = 0,     /* Unused!  */
+   PVEC_NORMAL_VECTOR,
    PVEC_FREE,
    PVEC_PROCESS,
    PVEC_FRAME,
@@@ -3031,7 -3027,7 +3027,7 @@@ extern Lisp_Object oblookup (Lisp_Objec
    } while (0)
  extern int openp (Lisp_Object, Lisp_Object, Lisp_Object,
                    Lisp_Object *, Lisp_Object);
Lisp_Object string_to_number (char const *, int, int);
extern Lisp_Object string_to_number (char const *, int, bool);
  extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
                           Lisp_Object);
  extern void dir_warning (const char *, Lisp_Object);
@@@ -3202,9 -3198,9 +3198,9 @@@ extern ptrdiff_t fast_string_match_igno
  extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t,
                                    ptrdiff_t, ptrdiff_t, Lisp_Object);
  extern ptrdiff_t scan_buffer (int, ptrdiff_t, ptrdiff_t, ptrdiff_t,
-                             ptrdiff_t *, int);
+                             ptrdiff_t *, bool);
  extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
-                              EMACS_INT, int);
+                              EMACS_INT, bool);
  extern ptrdiff_t find_next_newline (ptrdiff_t, int);
  extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t);
  extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t);
@@@ -3247,7 -3243,7 +3243,7 @@@ extern Lisp_Object Qdisabled, QCfilter
  extern Lisp_Object Qup, Qdown, Qbottom;
  extern Lisp_Object Qtop;
  extern Lisp_Object last_undo_boundary;
- extern int input_pending;
+ extern bool input_pending;
  extern Lisp_Object menu_bar_items (Lisp_Object);
  extern Lisp_Object tool_bar_items (Lisp_Object, int *);
  extern void discard_mouse_events (void);
  void handle_input_available_signal (int);
  #endif
  extern Lisp_Object pending_funcalls;
- extern int detect_input_pending (void);
- extern int detect_input_pending_ignore_squeezables (void);
- extern int detect_input_pending_run_timers (int);
+ extern bool detect_input_pending (void);
+ extern bool detect_input_pending_ignore_squeezables (void);
+ extern bool detect_input_pending_run_timers (bool);
  extern void safe_run_hooks (Lisp_Object);
  extern void cmd_error_internal (Lisp_Object, const char *);
  extern Lisp_Object command_loop_1 (void);
@@@ -3336,7 -3332,7 +3332,7 @@@ extern bool running_asynch_code
  extern Lisp_Object QCtype, Qlocal;
  extern Lisp_Object Qprocessp;
  extern void kill_buffer_processes (Lisp_Object);
- extern int wait_reading_process_output (intmax_t, int, int, int,
+ extern int wait_reading_process_output (intmax_t, int, int, bool,
                                          Lisp_Object,
                                          struct Lisp_Process *,
                                          int);
@@@ -3497,11 -3493,6 +3493,11 @@@ extern void syms_of_fontset (void)
  extern Lisp_Object Qfont_param;
  #endif
  
 +#ifdef WINDOWSNT
 +/* Defined on w32notify.c.  */
 +extern void syms_of_w32notify (void);
 +#endif
 +
  /* Defined in xfaces.c.  */
  extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
  extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
@@@ -3568,7 -3559,8 +3564,8 @@@ extern char *emacs_root_dir (void)
     Used during startup to detect startup of dumped Emacs.  */
  extern bool initialized;
  
- extern int immediate_quit;        /* Nonzero means ^G can quit instantly.  */
+ /* True means ^G can quit instantly.  */
+ extern bool immediate_quit;
  
  extern void *xmalloc (size_t);
  extern void *xzalloc (size_t);
diff --combined src/makefile.w32-in
index f96f765a7fa55cc3887f879d037d0142fec44ad8,40a075dbf3c093996050322d0d5b27121f4607da..e4a77cc87a3488adf15855a0b4c501f67998ab3a
@@@ -134,7 -134,6 +134,7 @@@ OBJ2 =  $(BLD)/sysdep.$(O)         
        $(BLD)/w32menu.$(O)             \
        $(BLD)/w32reg.$(O)              \
        $(BLD)/w32font.$(O)             \
 +      $(BLD)/w32notify.$(O)           \
        $(BLD)/w32uniscribe.$(O)
  
  LIBS =  $(TLIB0)      \
@@@ -210,7 -209,7 +210,7 @@@ GLOBAL_SOURCES =   dosfns.c msdos.c 
        fontset.c menu.c dbusbind.c \
        w32.c w32console.c w32fns.c w32heap.c w32inevt.c cygw32.c \
        w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c \
 -      font.c w32font.c w32uniscribe.c \
 +      font.c w32font.c w32uniscribe.c w32notify.c \
        dispnew.c frame.c scroll.c xdisp.c window.c bidi.c \
        charset.c coding.c category.c ccl.c character.c chartab.c \
        cm.c term.c terminal.c xfaces.c \
@@@ -736,7 -735,6 +736,6 @@@ $(BLD)/dispnew.$(O) : 
        $(SRC)/disptab.h \
        $(SRC)/indent.h \
        $(SRC)/termchar.h \
-       $(SRC)/termopts.h \
        $(NT_INC)/unistd.h \
        $(BUFFER_H) \
        $(CHARACTER_H) \
@@@ -1016,7 -1014,6 +1015,6 @@@ $(BLD)/indent.$(O) : 
        $(SRC)/indent.h \
        $(SRC)/region-cache.h \
        $(SRC)/termchar.h \
-       $(SRC)/termopts.h \
        $(BUFFER_H) \
        $(CHARACTER_H) \
        $(CONFIG_H) \
@@@ -1413,7 -1410,6 +1411,6 @@@ $(BLD)/term.$(O) : 
        $(SRC)/disptab.h \
        $(SRC)/keymap.h \
        $(SRC)/termchar.h \
-       $(SRC)/termopts.h \
        $(SRC)/tparam.h \
        $(NT_INC)/sys/file.h \
        $(NT_INC)/sys/time.h \
@@@ -1685,17 -1681,6 +1682,17 @@@ $(BLD)/w32uniscribe.$(O) : 
        $(W32FONT_H) \
        $(W32TERM_H)
  
 +$(BLD)/w32notify.$(O) : \
 +      $(SRC)/w32notify.c \
 +      $(SRC)/w32common.h \
 +      $(CODING_H) \
 +      $(CONFIG_H) \
 +      $(FRAME_H) \
 +      $(KEYBOARD_H) \
 +      $(LISP_H) \
 +      $(TERMHOOKS_H) \
 +      $(W32TERM_H)
 +
  # Each object file depends on stamp_BLD, because in parallel builds we must
  # make sure $(BLD) exists before starting compilations.
  #