From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#29246: Possible solution? Date: Mon, 11 Nov 2019 03:17:59 +0100 Message-ID: <8736evrwa0.fsf@marxist.se> References: <87po8qi0bc.fsf@metapensiero.it> <87374u1zd1.fsf@metapensiero.it> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="135082"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 29246@debbugs.gnu.org To: Lele Gaifax Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 11 03:19:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iTzIL-000Yzf-Ux for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Nov 2019 03:19:10 +0100 Original-Received: from localhost ([::1]:48584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTzIK-0006GC-OJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Nov 2019 21:19:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54832) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTzIF-0006G5-Qw for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2019 21:19:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTzIE-0003CF-RN for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2019 21:19:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44117) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iTzIE-0003C7-Nw for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2019 21:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iTzIE-0006tf-Fc for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2019 21:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Nov 2019 02:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29246 X-GNU-PR-Package: emacs Original-Received: via spool by 29246-submit@debbugs.gnu.org id=B29246.157343869026439 (code B ref 29246); Mon, 11 Nov 2019 02:19:02 +0000 Original-Received: (at 29246) by debbugs.gnu.org; 11 Nov 2019 02:18:10 +0000 Original-Received: from localhost ([127.0.0.1]:52938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTzHO-0006sN-Dt for submit@debbugs.gnu.org; Sun, 10 Nov 2019 21:18:10 -0500 Original-Received: from host.gofardesign.uk ([208.79.239.190]:51738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTzHL-0006sA-SR for 29246@debbugs.gnu.org; Sun, 10 Nov 2019 21:18:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zswPV/zp5QpgVtNE3U4h0DEXB5cmYk3zT4zn4D2jAfU=; b=XNkP4ygwa/IJVIoKcxhjtVHMaF 6VIYLx+YvpJBwnunPSwV3S1EFNDiOjZ4XzD7XFAT1M+7xMs0Ja/78jWdHocmy+K/UoWkH+BCRzHiq OvtJ+fIdRvxzPd7Au7i9b0cCwkABCucmGFlHL6llaQkgQMFedqJmNZSUd6+T0lGBNGgo=; Original-Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:43726 helo=localhost) by host.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iTzHF-0002JZ-AT; Sun, 10 Nov 2019 20:18:02 -0600 In-Reply-To: <87374u1zd1.fsf@metapensiero.it> (Lele Gaifax's message of "Fri, 01 Dec 2017 12:06:34 +0100") X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: host.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: host.gofardesign.uk: stefan@marxist.se 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: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:171405 Archived-At: Lele Gaifax writes: > I'm trying the following, that seems to fix the issue: > > (defun python--flymake-parse-output (source proc report-fn) > "Collect diagnostics parsing checker tool's output line by line." > (let ((rx (nth 0 python-flymake-command-output-pattern)) > (lineidx (nth 1 python-flymake-command-output-pattern)) > (colidx (nth 2 python-flymake-command-output-pattern)) > (typeidx (nth 3 python-flymake-command-output-pattern)) > (msgidx (nth 4 python-flymake-command-output-pattern))) > (with-current-buffer (process-buffer proc) > (goto-char (point-min)) > (cl-loop > while (search-forward-regexp rx nil t) > for msg = (match-string msgidx) > for (beg . end) = (flymake-diag-region > source > (string-to-number > (match-string lineidx)) > (and colidx > (match-string colidx) > (string-to-number > (match-string colidx)))) > for type = (or (and typeidx > (match-string typeidx) > (assoc-default > (match-string typeidx) > python-flymake-msg-alist > #'string-match)) > (assoc-default msg > python-flymake-msg-alist > #'string-match) > :error) > if (and beg end) > collect (flymake-make-diagnostic > source beg end type msg) into diags > finally (funcall report-fn diags))))) > > where I added an `if (and beg end)' clause around `collect'. > > Is that reasonable, or would it be better to make `flymake--highlight-line' > more robust againt a diagnostic with invalid `beg'/`end' slots? Could you please provide a recipe for how to reproduce the original issue? Otherwise, it's hard to test your suggested patch. Could you also send a diff (or patch) with your suggested changes instead of the full function? Otherwise, it's hard to see what you have changed. Preferably the diff should be against the current development version of Emacs (in git). Thanks in advance. Best regards, Stefan Kangas