From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] latex-mode flymake backend Date: Wed, 11 Oct 2017 14:50:24 +0100 Message-ID: <87fuap7pzz.fsf@gmail.com> References: <20171011133914.c2kvlqip6cyiudfp@logos.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1507729863 9054 195.159.176.226 (11 Oct 2017 13:51:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Oct 2017 13:51:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Mark Oteiza Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 11 15:50:59 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 1e2HPK-0000Xt-Id for ged-emacs-devel@m.gmane.org; Wed, 11 Oct 2017 15:50:46 +0200 Original-Received: from localhost ([::1]:41160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2HPR-0001Fu-PI for ged-emacs-devel@m.gmane.org; Wed, 11 Oct 2017 09:50:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2HP9-00019Z-78 for emacs-devel@gnu.org; Wed, 11 Oct 2017 09:50:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2HP4-0000te-Kj for emacs-devel@gnu.org; Wed, 11 Oct 2017 09:50:33 -0400 Original-Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:55131) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2HP4-0000qH-E3 for emacs-devel@gnu.org; Wed, 11 Oct 2017 09:50:30 -0400 Original-Received: by mail-wm0-x229.google.com with SMTP id i124so5011442wmf.3 for ; Wed, 11 Oct 2017 06:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=56aZrPYVI+E8VmX8d8wkCLfCX27dzc8KradCHlt6CFc=; b=LkfN07aHX6koSCElVaFjHOQP8MW+r0sDOFOP2NBADJDOScprl0lMltOTAAVkokeZAV mbrrIKkS8QXm+GFABPAjTFHKgs3+uYZLZoJY2IthvST9JdLc9zIfTZTsmGboEN7N1+hr f6MTHHQF4sbo0Odoksa3hRBU582CyxOEFlo3SsuLwmEyjVWfPk+3PnB3fQy4PNOmIY0Y DQ0tN3joHycmfKFK1D7SenuNKv9OEDVchsrLx5eGGlSpuP6Q+1x4G9LzCanNiuGxUerM vBEeWsaCXpGYjOl3IWF58svz45B2qejPLXnnQOz6vxVDgcxhZNTz7yQIJ7qreDo1MpBT C33g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=56aZrPYVI+E8VmX8d8wkCLfCX27dzc8KradCHlt6CFc=; b=YdlD98xewgFA5pTQWS1TnazRM+m0j5Fk8OsUBsYQQqFLrM8kZaiecdWq53mTj64oq6 fuTSmij19/Iq/3WbD8aXYuR6Z3KyWGz6h4GdwsyawlDyKQDxoks/Z8fp6if1jd1avt1p +dNDiovLPlm1Je4ccczCaBH+uYBRBAfNYdSXuCK9baSfRt80GY8/fOfj+3aB726wxUa5 GIwRmCFSKDSI7l6LXbPsRKhoPdmj2sBSjhzcdhVKVkUol2qdNuF3I+HPlNA+WvT145pm q0ToW2cHxfHy/wnrozUJrY70qIRNI4ZtH4xBiyldGzcEwy8/IUiVa2CngkeERUGxNolE WNBQ== X-Gm-Message-State: AMCzsaVYZ1/z8YaIgBT1vs2ROWtcnGre7UdU/cSgg8EQ4SC/0MGHr0VH kNFBvn7uNOADDevn3jFV36U= X-Google-Smtp-Source: AOwi7QA6oRaOljyCVt9yH450cx2PVvrts9K0/gR8Q9tplrVjZWY5elQdi4mZDKA8EntOJ+bKq3mrxw== X-Received: by 10.223.166.146 with SMTP id t18mr16885263wrc.64.1507729827161; Wed, 11 Oct 2017 06:50:27 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id p4sm7042212wrf.42.2017.10.11.06.50.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2017 06:50:26 -0700 (PDT) In-Reply-To: <20171011133914.c2kvlqip6cyiudfp@logos.localdomain> (Mark Oteiza's message of "Wed, 11 Oct 2017 09:39:14 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::229 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:219377 Archived-At: Mark Oteiza writes: > Here is a patch for a flymake backend using chktex. Hi Mark, just a couple of comments below the sig. Jo=C3=A3o > + (make-process > + :name "tex-chktex" > + :buffer (generate-new-buffer "*tex-chktex*") > + :command (tex-chktex-command) > + :noquery t :connection-type 'pipe > + :sentinel > + (lambda (process _event) Before proceeding to the unwind-protect form, I think you have to check that 'process' has indeed exited by using (when (eq (process-status process) 'exit) (unwind-protect ...)) According to Stefan, the sentinel also runs when the process is merely suspended. > + (unwind-protect > + (when (eq process tex-chktex--process) Are you sure you don't want to additionally check process-exit-status for 0 here? (it's OK if you know you don't, GCC for example exits non-0 with suitable output) > + (with-current-buffer (process-buffer process) > + (goto-char (point-min)) > + (cl-loop > + while (search-forward-regexp > + "^stdin:\\([0-9]+\\):\\([0-9]+\\):\\([0-9= ]+\\):\\(.*\\)$" > + nil t) > + for msg =3D (match-string 4) > + for (beg . end) =3D (flymake-diag-region source > + (string-t= o-number (match-string 1)) > + (string-t= o-number (match-string 2))) Someone else will nitpick you on the 80 cols :-)