emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUFFER_SWITCH_EVENT


From: Stefan Monnier
Subject: Re: BUFFER_SWITCH_EVENT
Date: Tue, 25 Sep 2018 17:50:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> -          if (fix_current_buffer)
>> -            {
>> -              if (! FRAME_LIVE_P (XFRAME (selected_frame)))
>> -                Fkill_emacs (Qnil);
>> -              if (XBUFFER (XWINDOW (selected_window)->contents)
>> -                  != current_buffer)
>> -                Fset_buffer (XWINDOW (selected_window)->contents);
>> -            }
> This part restores the current buffer from the selected-window's
> buffer.  With it deleted, what if a process filter or a timer switches
> buffers while we are processing a key sequence?

Indeed, what if?

This is read_key_sequence: its return value should depend on where the
keys&buttons are pressed rather than the context in which the function
is called, so it should presumably not be affected by current-buffer as
long as it uses the right set of active keymaps.

I suspect we do need some `Fset_buffer (XWINDOW
(selected_window)->contents)` maybe inside active_maps or right after
`replay_sequence:`  but I haven't managed to trigger problems linked to
that yet.

The `starting_buffer` business also looks a bit fishy.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]