From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Flymake refactored Date: Thu, 5 Oct 2017 15:45:38 +0100 Message-ID: References: <87h8vmj3tr.fsf@lolita> <1507138648.1972.0@smtp.gmail.com> <874lre2von.fsf@gmail.com> <87mv566yjx.fsf@udel.edu> <87shex276r.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1141359a20ddb6055acdc745" X-Trace: blaine.gmane.org 1507214843 30608 195.159.176.226 (5 Oct 2017 14:47:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Oct 2017 14:47:23 +0000 (UTC) Cc: John Wiegley , emacs-devel@gnu.org, Mark Oteiza , =?UTF-8?Q?Simen_Heggest=C3=B8yl?= , dgutov@yandex.ru, Steve Purcell , sdl.web@gmail.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 05 16:47:18 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e07Qf-000713-0N for ged-emacs-devel@m.gmane.org; Thu, 05 Oct 2017 16:47:13 +0200 Original-Received: from localhost ([::1]:40245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e07Qm-00026x-6p for ged-emacs-devel@m.gmane.org; Thu, 05 Oct 2017 10:47:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e07PB-0001bj-0G for emacs-devel@gnu.org; Thu, 05 Oct 2017 10:45:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e07P9-00036p-U4 for emacs-devel@gnu.org; Thu, 05 Oct 2017 10:45:41 -0400 Original-Received: from mail-qt0-x22a.google.com ([2607:f8b0:400d:c0d::22a]:56542) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e07P9-00036G-PH for emacs-devel@gnu.org; Thu, 05 Oct 2017 10:45:39 -0400 Original-Received: by mail-qt0-x22a.google.com with SMTP id 34so8682140qtb.13 for ; Thu, 05 Oct 2017 07:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nk/IxyFrhqpweOg7kJQUKu59h8Eo5BYR6gKrRISGa0k=; b=p95qZNEv6Hc3J0GF/T/Z2CYa5ejX0PhzfYOLID8eMSbZMJv9Q5RjywjN8PFm6gdXO+ R74mUsTZYjXyWUYX4VMbu4NWnZrx3DskWexvWT0hdiadED/v6XSNHASzE64WNjFHMtgv dyklt6GipzTXMnyRkCODgM5DlGdci73h33fdkUCZ7bEI1Lpa6/5CIkM8dzYIDKs+Ib3I DeWaA8zzR8WuWIqkpetrrk2ksrrVdwc/4xtvvsIJq0Z4MjArxlczac4WXLF2//Tox6L5 LjbFFqFnz/+bF/ojwNv2bglDtEU5MZxZcplNIhqXBBOTIFaHPEiBkNfZJYzpk6SvmXuq c9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nk/IxyFrhqpweOg7kJQUKu59h8Eo5BYR6gKrRISGa0k=; b=CTkw9OvucOaSYaQ4v5b9EQzfcxxlKpArg8F7Q0udvyua8//w9GwLOqOyqT3DpYFNj8 skWuNZuCX0OPYvfPpl/F9/Cjxb1zT/86HalLqV3y509EzPY7+OaNNd3G0rZpeIU+xGhN hFQbRZCz/fDwVvrxW/EG19pBkQ3EUJkwNjhQ83JyS42+FGMpXmyS1U5YNuQZARhxGBPC ITnKdyzGRus5OipIntktqDGXspfkPfCaBIO728mODp5I4KHQu44PJ1zchaLMxEP1MNtf l2kHDMu6qZmDbUR0NizGXMG+lnbS4S+4rEYATS0upndwazHsa73E7dP2ikpBnhkblw3E eMdg== X-Gm-Message-State: AMCzsaWJnTwtODu20JEXUIR/fTMLbIqH/LBpAa+xTBm7ApYaOwR1Vy1Z 1MmhySHXtq7VOWUSCJvEaJqiG9y7tnf3zvIkGOM= X-Google-Smtp-Source: AOwi7QD70Kkr7nyQ185al8UyNFulJHopg9tNdY1M7kQp5e0XXM07mwnw6lk6gf/1ZgM/u9+vT+yFE7C2+Ox5PBaF860= X-Received: by 10.237.36.146 with SMTP id t18mr28646288qtc.17.1507214739167; Thu, 05 Oct 2017 07:45:39 -0700 (PDT) Original-Received: by 10.12.145.228 with HTTP; Thu, 5 Oct 2017 07:45:38 -0700 (PDT) Original-Received: by 10.12.145.228 with HTTP; Thu, 5 Oct 2017 07:45:38 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219123 Archived-At: --001a1141359a20ddb6055acdc745 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable [sorry if you're getting this twice Stefan, i forgot to cc everyone else] On Thu, Oct 5, 2017 at 2:11 PM, Stefan Monnier wrote: > > >> :sentinel > >> (lambda (p _ev) > > way to do this is to check if 'p' is 'eq' to the buffer-local value of > > clang-flymake--procress. > > While I agree that it should check whether `p` is obsolete (just in case > something went wrong elsewhere), `p` should have been killed when the > other process was launched, I believe the code examples presented here already do that: >> (when (process-live-p gcc--flymake-proc) >> (kill-process gcc--flymake-proc)) > so this sentinel should only be called with an obsolete `p` in response to such a kill. But while a "killed" 'p' is obsolete, the reverse isn't true. When lauching B, the process A might have already have exited cleanly. Hence A it is not live anymore, and can't be killed. But A's sentinel might not have had a chance to run yet. When it does run, A's sentinel must notice that it is obsolete by some means, and checking for eqness seems the easiest (in flymake-proc.el I set an 'obsolete' property in the proc). > BTW, it should also check `ev` in case the event is just that someone > suspended/resumed the background process. That is true. We should come up with a canonic way to launch flymake processes and then either hide that behind an abstraction or document it. Jo=C3=A3o --001a1141359a20ddb6055acdc745 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
[sorry if you're getting this twice Stefan, i forgot to cc everyo= ne else]

On Thu, Oct 5, 2017 at 2:11 PM, Stefan Mo= nnier <monnier@iro.umontreal.ca> wrote:
>
> >> :sentin= el
> >> (lambda (p _e= v)

> > way to do this is to check if 'p' is= 'eq' to the buffer-local value of
> > clang-flymake--proc= ress.
>
> While I agree that it should check whether `p` is obs= olete (just in case
> something went wrong elsewhere), `p` should hav= e been killed when the
> other process was launched,=C2=A0

I believe the code examples presented here already do that:

=
>> (when (pro= cess-live-p gcc--flymake-proc)
>>=C2=A0 =C2=A0 (kill-process gcc--flymake-= proc))

> so = this sentinel should only be called with an obsolete `p` in response to suc= h a kill.

But while a "killed" = 9;p' is obsolete, the reverse isn't true. When lauching B, the=C2= =A0
process A might have already have exited cleanly. Hence A it = is not live=C2=A0
anymore, and can't be killed. But A's s= entinel might not have had a chance=C2=A0
to run yet. When it doe= s run, A's sentinel must notice that it is obsolete by=C2=A0
= some means, and checking for eqness seems the easiest (in flymake-proc.el= =C2=A0
I set an 'obsolete' property in the proc).

> BTW, it should also check `ev` in c= ase the event is just that someone
> suspended/resumed the background= process.

That is true.=C2=A0

=
We should come up with a canonic way to launch flymake processes=
and then either hide that behind an abstraction or document it.<= /div>

Jo=C3=A3o=C2=A0

--001a1141359a20ddb6055acdc745--