From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lele Gaifax Newsgroups: gmane.emacs.bugs Subject: bug#29246: Possible solution? Date: Fri, 01 Dec 2017 12:06:34 +0100 Message-ID: <87374u1zd1.fsf@metapensiero.it> References: <87po8qi0bc.fsf@metapensiero.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1512126438 10667 195.159.176.226 (1 Dec 2017 11:07:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Dec 2017 11:07:18 +0000 (UTC) To: 29246@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 01 12:07:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1eKj9w-00026Y-09 for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Dec 2017 12:07:08 +0100 Original-Received: from localhost ([::1]:57473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKjA1-0000ha-KO for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Dec 2017 06:07:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKj9v-0000bP-Ho for bug-gnu-emacs@gnu.org; Fri, 01 Dec 2017 06:07:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKj9q-0001lS-Vk for bug-gnu-emacs@gnu.org; Fri, 01 Dec 2017 06:07:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58684) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eKj9q-0001lM-S0 for bug-gnu-emacs@gnu.org; Fri, 01 Dec 2017 06:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eKj9q-0001UV-HB for bug-gnu-emacs@gnu.org; Fri, 01 Dec 2017 06:07:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87po8qi0bc.fsf@metapensiero.it> Resent-From: Lele Gaifax Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Dec 2017 11:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29246-submit@debbugs.gnu.org id=B29246.15121264055707 (code B ref 29246); Fri, 01 Dec 2017 11:07:02 +0000 Original-Received: (at 29246) by debbugs.gnu.org; 1 Dec 2017 11:06:45 +0000 Original-Received: from localhost ([127.0.0.1]:39132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKj9Z-0001Tz-3S for submit@debbugs.gnu.org; Fri, 01 Dec 2017 06:06:45 -0500 Original-Received: from mail.arstecnica.it ([144.76.81.238]:58725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKj9X-0001Tl-17 for 29246@debbugs.gnu.org; Fri, 01 Dec 2017 06:06:43 -0500 Original-Received: from nautilus (assp.arstecnica.it [192.168.1.102]) by mail.arstecnica.it (Postfix) with ESMTPSA id 97DB483EEC0 for <29246@debbugs.gnu.org>; Fri, 1 Dec 2017 11:06:35 +0000 (UTC) Original-Received: from nautilus ([31.44.165.109] helo=nautilus) by assp.arstecnica.it with SMTPS(AES256-GCM-SHA384) (2.3.3); 1 Dec 2017 11:06:34 +0000 X-Assp-Version: 2.3.3(14029) on assp.arstecnica.it X-Assp-ID: assp.arstecnica.it m1-26395-06893 X-Assp-Session: B11516E4 (mail 1) X-Assp-Envelope-From: lele@metapensiero.it X-Assp-Intended-For: 29246@debbugs.gnu.org X-Assp-Client-TLS: yes X-Assp-Server-TLS: yes 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" Xref: news.gmane.org gmane.emacs.bugs:140581 Archived-At: 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?