emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handlin


From: Alan Mackenzie
Subject: Re: [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handling of raw_keybuf in recursive calls
Date: Mon, 20 Nov 2017 19:59:18 +0000
User-agent: Mutt/1.7.2 (2016-11-26)

Hello, Stefan.

On Mon, Nov 20, 2017 at 13:41:54 -0500, Stefan Monnier wrote:
> > +            outer_raw_keybuf_count = raw_keybuf_count;
> > +            outer_raw_keybuf = raw_keybuf;
> > +            inner_raw_keybuf_count_buffer = 0;
> > +            raw_keybuf_count = &inner_raw_keybuf_count_buffer;
> > +            raw_keybuf = &inner_raw_keybuf_buffer;

> Looks good, thanks (tho I think I would have bundled the buf and the
> count into a struct, so it's clear that they're switched together).

> >         /* Calling read_char with COMMANDFLAG = -2 avoids
> >            redisplay in read_char and its subroutines.  */
> >         key = read_char (prevent_redisplay ? -2 : NILP (prompt),
> >                          current_binding, last_nonmenu_event,
> >                               &used_mouse_menu, NULL);
> > +            raw_keybuf_count = outer_raw_keybuf_count;
> > +            raw_keybuf = outer_raw_keybuf;

> But here I worry: what if `read_char` exits non-locally because of
> a signal or a throw?

raw_keybuf{,_count} should then be re-initialised in command_loop_1 to
the static buffer variables, just before the call to read_key_sequence.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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