emacs-devel
[Top][All Lists]
Advanced

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

Re: BUFFER_SWITCH_EVENT


From: Eli Zaretskii
Subject: Re: BUFFER_SWITCH_EVENT
Date: Tue, 25 Sep 2018 19:28:15 +0300

> From: Stefan Monnier <address@hidden>
> Date: Tue, 25 Sep 2018 12:14:37 -0400
> 
> >> but I don't see why we'd need to look up the keymaps again.
> >
> > To find buffer-local bindings?
> 
> We already look them up presumably in the right place.  I don't
> understand why we'd need to look them up again after running
> a process filter.

Because a filter could have switched buffers, I presume.  See this
fragment of read_key_sequence:

          /* If the current buffer has been changed from under us, the
             keymap may have changed, so replay the sequence.  */
          if (BUFFERP (key))
            {
              timer_resume_idle ();

              mock_input = t;
              /* Reset the current buffer from the selected window
                 in case something changed the former and not the latter.
                 This is to be more consistent with the behavior
                 of the command_loop_1.  */
              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);
                }

              goto replay_sequence;
            }



reply via email to

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