force_auto_save_soon (void)
{
last_auto_save = - auto_save_interval - 1;
- /* FIXME: What's the relationship between forcing auto-save and adding
- a buffer-switch event? */
- record_asynch_buffer_change ();
}
#endif
\f
&& event->ie.part == scroll_bar_handle
&& event->ie.modifiers == 0)
#endif
- && !((flags & READABLE_EVENTS_FILTER_EVENTS)
- && event->kind == BUFFER_SWITCH_EVENT))
+ )
return 1;
event = next_kbd_event (event);
}
return;
}
}
- /* Don't insert two BUFFER_SWITCH_EVENT's in a row.
- Just ignore the second one. */
- else if (event->kind == BUFFER_SWITCH_EVENT
- && kbd_fetch_ptr != kbd_store_ptr
- && prev_kbd_event (kbd_store_ptr)->kind == BUFFER_SWITCH_EVENT)
- return;
/* Don't let the very last slot in the buffer become full,
since that would make the two pointers equal,
case ICONIFY_EVENT: ignore_event = Qiconify_frame; break;
case DEICONIFY_EVENT: ignore_event = Qmake_frame_visible; break;
case SELECTION_REQUEST_EVENT: ignore_event = Qselection_request; break;
- case BUFFER_SWITCH_EVENT: ignore_event = Qbuffer_switch; break;
default: ignore_event = Qnil; break;
}
#ifdef HAVE_XWIDGETS
case XWIDGET_EVENT:
#endif
- case BUFFER_SWITCH_EVENT:
case SAVE_SESSION_EVENT:
case NO_EVENT:
case HELP_EVENT:
return list2 (Qmove_frame, list1 (event->frame_or_window));
#endif
- case BUFFER_SWITCH_EVENT:
- {
- /* The value doesn't matter here; only the type is tested. */
- Lisp_Object obj;
- XSETBUFFER (obj, current_buffer);
- return obj;
- }
-
/* Just discard these, by returning nil.
With MULTI_KBOARD, these events are used as placeholders
when we need to randomly delete events from the queue.
return input_pending;
}
-/* Put a BUFFER_SWITCH_EVENT in the buffer
- so that read_key_sequence will notice the new current buffer. */
-
-void
-record_asynch_buffer_change (void)
-{
- /* We don't need a buffer-switch event unless Emacs is waiting for input.
- The purpose of the event is to make read_key_sequence look up the
- keymaps again. If we aren't in read_key_sequence, we don't need one,
- and the event could cause trouble by messing up (input-pending-p).
- Note: Fwaiting_for_user_input_p always returns nil when async
- subprocesses aren't supported. */
- if (!NILP (Fwaiting_for_user_input_p ()))
- {
- struct input_event event;
-
- EVENT_INIT (event);
- event.kind = BUFFER_SWITCH_EVENT;
- event.frame_or_window = Qnil;
- event.arg = Qnil;
-
- /* Make sure no interrupt happens while storing the event. */
-#ifdef USABLE_SIGIO
- if (interrupt_input)
- kbd_buffer_store_event (&event);
- else
-#endif
- {
- stop_polling ();
- kbd_buffer_store_event (&event);
- start_polling ();
- }
- }
-}
-
/* Read any terminal input already buffered up by the system
into the kbd_buffer, but do not wait.
/* Menu and tool bar item parts. */
DEFSYM (Qmenu_enable, "menu-enable");
- DEFSYM (Qbuffer_switch, "buffer-switch");
-
#ifdef HAVE_NTGUI
DEFSYM (Qlanguage_change, "language-change");
DEFSYM (Qend_session, "end-session");
extern void push_frame_kboard (struct frame *);
extern void pop_kboard (void);
extern void temporarily_switch_to_single_kboard (struct frame *);
-extern void record_asynch_buffer_change (void);
extern void input_poll_signal (int);
extern void start_polling (void);
extern void stop_polling (void);
timer_delay = timer_check ();
- /* If a timer has run, this might have changed buffers
- an alike. Make read_key_sequence aware of that. */
- if (timers_run != old_timers_run
- && (old_buffer != current_buffer
- || !EQ (old_window, selected_window))
- && waiting_for_user_input_p == -1)
- record_asynch_buffer_change ();
-
if (timers_run != old_timers_run && do_display)
/* We must retry, since a timer may have requeued itself
and that could alter the time_delay. */
leave = true;
}
- /* If a timer has run, this might have changed buffers
- an alike. Make read_key_sequence aware of that. */
- if (timers_run != old_timers_run
- && waiting_for_user_input_p == -1
- && (old_buffer != current_buffer
- || !EQ (old_window, selected_window)))
- record_asynch_buffer_change ();
-
if (leave)
break;
}
/* Restore waiting_for_user_input_p as it was
when we were called, in case the filter clobbered it. */
waiting_for_user_input_p = waiting;
-
-#if 0 /* Call record_asynch_buffer_change unconditionally,
- because we might have changed minor modes or other things
- that affect key bindings. */
- if (! EQ (Fcurrent_buffer (), obuffer)
- || ! EQ (current_buffer->keymap, okeymap))
-#endif
- /* But do it only if the caller is actually going to read events.
- Otherwise there's no need to make him wake up, and it could
- cause trouble (for example it would make sit_for return). */
- if (waiting_for_user_input_p == -1)
- record_asynch_buffer_change ();
}
DEFUN ("internal-default-process-filter", Finternal_default_process_filter,
when we were called, in case the filter clobbered it. */
waiting_for_user_input_p = waiting;
-#if 0
- if (! EQ (Fcurrent_buffer (), obuffer)
- || ! EQ (current_buffer->keymap, okeymap))
-#endif
- /* But do it only if the caller is actually going to read events.
- Otherwise there's no need to make him wake up, and it could
- cause trouble (for example it would make sit_for return). */
- if (waiting_for_user_input_p == -1)
- record_asynch_buffer_change ();
-
unbind_to (count, Qnil);
}
SELECTION_REQUEST_EVENT, /* Another X client wants a selection from us.
See `struct selection_input_event'. */
SELECTION_CLEAR_EVENT, /* Another X client cleared our selection. */
- BUFFER_SWITCH_EVENT, /* A process filter has switched buffers. */
DELETE_WINDOW_EVENT, /* An X client said "delete this window". */
#ifdef HAVE_NTGUI
END_SESSION_EVENT, /* The user is logging out or shutting down. */
for user-input when that process-filter was called.
waiting_for_input cannot be used as that is by definition 0 when
lisp code is being evalled.
- This is also used in record_asynch_buffer_change.
For that purpose, this must be 0
when not inside wait_reading_process_output. */
int m_waiting_for_user_input_p;
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
- else if (!NILP (Vframe_list) && !NILP (XCDR (Vframe_list)))
- /* Force a redisplay sooner or later to update the
- frame titles in case this is the second frame. */
- record_asynch_buffer_change ();
}
else
{
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
- else if (! NILP (Vframe_list)
- && ! NILP (XCDR (Vframe_list)))
- /* Force a redisplay sooner or later
- to update the frame titles
- in case this is the second frame. */
- record_asynch_buffer_change ();
/* Windows can send us a SIZE_MAXIMIZED message even
when fullscreen is fullboth. The following is a
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
- else if (! NILP (Vframe_list)
- && ! NILP (XCDR (Vframe_list)))
- /* Force a redisplay sooner or later
- to update the frame titles
- in case this is the second frame. */
- record_asynch_buffer_change ();
}
if (EQ (get_frame_param (f, Qfullscreen), Qmaximized))
SET_FRAME_GARBAGED (f);
DebPrint (("obscured frame %p (%s) found to be visible\n",
f, SDATA (f->name)));
-
- /* Force a redisplay sooner or later. */
- record_asynch_buffer_change ();
}
}
}
inev.ie.kind = DEICONIFY_EVENT;
XSETFRAME (inev.ie.frame_or_window, f);
}
- else if (! NILP (Vframe_list) && ! NILP (XCDR (Vframe_list)))
- /* Force a redisplay sooner or later to update the
- frame titles in case this is the second frame. */
- record_asynch_buffer_change ();
}
goto OTHER;