From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Hyatt Newsgroups: gmane.emacs.bugs Subject: bug#2491: 23.0.90; Flymake too aggressive when responding to unusual error combination Date: Wed, 13 Jan 2016 23:48:26 -0500 Message-ID: References: <20090227041420.3646.qmail@priss.frightenedpiglet.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452746968 6310 80.91.229.3 (14 Jan 2016 04:49:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Jan 2016 04:49:28 +0000 (UTC) Cc: 2491@debbugs.gnu.org, rfrancoise@debian.org To: sand@blarg.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 14 05:49:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aJZqW-0002x9-Eq for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jan 2016 05:49:16 +0100 Original-Received: from localhost ([::1]:40242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJZqS-0005Q2-Mg for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jan 2016 23:49:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJZqN-0005Pk-Ke for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2016 23:49:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJZqI-0002qq-JB for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2016 23:49:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJZqI-0002qm-ER for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2016 23:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aJZqI-0001kK-4c for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2016 23:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2016 04:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 2491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 2491-submit@debbugs.gnu.org id=B2491.14527469196682 (code B ref 2491); Thu, 14 Jan 2016 04:49:02 +0000 Original-Received: (at 2491) by debbugs.gnu.org; 14 Jan 2016 04:48:39 +0000 Original-Received: from localhost ([127.0.0.1]:48707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJZpv-0001ji-FS for submit@debbugs.gnu.org; Wed, 13 Jan 2016 23:48:39 -0500 Original-Received: from mail-qg0-f46.google.com ([209.85.192.46]:34292) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJZpt-0001jV-8X for 2491@debbugs.gnu.org; Wed, 13 Jan 2016 23:48:37 -0500 Original-Received: by mail-qg0-f46.google.com with SMTP id 6so393533868qgy.1 for <2491@debbugs.gnu.org>; Wed, 13 Jan 2016 20:48:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=AyM94RaP57HP7ad83NH0LE3WQ62VLKVI/b40HV80tB0=; b=ssVWlWsj+RBSxpu710gc4E2IWXa5KTi44apPgapQ7peV3JXovNGZmtZf5ZO/QhJ/Jw Ngku1M5bftgv0EOxQ6pqUxLjo2pPPfnW+iXwmqwwi+Di16V5ouTvSVCgj1tSDkW+z7KL DnjJqf2mQkXogVxNBw+S4l3XIqOsLYcI1ccQpt3QYGCAPWTVGCW4sGsPOGgQBfDS6p9l F3bH2tCF/LVqiIxTIwKk4Q2PnTDETtH4JT3NQKC00HX9VeVQrk+Dj1I3lShTsdVbPFoK rTd0d16+kdHpIRAAsvvQr/0QC7+S4riad8g35y4v4E3y715zQgmsDDR5XMNdGHE9BDuH cI3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=AyM94RaP57HP7ad83NH0LE3WQ62VLKVI/b40HV80tB0=; b=DBxTwJDeOHACi9LwFF7T8ILlGRPMDRCjebE3pGbCBK4kx6DDZyV8sqZNzjsDCllogT LLM7n5EXLeudPGFg3PuhrnMgLl1WsafVtsciL+4KhyjdKyrnmwNgTx9k19WnBGlpoQ9G wLFjZ677OUBzAh3pkg1anmpaatL6yyAHkCKVa7Sr6TsPAC1aXSNVnifOv7kwYkj5R/et urIl/7bbjGhuO1p2TJd6YM+sw49kwzxQhg1bqUqLDH6PXFEAhS1z4QcCM5E9nyFXD6xI hxDwoIggqo3lhHQkW1EpdgCDX+rlwG+1Jb0VSqnkm58rwkLsjzsFsJZIHZm4OqIOTj6e yUkg== X-Gm-Message-State: ALoCoQkQOi/uFSIKwljowAOOLLjIyAepGKOuiD/J2RQ5kZERG+1dxOPUL1yW68tI3g5ifnyZQbkF3kACq1yfptiKT6oa4tvMHQ== X-Received: by 10.140.174.2 with SMTP id u2mr2726414qhu.62.1452746911548; Wed, 13 Jan 2016 20:48:31 -0800 (PST) Original-Received: from Andrews-MacBook-Pro.local.ahyatt-laptop (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id q30sm1881540qkq.11.2016.01.13.20.48.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jan 2016 20:48:29 -0800 (PST) In-Reply-To: <20090227041420.3646.qmail@priss.frightenedpiglet.com> (sand@blarg.net's message of "27 Feb 2009 04:14:20 -0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111603 Archived-At: Thanks for the bug report, and sorry it's sat so long without any movement. Looking over this, I don't particularly understand the issue (why would the check return a non-zero exit status if it was working properly?) It might help if you provided a simple example. I've looked at the code in Emacs 25, though, and it still has the logic you report. sand@blarg.net writes: > Background > ---------- > > The Flymake library shipped with CVS HEAD (and probably earlier) has > the following code in `flymake-post-syntax-check': > > (defun flymake-post-syntax-check (exit-status command) > ;; [. . . elided . . .] > > (if (and (equal 0 err-count) (equal 0 warn-count)) > (if (equal 0 exit-status) > (flymake-report-status "" "") ; PASSED > (if (not flymake-check-was-interrupted) > (flymake-report-fatal-status "CFGERR" > (format "Configuration error has occured while running %s" command)) > (flymake-report-status nil ""))) ; "STOPPED" > (flymake-report-status (format "%d/%d" err-count warn-count) ""))) > > Depending on... > > ...whether the flymake check generated errors or warnings, > ...whether the flymake check had a non-zero exit status, and > ...whether we interrupted the flymake check, > > we can generate any of four different statuses. One of the statuses, > "CFGERR" is fatal, and turns off flymake for that buffer. The others > are non-fatal. > > Problem > ------- > > Flymake only tracks errors that refer to the specific file being > checked. For example, given the following output for "foo.c", > which includes file "bar.h" > > foo.c:20: warning: Type mismatch > bar.h:30: error: Invalid syntax > > Flymake would "see" one warning and no errors. The "bar.h" error is > dropped. Now consider the degenerate case where "bar.h" is the only > source of errors, *and the check returns a non-zero exit status*: > > bar.h:30: error: Invalid syntax > > The error and warning counts are zero, the exit status is non-zero, > the check was not interrupted, so we end up reporting a fatal CFGERR. > > Think aobut the user experience here, with the two examples shown > above. First, Flymake checks, and reports an warning in the current > file "foo.c". The user fixes the warning. Then Flymake reports a > fatal error (popping up a dialog box under X) and turns itself off! > > Solution > -------- > > That particular code branch is supposed to catch cases where the build > system itself dies with an error, which is important to detect. But > shutting down Flymake is too excessive a response, because of errors > in included files. > > The following replacement code changes the behavior to report zero > errors and zero warnings with the file itself, but it adds a ":CFGERR" > flag to indicate that there was some other problem with the check. > Flymake remains enabled for the buffer. > > (defun flymake-post-syntax-check (exit-status command) > ;; [. . . elided . . .] > > (if (and (equal 0 err-count) (equal 0 warn-count)) > (if (equal 0 exit-status) > (flymake-report-status "" "") ; PASSED > (if (not flymake-check-was-interrupted) > (flymake-report-status "0/0" ":CFGERR") > (flymake-report-status nil ""))) ; "STOPPED" > (flymake-report-status (format "%d/%d" err-count warn-count) ""))) > > > Derek > > > > > In GNU Emacs 23.0.90.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) > of 2009-02-07 on elegiac, modified by Debian > (emacs-snapshot package, version 1:20090207-1) > Windowing system distributor `The X.Org Foundation', version 11.0.10402000 > configured using `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.90/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.90/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''