Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-02 Thread Tony Mechelynck
On 02/09/13 03:42, Geoff Greer wrote: This patch adds asynchronous functions to vimscript. If you want to perform an action in 700ms, simply: let timeout_id = settimeout(700, 'echo("hello")') To cancel the timeout before it's fired: canceltimeout(timeout_id) setinterval() also returns an id

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-02 Thread Geoff Greer
Tony, Thanks for the feedback. I've attached a new patch with some basic comments and non-ANSI C function definitions. I'd really like to get feedback on the changes to gui_wait_for_chars() and mch_inchar(). That's where the meat of this patch is. Sincerely, Geoff On Monday, September 2, 201

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread mattn
On Tuesday, September 3, 2013 10:31:59 AM UTC+9, Geoff Greer wrote: > Tony, > > Thanks for the feedback. I've attached a new patch with some basic comments > and non-ANSI C function definitions. > > I'd really like to get feedback on the changes to gui_wait_for_chars() and > mch_inchar(). That'

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread Ben Fritz
On Sunday, September 1, 2013 8:42:25 PM UTC-5, Geoff Greer wrote: > This patch adds asynchronous functions to vimscript. If you want to perform > an action in 700ms, simply: > > let timeout_id = settimeout(700, 'echo("hello")') > > To cancel the timeout before it's fired: > > canceltimeout(time

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread kans
On Tuesday, September 3, 2013 9:04:40 AM UTC-7, Ben Fritz wrote: > On Sunday, September 1, 2013 8:42:25 PM UTC-5, Geoff Greer wrote: > > This patch adds asynchronous functions to vimscript. If you want to perform > > an action in 700ms, simply: > > > > let timeout_id = settimeout(700, 'echo("hell

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread Ben Fritz
On Tuesday, September 3, 2013 1:17:59 PM UTC-5, Bjorn Tipling wrote: > I am pretty excited about this patch and hope it makes it in. > > > Ben, why should asynchronous receive any type of restriction not already > placed on code that runs some milliseconds after a key press (an existing > hook)

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread Bjorn Tipling
I am pretty excited about this patch and hope it makes it in. Ben, why should asynchronous receive any type of restriction not already placed on code that runs some milliseconds after a key press (an existing hook). Cancelling asynchronous requests can lead to unpredictable behavior is probabl

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread Ben Fritz
On Tuesday, September 3, 2013 1:53:31 PM UTC-5, kans wrote: > On Tuesday, September 3, 2013 9:04:40 AM UTC-7, Ben Fritz wrote: > > On Sunday, September 1, 2013 8:42:25 PM UTC-5, Geoff Greer wrote: > > > This patch adds asynchronous functions to vimscript. If you want to > > > perform an action in

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread kans
On Tuesday, September 3, 2013 1:07:00 PM UTC-7, Ben Fritz wrote: > On Tuesday, September 3, 2013 1:53:31 PM UTC-5, kans wrote: > > On Tuesday, September 3, 2013 9:04:40 AM UTC-7, Ben Fritz wrote: > > > On Sunday, September 1, 2013 8:42:25 PM UTC-5, Geoff Greer wrote: > > > > This patch adds asynchr

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-03 Thread David Fishburn
... > Maybe control-c should cancel intervals. As you mentioned, this would let > users save stuff and restart vim. At worse, plugins would be dumped into > an inconsistent state that could cause more harm. Also, canceling internal > callbacks is quite opaque to users. I don't see any great op

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-05 Thread Bram Moolenaar
A few thoughts about this patch. This is not asynchronous but these are timed commands. It should be clear that the commands are executed in the "idle" loop, when Vim waits for a character to be typed. There might be two types: One that has high priority, and gets handled even when the user has

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-05 Thread Bjorn Tipling
> As someone already mentioned: If the command takes too much time, Vim > will get stuck. E.g. when it reads from a socket. It might be possible > to have this kind of work done in another thread, e.g. using Python. Hey check this out: au CursorHold * call BlockForever() " Blocks forever

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-05 Thread Yasuhiro MATSUMOTO
We can use python's thread to get async, but vim don't have GIL. So it can't get events safety from the thread. On 9/5/13, Bram Moolenaar wrote: > > A few thoughts about this patch. > > This is not asynchronous but these are timed commands. It should be > clear that the commands are executed in

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-05 Thread Ben Fritz
On Thursday, September 5, 2013 8:44:15 AM UTC-5, Bjorn Tipling wrote: > > As someone already mentioned: If the command takes too much time, Vim > > will get stuck. E.g. when it reads from a socket. It might be possible > > to have this kind of work done in another thread, e.g. using Python. >

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-05 Thread kans
On Thursday, September 5, 2013 9:08:16 AM UTC-7, Ben Fritz wrote: > On Thursday, September 5, 2013 8:44:15 AM UTC-5, Bjorn Tipling wrote: > > > As someone already mentioned: If the command takes too much time, Vim > > > will get stuck. E.g. when it reads from a socket. It might be possible > >

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-10 Thread Nikolay Pavlov
On Sep 11, 2013 1:54 AM, "kans" wrote: > > On Thursday, September 5, 2013 10:53:39 AM UTC-7, kans wrote: > > On Thursday, September 5, 2013 9:08:16 AM UTC-7, Ben Fritz wrote: > > > On Thursday, September 5, 2013 8:44:15 AM UTC-5, Bjorn Tipling wrote: > > > > > As someone already mentioned: If the

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-10 Thread kans
On Thursday, September 5, 2013 10:53:39 AM UTC-7, kans wrote: > On Thursday, September 5, 2013 9:08:16 AM UTC-7, Ben Fritz wrote: > > On Thursday, September 5, 2013 8:44:15 AM UTC-5, Bjorn Tipling wrote: > > > > As someone already mentioned: If the command takes too much time, Vim > > > > will get

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-11 Thread Thomas
On 11 September 2013 00:18, Nikolay Pavlov wrote: > Why do you keep calling it async? > Referring to the introduction to asynchronous programming linked below, the patch is an almost asynchronous feature, or at least a completition of the already existing asynchronous features of vim. With all th

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-11 Thread Bjorn Tipling
The async issue seems like a bike shed. Whatever you want to call it, this feature is very powerful and I'm very grateful many are taking it serious. Let's focus on encouraging the devs and reviewers to getting a patch the community can accept. If the name really is an issue, I'm sure another na

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-11 Thread Nikolay Pavlov
On Sep 11, 2013 1:27 PM, "Thomas" wrote: > > On 11 September 2013 00:18, Nikolay Pavlov wrote: >> >> Why do you keep calling it async? > > Referring to the introduction to asynchronous programming linked below, the patch is an almost asynchronous feature, or at least a completition of the already

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-11 Thread kans
On Wednesday, September 11, 2013 7:46:06 AM UTC-7, ZyX wrote: > On Sep 11, 2013 1:27 PM, "Thomas" wrote: > > > > > > On 11 September 2013 00:18, Nikolay Pavlov wrote: > > >> > > >> Why do you keep calling it async? > > > > > > Referring to the introduction to asynchronous programming linked

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-12 Thread Nikolay Pavlov
On Sep 12, 2013 3:28 AM, "kans" wrote: > > On Wednesday, September 11, 2013 7:46:06 AM UTC-7, ZyX wrote: > > On Sep 11, 2013 1:27 PM, "Thomas" wrote: > > > > > > > > > > On 11 September 2013 00:18, Nikolay Pavlov wrote: > > > > >> > > > > >> Why do you keep calling it async? > > > > > > > > > >

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-13 Thread kans
On Thursday, September 12, 2013 1:59:51 AM UTC-7, ZyX wrote: > On Sep 12, 2013 3:28 AM, "kans" wrote: > > > > > > On Wednesday, September 11, 2013 7:46:06 AM UTC-7, ZyX wrote: > > > > On Sep 11, 2013 1:27 PM, "Thomas" wrote: > > > > > > > > > > > > > > > > > > On 11 September 2013 00:18, N

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-19 Thread kans
On Friday, September 13, 2013 2:43:13 AM UTC-7, kans wrote: > On Thursday, September 12, 2013 1:59:51 AM UTC-7, ZyX wrote: > > > On Sep 12, 2013 3:28 AM, "kans" wrote: > > > > > > > > > > > > > > On Wednesday, September 11, 2013 7:46:06 AM UTC-7, ZyX wrote: > > > > > > > > On Sep 11, 201

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-19 Thread Nikolay Pavlov
On Sep 19, 2013 2:01 PM, "kans" wrote: > > On Friday, September 13, 2013 2:43:13 AM UTC-7, kans wrote: > > On Thursday, September 12, 2013 1:59:51 AM UTC-7, ZyX wrote: > > > > > On Sep 12, 2013 3:28 AM, "kans" wrote: > > > > > > > > > > > > > > > > > > > > > > On Wednesday, September 11, 2013 7:4

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-21 Thread kans
On Thursday, September 19, 2013 3:29:35 AM UTC-7, ZyX wrote: > On Sep 19, 2013 2:01 PM, "kans" wrote: > > > > > > On Friday, September 13, 2013 2:43:13 AM UTC-7, kans wrote: > > > > On Thursday, September 12, 2013 1:59:51 AM UTC-7, ZyX wrote: > > > > > > > > > On Sep 12, 2013 3:28 AM, "kans"

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-21 Thread Ben Fritz
On Saturday, September 21, 2013 6:29:11 PM UTC-5, kans wrote: > > Thanks for the help. Intervals are no longer run if they error of any sort > (apart from a user interrupt which will likely happen accidentally). So, if I install a plugin using this feature, and some weird sequence of events p

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-21 Thread kans
On Saturday, September 21, 2013 8:15:37 PM UTC-7, Ben Fritz wrote: > On Saturday, September 21, 2013 6:29:11 PM UTC-5, kans wrote: > > > > Thanks for the help. Intervals are no longer run if they error of any sort > > (apart from a user interrupt which will likely happen accidentally). > > So,

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-22 Thread Bram Moolenaar
kans wrote: > Zyx, > > Thanks for the help. Intervals are no longer run if they error of any > sort (apart from a user interrupt which will likely happen > accidentally). I was also forced to change configure.in as the > monotonic timer on Linux needs to sometimes link against rt. I ran > aut

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-23 Thread Ben Fritz
On Saturday, September 21, 2013 11:21:28 PM UTC-5, kans wrote: > On Saturday, September 21, 2013 8:15:37 PM UTC-7, Ben Fritz wrote: > > On Saturday, September 21, 2013 6:29:11 PM UTC-5, kans wrote: > > > > > > Thanks for the help. Intervals are no longer run if they error of any > > > sort (apar

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-23 Thread Geoff Greer
On Sunday, September 22, 2013 6:38:32 AM UTC-7, Bram Moolenaar wrote: > kans wrote: > > > > > Zyx, > > > > > > Thanks for the help. Intervals are no longer run if they error of any > > > sort (apart from a user interrupt which will likely happen > > > accidentally). I was also forced to c

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-23 Thread kans
On Sunday, September 22, 2013 6:38:32 AM UTC-7, Bram Moolenaar wrote: > kans wrote: > > > > > Zyx, > > > > > > Thanks for the help. Intervals are no longer run if they error of any > > > sort (apart from a user interrupt which will likely happen > > > accidentally). I was also forced to c

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-24 Thread David Fishburn
On Mon, Sep 23, 2013 at 8:53 PM, kans wrote: > ... > > > Like others I'm worried that some plugin creates a timer with a problem, > > > > and it keeps triggering over and over. The user must have a way to stop > > > > it. > > The new behavior cancels intervals if they error in any way. > Addi

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-24 Thread Matthew Kaniaris
David, Is it currently possible to introspect the file and line number of call site of sitetimeout? I think it would be enough to just error message that info when a timer is canceled. -Matt On Tue, Sep 24, 2013 at 5:51 AM, David Fishburn wrote: > > On Mon, Sep 23, 2013 at 8:53 PM, kans wrot

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-25 Thread Bram Moolenaar
Geoff Greer wrote: > On Sunday, September 22, 2013 6:38:32 AM UTC-7, Bram Moolenaar wrote: > > I still have several problems with including this functionality. > > > > I would prefer this to be called timed events instead of async, since > > it's not really asynchronous. A timeout is for when

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-25 Thread Nikolay Pavlov
On Sep 25, 2013 3:53 PM, "Bram Moolenaar" wrote: > > > Geoff Greer wrote: > > > > On Sunday, September 22, 2013 6:38:32 AM UTC-7, Bram Moolenaar wrote: > > > I still have several problems with including this functionality. > > > > > > I would prefer this to be called timed events instead of async,

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-25 Thread Tux.
Bram Moolenaar schrieb: >Java is the most used language these days and uses the Timer class. "Most people use Java" (which I doubt as better programmers prefer sane languages like C) is not a reason to state that Java would be any better than other languages. They just have a working Marketing

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-25 Thread Tux.
Bram Moolenaar schrieb: >Java is the most used language these days and uses the Timer class. "Most people use Java" (which I doubt as better programmers prefer sane languages like C) is not a reason to state that Java would be any better than other languages. They just have a working Marke

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-25 Thread Bjorn Tipling
Bram, Given that your concern is to not present a situation to the user for which they have no remedy, it seems like providing information might be a possible remedy The more information the user has, the easier it might be to figure out how to get out of a possible sticky situation. You mentio

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-25 Thread kans
> Java is the most used language these days and uses the Timer class. > > JavaScript wasn't designed properly, it has lots of confusing stuff, I > > would never use it as an example for proper design. Only for ideas. Its true that JS was designed in a weekend, but it is easily the most popular

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-25 Thread Nikolay Pavlov
On Sep 26, 2013 3:30 AM, "kans" wrote: > > > Java is the most used language these days and uses the Timer class. > > > > JavaScript wasn't designed properly, it has lots of confusing stuff, I > > > > would never use it as an example for proper design. Only for ideas. > > Its true that JS was desi

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-26 Thread kans
On Wednesday, September 25, 2013 9:09:48 PM UTC-7, ZyX wrote: > On Sep 26, 2013 3:30 AM, "kans" wrote: > > > > > > > Java is the most used language these days and uses the Timer class. > > > > > > > > JavaScript wasn't designed properly, it has lots of confusing stuff, I > > > > > > > > woul

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-09-27 Thread Ben Fritz
On Thursday, September 26, 2013 4:53:55 PM UTC-5, kans wrote: > > As Bram pointed out ctrl-c doesn't work on windows. I'm not going to try to > fix that. > CTRL-C works on Windows as long as a user doesn't source the infamous mswin.vim somewhere in their config. Or if they do, they need to ed

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-02 Thread kans
On Friday, September 27, 2013 8:04:25 AM UTC-7, Ben Fritz wrote: > On Thursday, September 26, 2013 4:53:55 PM UTC-5, kans wrote: > > > > As Bram pointed out ctrl-c doesn't work on windows. I'm not going to try > > to fix that. > > > > CTRL-C works on Windows as long as a user doesn't source th

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-08 Thread kans
On Wednesday, October 2, 2013 3:40:05 PM UTC-7, kans wrote: > On Friday, September 27, 2013 8:04:25 AM UTC-7, Ben Fritz wrote: > > On Thursday, September 26, 2013 4:53:55 PM UTC-5, kans wrote: > > > > > > As Bram pointed out ctrl-c doesn't work on windows. I'm not going to try > > > to fix that.

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-09 Thread mattn
Bram, why you remove this patch from todo list? https://code.google.com/p/vim/source/diff?spec=svn173c9c860e42e2af31d598aa6924b99d7e73bd1b&r=173c9c860e42e2af31d598aa6924b99d7e73bd1b&format=side&path=/runtime/doc/todo.txt I can't assent. On Wednesday, October 9, 2013 7:16:55 AM UTC+9, kans wrote:

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-09 Thread Bjorn T
They've gone ahead and implemented pretty much everything that was asked for. Geoff and kans did a lot of work. That effort is at least worth a response in this thread why the patch isn't going to be accepted, even though all that was asked for was added to the patch. I don't understand the rati

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-09 Thread Bram Moolenaar
Yasuhiro Matsumoto wrote: > Bram, why you remove this patch from todo list? > > https://code.google.com/p/vim/source/diff?spec=svn173c9c860e42e2af31d598aa6924b99d7e73bd1b&r=173c9c860e42e2af31d598aa6924b99d7e73bd1b&format=side&path=/runtime/doc/todo.txt > > I can't assent. There are several cha

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-09 Thread Christian Brabandt
Hi Bram! On Mi, 09 Okt 2013, Bram Moolenaar wrote: > > Yasuhiro Matsumoto wrote: > > > Bram, why you remove this patch from todo list? > > > > https://code.google.com/p/vim/source/diff?spec=svn173c9c860e42e2af31d598aa6924b99d7e73bd1b&r=173c9c860e42e2af31d598aa6924b99d7e73bd1b&format=side&path=

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-10 Thread Bram Moolenaar
Christian Brabandt wrote: > On Mi, 09 Okt 2013, Bram Moolenaar wrote: > > > > Yasuhiro Matsumoto wrote: > > > > > Bram, why you remove this patch from todo list? > > > > > > https://code.google.com/p/vim/source/diff?spec=svn173c9c860e42e2af31d598aa6924b99d7e73bd1b&r=173c9c860e42e2af31d598aa692

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-10 Thread kans
> It's actually similar to the > > request for the :timer command. We renamed the feature to +timers. Are you referring to a different patch or to this one? At any rate, I tracked down the final bug. We were actually stealing cpu time by calling select far too often (20ms) when select is cal

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-10 Thread Ken Takata
Hi Matt, 2013/10/11 Fri 8:03:50 UTC+9 kans wrote: > > It's actually similar to the > > > > request for the :timer command. > > We renamed the feature to +timers. Are you referring to a different patch or > to this one? > > At any rate, I tracked down the final bug. We were actually stealing

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-11 Thread cptstubing
Calling these timers is the right way to go. Synchronicity is more typically referring to starting some task without blocking while waiting for it to complete its work, not waiting some amount of time. Yes, timers give you a kludgy way to do this in a single-threaded process, but they more spe

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-12 Thread Ken Takata
Hi, 2013/10/11 Fri 10:13:34 UTC+9 Ken Takata wrote: > Your patch still have some coding style errors and I fixed them. > Please check the attached patch. > > Additionally, there are still some issues I think: > > 1. Copyright information is missing in the timers.c. > 2. MCH_MONOTONIC_TIME is def

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread glts
On Thu, Oct 3, 2013 at 12:40 AM, kans wrote: > I believe we have addressed all major concerns- the last one being the > ex_timers command which shows all pending timers. If we have missed > something, or you have other concerns, please let us know. As I wrote > before, we'd really like to see

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Dominique Pellé
Hi I've just tried the "timers.patch". It compiles fine with clang but with a few easy to fix warnings ex_docmd.c:11522:11: warning: unused parameter 'eap' [-Wunused-parameter] exarg_T *eap; ^ os_unix.c:5076:24: warning: unused variable 'now' [-Wunused-variable] unsi

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Andre Sihera
On 03/10/13 07:40, kans wrote: I believe we have addressed all major concerns- the last one being the ex_timers command which shows all pending timers. If we have missed something, or you have other concerns, please let us know. As I wrote before, we'd really like to see this feature in Vim

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Nikolay Pavlov
On Oct 13, 2013 2:57 PM, "Andre Sihera" wrote: > > On 03/10/13 07:40, kans wrote: >> >> >> I believe we have addressed all major concerns- the last one being the ex_timers command which shows all pending timers. If we have missed something, or you have other concerns, please let us know. As I wr

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Nikolay Pavlov
On Oct 13, 2013 3:05 PM, "Nikolay Pavlov" wrote: > > > On Oct 13, 2013 2:57 PM, "Andre Sihera" wrote: > > > > On 03/10/13 07:40, kans wrote: > >> > >> > >> I believe we have addressed all major concerns- the last one being the ex_timers command which shows all pending timers. If we have missed s

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread glts
On Sun, Oct 13, 2013 at 11:15 AM, glts <676c7...@gmail.com> wrote: > On Thu, Oct 3, 2013 at 12:40 AM, kans wrote: >> I believe we have addressed all major concerns- the last one being the >> ex_timers command which shows all pending timers. If we have missed >> something, or you have other conc

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Nikolay Pavlov
On Oct 13, 2013 3:33 PM, "glts" <676c7...@gmail.com> wrote: > > On Sun, Oct 13, 2013 at 11:15 AM, glts <676c7...@gmail.com> wrote: > > On Thu, Oct 3, 2013 at 12:40 AM, kans wrote: > >> I believe we have addressed all major concerns- the last one being the ex_timers command which shows all pending

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread glts
On Sun, Oct 13, 2013 at 2:27 PM, Nikolay Pavlov wrote: > > On Oct 13, 2013 3:33 PM, "glts" <676c7...@gmail.com> wrote: >> >> On Sun, Oct 13, 2013 at 11:15 AM, glts <676c7...@gmail.com> wrote: >> > On Thu, Oct 3, 2013 at 12:40 AM, kans wrote: >> >> I believe we have addressed all major concerns- t

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Andre Sihera
On 13/10/13 20:10, Nikolay Pavlov wrote: On Oct 13, 2013 3:05 PM, "Nikolay Pavlov" > wrote: > > > On Oct 13, 2013 2:57 PM, "Andre Sihera" > wrote: > > > > On 03/10/13 07:40, kans wrote: > >> > >> > >> I believe we have addressed all

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread glts
On Sun, Oct 13, 2013 at 1:33 PM, glts <676c7...@gmail.com> wrote: > On Sun, Oct 13, 2013 at 11:15 AM, glts <676c7...@gmail.com> wrote: >> On Thu, Oct 3, 2013 at 12:40 AM, kans wrote: >>> I believe we have addressed all major concerns- the last one being the >>> ex_timers command which shows all p

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Christian Brabandt
On So, 13 Okt 2013, Nikolay Pavlov wrote: > You have no way to unconditionally disable mappings, set paste > statusline, set ls=0 stl= > CursorHold set ei=CursorHold > Thus such command makes exactly no sense. We also have :syntax on, filetype plugin on and so on. So I think it makes per

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Ben Fritz
On Sunday, October 13, 2013 8:52:05 AM UTC-5, Andre Sihera wrote: > > > > I'll take your "Thus such command makes exactly no sense" response > as a "No", shall I? > > > > A plug-in developer may want to create an intrusive plug-in, in > which case there had > >

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread ZyX
> > You have no way to unconditionally disable mappings, > > set paste Does not work for normal mode. Can be overridden from the plugins. > > statusline, > > set ls=0 stl= `statusline' here means that plugin is setting statusline for its purposes. Thus `set stl=` is a no-op. `set ls=0` does n

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread ZyX
> We also have :syntax on, filetype plugin on and so on. So I think it > makes perfectly sense to be able to turn timers off globally using e.g. > :timers off I still think that timers should have a string ID generated on plugin side. Since plugins will 99% of time reuse one ID for one task it

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Nikolay Pavlov
On Oct 14, 2013 1:00 AM, "ZyX" wrote: > > > We also have :syntax on, filetype plugin on and so on. So I think it > > makes perfectly sense to be able to turn timers off globally using e.g. > > :timers off > > I still think that timers should have a string ID generated on plugin side. Since plugins

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread Joseph Pea
On Sunday, September 1, 2013 6:42:25 PM UTC-7, Geoff Greer wrote: > This patch adds asynchronous functions to vimscript. If you want to perform > an action in 700ms, simply: > > let timeout_id = settimeout(700, 'echo("hello")') > > To cancel the timeout before it's fired: > > canceltimeout(time

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-13 Thread kans
On Sunday, October 13, 2013 3:00:42 PM UTC-7, ZyX wrote: > On Oct 14, 2013 1:00 AM, "ZyX" wrote: > > > > > > > We also have :syntax on, filetype plugin on and so on. So I think it > > > > makes perfectly sense to be able to turn timers off globally using e.g. > > > > :timers off > > > > > >

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Nikolay Pavlov
If I am not mistaking, this patch includes "timers" string in has() list two times. In f_canceltimeout in a first if in a first if in a while cycle indentation is wrong: 4 spaces go before tab. Later indentation is wrong for +free(tmp->sourcing_name); line: spaces are used in pla

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Andre Sihera
On 14/10/13 12:02, kans wrote: There has been too much action in this thread to reply to everyone inline. Bram, I happy to see there is still some hope for this patch getting merged. Ken, Thanks for doing the work to clean up the patch. Dominique, Thanks for the warnings. They should be gone

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Andre Sihera
On 14/10/13 12:02, kans wrote: Andre, I agree with Ben and Zyx. If you don't want to deal with timers, don't install plugins that use them. There can be no expectation that any plugin will work if you disable its timers. If a plugin is more trouble than its worth, uninstall the plugin. Mor

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Nikolay Pavlov
On Oct 14, 2013 7:02 AM, "kans" wrote: > > On Sunday, October 13, 2013 3:00:42 PM UTC-7, ZyX wrote: > > On Oct 14, 2013 1:00 AM, "ZyX" wrote: > > > > > > > > > > > We also have :syntax on, filetype plugin on and so on. So I think it > > > > > > makes perfectly sense to be able to turn timers off

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Michael Henry
All, I've been wondering about the use of CTRL-C regarding timers. There has been a lot of discussion on ways to regain control in the face of a runaway timer, which is of course an important consideration. I've been wondering, however, about any negative effects of accidental cancellation. If I

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Ben Fritz
On Monday, October 14, 2013 5:59:48 AM UTC-5, Michael Henry wrote: > All, > > > > I've been wondering about the use of CTRL-C regarding timers. > > There has been a lot of discussion on ways to regain control in > > the face of a runaway timer, which is of course an important > > consideratio

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Ben Fritz
On Monday, October 14, 2013 2:45:26 AM UTC-5, Andre Sihera wrote: > On 14/10/13 12:02, kans wrote: > > > Andre, > > > I agree with Ben and Zyx. If you don't want to deal with timers, don't > > install plugins that use them. There can be no expectation that any plugin > > will work if you disa

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Ben Fritz
On Monday, October 14, 2013 2:38:39 AM UTC-5, Andre Sihera wrote: > > I originally supposed that you could put such a command in a .vimrc > to which > > the standard response has been "but a plug-in can override it". > Well, analysing > > my own behaviour, when things go wron

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Marcin Szamotulski
On 05:06 Mon 14 Oct , Ben Fritz wrote: > On Monday, October 14, 2013 5:59:48 AM UTC-5, Michael Henry wrote: > > All, > > > > > > > > I've been wondering about the use of CTRL-C regarding timers. > > > > There has been a lot of discussion on ways to regain control in > > > > the face of a r

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Ernie Rael
On 10/14/2013 5:06 AM, Ben Fritz wrote: On Monday, October 14, 2013 5:59:48 AM UTC-5, Michael Henry wrote: All, I've been wondering about the use of CTRL-C regarding timers. [snip] I think this is a valid concern. I'm not exactly sure how this works now, I remember discussion about a lis

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Ben Fritz
On Monday, October 14, 2013 9:55:28 AM UTC-5, Ernie Rael wrote: > On 10/14/2013 5:06 AM, Ben Fritz wrote: > > > On Monday, October 14, 2013 5:59:48 AM UTC-5, Michael Henry wrote: > > >> All, > > >> > > >> > > >> > > >> I've been wondering about the use of CTRL-C regarding timers. > > >> > >

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-14 Thread Matthew Kaniaris
Ben, There is an error message when they are canceled. I don't think there is any good way to revive intervals that have been interrupted. -Matt On Mon, Oct 14, 2013 at 12:28 PM, Ben Fritz wrote: > On Monday, October 14, 2013 9:55:28 AM UTC-5, Ernie Rael wrote: > > On 10/14/2013 5:06 AM, Ben

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Anton Bobrov
> I press CTRL-C very infrequently. I'd be willing to give it a try first > without such a feature and see how often I accidentally interrupt timers. Relying on good chance is much worse than timer plugins in stock vim. Unreproducible glitches, fuck yeah! -- -- You received this message from

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Ben Fritz
On Wednesday, October 16, 2013 6:55:11 AM UTC-5, Anton Bobrov wrote: > > I press CTRL-C very infrequently. I'd be willing to give it a try first > > without such a feature and see how often I accidentally interrupt timers. > > Relying on good chance is much worse than timer plugins in stock vim.

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Anton Bobrov
> It wouldn't be unreproducible, nor would it be a glitch. I'd get a prominent > error message if I pressed CTRL-C that I had canceled timers. Not all users have excellent error message detection skills like yours. > In response, I'd say "whoops!", save all my work, and restart Vim. I'd say 'bl

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Matthew Kaniaris
Anton, What do you mean by long running timers? Are you suggesting we look at the running time of the current timer? -Matt On Wed, Oct 16, 2013 at 5:15 PM, Anton Bobrov wrote: > > It wouldn't be unreproducible, nor would it be a glitch. I'd get a > prominent error message if I pressed CTRL-C

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Anton Bobrov
On Wed, Oct 16, 2013 at 05:24:53PM -0700, Matthew Kaniaris wrote: > Anton, > > What do you mean by long running timers? Are you suggesting we look at the > running time of the current timer? > > -Matt Yes, exactly. As far as I understand the implementation dispatcher should know about timer's

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Matthew Kaniaris
You are correct that we trivially know this information. What would you suggest for the heuristic on not rescheduling? A timer that takes up 500ms out of every 1000 is also something we'd want to kill. -Matt On Wed, Oct 16, 2013 at 5:52 PM, Anton Bobrov wrote: > On Wed, Oct 16, 2013 at 05:24

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Anton Bobrov
> You are correct that we trivially know this information. What would you > suggest for the heuristic on not rescheduling? A timer that takes up 500ms > out of every 1000 is also something we'd want to kill. > > -Matt IMHO, any kind of bad plugin detection is useless. It's complicate, need comp

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Matthew Kaniaris
I like the idea for a threshold, but it would be a ton of work since it would have to use threads and locking and vim isn't thread safe. This is way more work than I am willing to put in even if it means this patch doesn't get merged. -Matt On Wed, Oct 16, 2013 at 6:19 PM, Anton Bobrov wrote:

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Anton Bobrov
> I like the idea for a threshold, but it would be a ton of work since it > would have to use threads and locking and vim isn't thread safe. This is > way more work than I am willing to put in even if it means this patch > doesn't get merged. > > -Matt Er, threads, locks? We only need to decide

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Ben Fritz
On Wednesday, October 16, 2013 8:40:23 PM UTC-5, Anton Bobrov wrote: > > I like the idea for a threshold, but it would be a ton of work since it > > > would have to use threads and locking and vim isn't thread safe. This is > > > way more work than I am willing to put in even if it means this pa

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-16 Thread Anton Bobrov
On Wed, Oct 16, 2013 at 06:49:09PM -0700, Ben Fritz wrote: > On Wednesday, October 16, 2013 8:40:23 PM UTC-5, Anton Bobrov wrote: > > > I like the idea for a threshold, but it would be a ton of work since it > > > > > would have to use threads and locking and vim isn't thread safe. This is > > >

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-20 Thread Bram Moolenaar
Michael Henry wrote: > I've been wondering about the use of CTRL-C regarding timers. > There has been a lot of discussion on ways to regain control in > the face of a runaway timer, which is of course an important > consideration. I've been wondering, however, about any negative > effects of acc

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-20 Thread Geoff Greer
On Sunday, October 20, 2013 1:15:52 PM UTC-7, Bram Moolenaar wrote: > Michael Henry wrote: > > > > > I've been wondering about the use of CTRL-C regarding timers. > > > There has been a lot of discussion on ways to regain control in > > > the face of a runaway timer, which is of course an impo

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-20 Thread Andre Sihera
On 21/10/13 06:54, Geoff Greer wrote: If this is the last thing, we'll gladly add it. If it's not the last thing, please give us a complete list of blockers. Then we can determine if we want to continue addressing your issues or just maintain our own fork of Vim. Maintaining your own fork of

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-21 Thread Ken Takata
Hi, 2013/10/14 Mon 16:39:04 UTC+9 ZyX wrote: > If I am not mistaking, this patch includes "timers" string in has() list two > times. Oh, it was my mistake. > In f_canceltimeout in a first if in a first if in a while cycle indentation > is wrong: 4 spaces go before tab. Later indentation is wr

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-21 Thread Ben Fritz
On Sunday, October 20, 2013 10:39:28 PM UTC-5, Andre Sihera wrote: > > > Furthermore, a timer being effectively an "interrupt", there should be > > an extra test > > case that executes underneath the timer when it fires that can be shown > > to produce > > a known result when the timer inte

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

2013-10-21 Thread Nikolay Pavlov
On Oct 21, 2013 3:48 PM, "Ken Takata" wrote: > > Hi, > > 2013/10/14 Mon 16:39:04 UTC+9 ZyX wrote: > > If I am not mistaking, this patch includes "timers" string in has() list two times. > > Oh, it was my mistake. > > > > In f_canceltimeout in a first if in a first if in a while cycle indentation i

  1   2   >