From: Lele Gaifax <lele@metapensiero.it>
To: 29246@debbugs.gnu.org
Subject: bug#29246: Possible solution?
Date: Fri, 01 Dec 2017 12:06:34 +0100 [thread overview]
Message-ID: <87374u1zd1.fsf@metapensiero.it> (raw)
In-Reply-To: <87po8qi0bc.fsf@metapensiero.it>
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?
next prev parent reply other threads:[~2017-12-01 11:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 16:08 bug#29246: 26.0.90; Wrong type argument: integer-or-marker-p, nil in flymake--highlight-line Lele Gaifax
2017-12-01 11:06 ` Lele Gaifax [this message]
2019-11-11 2:17 ` bug#29246: Possible solution? Stefan Kangas
2019-11-23 8:19 ` Lele Gaifax
2019-11-23 16:34 ` Stefan Kangas
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87374u1zd1.fsf@metapensiero.it \
--to=lele@metapensiero.it \
--cc=29246@debbugs.gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).