bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#31270: 26.1; Emacs 26.1 RC1 -- flymake-err-info is no longer availab


From: João Távora
Subject: bug#31270: 26.1; Emacs 26.1 RC1 -- flymake-err-info is no longer available
Date: Thu, 26 Apr 2018 10:25:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux)

Da Zhang <address@hidden> writes:

> Hello --
>
> I am a long term Emacs user and I use flymake together with flymake-cursor on 
> a daily basis.
>
> Starting Emacs 26.1, I noticed that flyamke was redesigned and no
> longer has the var flymake-err-info that contains the error info
> reported by the backend syntax checker.
>
> This makes flymake-cursor and code like the following not work:
>
> (defun elpy-flymake-error-at-point ()
>   "Return the flymake error at point, or nil if there is none."
>   (when (boundp 'flymake-err-info)
>     (let* ((lineno (line-number-at-pos))
>            (err-info (car (flymake-find-err-info flymake-err-info
>                                                  lineno))))
>       (when err-info
>         (mapconcat #'flymake-ler-text
>                    err-info
>                    ", ")))))
>
> I believe this is a potential issue and wonder if someone could direct
> me to any alternatives to flymake-err-info in the newly designed
> flyamke.

Hi Da Zhang,

I'm the responsible for the redesign. Although I tried to keep *some*
backward compatibility to old flymake.el's API, the truth is that *all*
of it was an API.

The bad news is that this variable is gone: it couldn't be
backward-adapted. The good news is that it should be much easier to
write your function:

(defun elpy-flymake-error-at-point ()
  "Return the flymake error at point, or nil if there is none."
  (mapconcat #'flymake-diagnostic-text (flymake-diagnostics (point)) "\n"))

Notice that, to keep with the protocol, this returns a concatenation of
the text strings of all the errors at point. You might be better served
by returning and manipulating the objects returned by
flymake-diagnostics instead.

See section "2.2.1 Flymake utility functions" of the Flymake manual
bundled with Emacs for more information.

I don't know what flymake-cursor does, but I suspect it can be fixed
accordingly.

Hope this helps,
João













reply via email to

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