emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] latex-mode flymake backend


From: João Távora
Subject: Re: [PATCH] latex-mode flymake backend
Date: Wed, 11 Oct 2017 14:50:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux)

Mark Oteiza <address@hidden> writes:

> Here is a patch for a flymake backend using chktex.

Hi Mark, just a couple of comments below the sig.

João

> +            (make-process
> +             :name "tex-chktex"
> +             :buffer (generate-new-buffer "*tex-chktex*")
> +             :command (tex-chktex-command)
> +             :noquery t :connection-type 'pipe
> +             :sentinel
> +             (lambda (process _event)

Before proceeding to the unwind-protect form, I think you have to check
that 'process' has indeed exited by using

(when (eq (process-status process) 'exit)
  (unwind-protect ...))

According to Stefan, the sentinel also runs when the process is merely
suspended.

> +               (unwind-protect
> +                   (when (eq process tex-chktex--process)

Are you sure you don't want to additionally check process-exit-status
for 0 here? (it's OK if you know you don't, GCC for example exits non-0
with suitable output)

> +                     (with-current-buffer (process-buffer process)
> +                       (goto-char (point-min))
> +                       (cl-loop
> +                        while (search-forward-regexp
> +                               
> "^stdin:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\(.*\\)$"
> +                               nil t)
> +                        for msg = (match-string 4)
> +                        for (beg . end) = (flymake-diag-region source
> +                                                               
> (string-to-number (match-string 1))
> +                                                               
> (string-to-number (match-string 2)))

Someone else will nitpick you on the 80 cols :-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]