From: Andrew Hyatt <ahyatt@gmail.com>
To: sand@blarg.net
Cc: 2491@debbugs.gnu.org, rfrancoise@debian.org
Subject: bug#2491: 23.0.90; Flymake too aggressive when responding to unusual error combination
Date: Wed, 13 Jan 2016 23:48:26 -0500 [thread overview]
Message-ID: <m2ziw87omd.fsf@gmail.com> (raw)
In-Reply-To: <20090227041420.3646.qmail@priss.frightenedpiglet.com> (sand@blarg.net's message of "27 Feb 2009 04:14:20 -0000")
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=''
next prev parent reply other threads:[~2016-01-14 4:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-27 4:14 bug#2491: 23.0.90; Flymake too aggressive when responding to unusual error combination sand
2016-01-14 4:48 ` Andrew Hyatt [this message]
2016-01-15 2:48 ` Derek Upham
2016-01-24 21:23 ` Andrew Hyatt
2016-01-25 4:19 ` Derek Upham
2016-01-25 4:22 ` Andrew Hyatt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2ziw87omd.fsf@gmail.com \
--to=ahyatt@gmail.com \
--cc=2491@debbugs.gnu.org \
--cc=rfrancoise@debian.org \
--cc=sand@blarg.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.