all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <20171120195918.GB3917@ACM> (raw)
In-Reply-To: <jwv8tf0sso1.fsf-monnier+emacsdiffs@gnu.org>

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	other threads:[~2017-11-20 19:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171120181209.23553.97060@vcs0.savannah.gnu.org>
     [not found] ` <20171120181210.7946F20416@vcs0.savannah.gnu.org>
2017-11-20 18:41   ` [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handling of raw_keybuf in recursive calls Stefan Monnier
2017-11-20 19:59     ` Alan Mackenzie [this message]
2017-11-20 20:09       ` Stefan Monnier
2017-11-20 20:30         ` Alan Mackenzie
2017-11-20 21:43           ` Stefan Monnier
2017-11-22 19:25             ` Alan Mackenzie
2017-11-22 20:29               ` Stefan Monnier
2017-11-22 21:04                 ` Alan Mackenzie
2017-11-23 14:35                   ` Stefan Monnier
2017-11-23 18:10                     ` Alan Mackenzie
2017-11-23 18:46                       ` Stefan Monnier
2017-11-28 18:03                         ` Alan Mackenzie
2017-11-28 20:30                           ` Eli Zaretskii
2017-12-01 16:48                             ` Alan Mackenzie
2017-12-01 18:17                               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171120195918.GB3917@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.