zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] queueing_enabled grows infinitely when in .recursive-edit
Date: Mon, 3 Oct 2016 08:49:47 -0700	[thread overview]
Message-ID: <161003084947.ZM7346@torch.brasslantern.com> (raw)
In-Reply-To: <CAKc7PVBRg_j8o64nQtxT9NqJArqK_rx5hupUrBa0NuxXsxxRvw@mail.gmail.com>
In-Reply-To: <CAKc7PVA_djOpSy41pkgqDxhyThyzCawByujFX4TqQ6rintRJGw@mail.gmail.com>

On Oct 3, 12:00pm, Sebastian Gniazdowski wrote:
} 
} On 3 October 2016 at 01:21, Bart Schaefer <schaefer@brasslantern.com> wrote:
} >
} > The first is that recursiveedit() calls zlecore() which calls
} > getkeycmd() which cascades into raw_getbyte() with do_keytmout = 0
} > which in some circumstances means that raw_getbyte() effectively
} > does a blocking read on its first call and only runs the sched
} > after a key is pressed.
} 
} It could be either way, if this is to be resolved. I mean, stopping
} sched when in .recursive-edit has some, if not total sense. It's like
} if user would be in an application.

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.

On Oct 3,  1:55pm, Sebastian Gniazdowski wrote:
}
} raw_getbyte() can return with ZTM_NONE while there are scheduled
} functions, often after Ctrl-C in .recursive-edit.
}  [...]
} 
} It looks like calc_timeout handles diff < 0 and diff > 0 but not diff
} == 0?

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;


  reply	other threads:[~2016-10-03 15:49 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 [this message]
2016-10-03 16:43         ` Sebastian Gniazdowski
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=161003084947.ZM7346@torch.brasslantern.com \
    --to=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).