From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: sand@blarg.net Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2491: 23.0.90; Flymake too aggressive when responding to unusual error combination Date: 27 Feb 2009 04:14:20 -0000 Message-ID: <20090227041420.3646.qmail@priss.frightenedpiglet.com> Reply-To: sand@blarg.net, 2491@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1235711099 16886 80.91.229.12 (27 Feb 2009 05:04:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Feb 2009 05:04:59 +0000 (UTC) Cc: rfrancoise@debian.org To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 27 06:06:14 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LcuuL-0000mA-FA for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Feb 2009 06:05:25 +0100 Original-Received: from localhost ([127.0.0.1]:39167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lcusy-00049B-GH for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Feb 2009 00:03:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lcusv-000496-6I for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2009 00:03:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lcusu-00048t-Lm for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2009 00:03:40 -0500 Original-Received: from [199.232.76.173] (port=42655 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lcusu-00048q-Ig for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2009 00:03:40 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39735) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lcust-0003wq-Rp for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2009 00:03:40 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1R53b1w018078; Thu, 26 Feb 2009 21:03:38 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n1R4j3gb013056; Thu, 26 Feb 2009 20:45:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: sand@blarg.net Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 27 Feb 2009 04:45:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2491 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123570963112896 (code B ref -1); Fri, 27 Feb 2009 04:45:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 27 Feb 2009 04:40:31 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1R4eRF5012884 for ; Thu, 26 Feb 2009 20:40:29 -0800 Original-Received: from mail.gnu.org ([199.232.76.166]:56494 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LcuUC-00085c-NU for emacs-pretest-bug@gnu.org; Thu, 26 Feb 2009 23:38:08 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LcuWN-0001bZ-3E for emacs-pretest-bug@gnu.org; Thu, 26 Feb 2009 23:40:26 -0500 Original-Received: from v-static-143-234.avvanta.com ([206.124.143.234]:34674 helo=priss.frightenedpiglet.com) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LcuWM-0001bP-DS for emacs-pretest-bug@gnu.org; Thu, 26 Feb 2009 23:40:22 -0500 Original-Received: (qmail 3647 invoked by uid 1000); 27 Feb 2009 04:14:20 -0000 X-URL: http://home.blarg.net/~sand X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Greylist: delayed 1601 seconds by postgrey-1.27 at monty-python; Thu, 26 Feb 2009 23:40:21 EST X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 27 Feb 2009 00:03:40 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25759 gmane.emacs.pretest.bugs:24001 Archived-At: 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=''