zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] queueing_enabled grows infinitely when in .recursive-edit
Date: Mon, 3 Oct 2016 18:43:30 +0200	[thread overview]
Message-ID: <CAKc7PVDPUgfH4QyX3Nt-M68Pqk+4SC50WC81t1uRh7T1yUdH_w@mail.gmail.com> (raw)
In-Reply-To: <161003084947.ZM7346@torch.brasslantern.com>

On 3 October 2016 at 17:49, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Oct 3, 12:00pm, Sebastian Gniazdowski wrote:
> }
> } On 3 October 2016 at 01:21, Bart Schaefer <schaefer@brasslantern.com> wrote:
> I think that's probably best left up to the person implementing the
> scheduled function.  Also minimally complicated if the code below
> zlecore() doesn't have too many special cases for recursive-edit.

So being in .recursive-edit is detectable from scheduled function? How?

> Indeed, try this:
>
> diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
> index 0b3b1fc..04b9357 100644
> --- a/Src/Zle/zle_main.c
> +++ b/Src/Zle/zle_main.c
> @@ -471,7 +471,7 @@ calc_timeout(struct ztmout *tmoutp, long do_keytmout)
>
>             tfdat = (Timedfn)getdata(tfnode);
>             diff = tfdat->when - time(NULL);
> -           if (diff < 0) {
> +           if (diff <= 0) {
>                 /* Already due; call it and rescan. */
>                 tfdat->func();
>                 continue;

It works, I have following debug messages generated after lucky Ctrl-C
issued when in .recursive-edit:

raw_getbyte() - queueing_enabled (0)
CALLING diff[0] queueing_enabled (0)
N-O-T CALLING diff[1] queueing_enabled (0)
-- INIT tmout.tp(2) ZTM_NONE(0) ZTM_KEY(1) / BEGIN RAW_GETBYTE() zle_main.c

So, calc_timeout() returns tmout.tp == 2, which is ZTM_FUNC, and does
that because the diff[0] inside-calc_timeout call of scheduled
function did apparently reschedule – the "N-O-T CALLING" entry,
generated in else{} of if(diff <=0).

Best regards,
Sebastian Gniazdowski


  reply	other threads:[~2016-10-03 16:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-02 19:00 Sebastian Gniazdowski
2016-10-02 19:02 ` Sebastian Gniazdowski
2016-10-02 23:21 ` Bart Schaefer
2016-10-03 10:00   ` Sebastian Gniazdowski
2016-10-03 10:18   ` Peter Stephenson
2016-10-03 11:55     ` Sebastian Gniazdowski
2016-10-03 15:49       ` Bart Schaefer
2016-10-03 16:43         ` Sebastian Gniazdowski [this message]
2016-10-03 18:11           ` Bart Schaefer
2016-10-05  5:56         ` Sebastian Gniazdowski
2016-10-05  6:03           ` Sebastian Gniazdowski
2016-10-03 15:20     ` Bart Schaefer
2016-10-03 16:07       ` Bart Schaefer
2016-10-03 16:33   ` Bart Schaefer

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=CAKc7PVDPUgfH4QyX3Nt-M68Pqk+4SC50WC81t1uRh7T1yUdH_w@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).