From: "João Távora" <joaotavora@gmail.com>
To: Da Zhang <zhangda82@gmail.com>
Cc: Jorgen.Schaefer@gmail.com, 31270@debbugs.gnu.org
Subject: bug#31270: 26.1; Emacs 26.1 RC1 -- flymake-err-info is no longer available
Date: Fri, 27 Apr 2018 13:45:39 +0000 [thread overview]
Message-ID: <CALDnm50A-wqpDZtkENhmvyUNMLJts0fw0CG_UrKrTRH-JUEjQw@mail.gmail.com> (raw)
In-Reply-To: <bdd6ff58-c60d-a4a9-d0bc-5dc1bf4d54cf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2852 bytes --]
I believe (fboundp 'flymake-diagnostics) is a simple and effective enough
check.
Incidentally, I don't know what elpy does in regards to syntax checking,
but it might have been completely or partially superseded by the new
flymake python backend.
On Fri, Apr 27, 2018, 14:35 Da Zhang <zhangda82@gmail.com> wrote:
> Hi Joao,
>
> I tried your suggested solution and it worked beautifully. Is there a way
> to check if the new mechanism of flymake-diagnostics etc are available?
>
> I am working with the maintainer of elpy to update the function
> "elpy-flymake-error-at-point", and ideally we want to see if the new
> mechanism is available.
>
> Thanks in advance!
>
> Da
>
> On 2018-04-26 5:25 AM, João Távora wrote:
>
> Da Zhang <zhangda82@gmail.com> <zhangda82@gmail.com> 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
>
>
>
>
>
>
>
>
>
>
>
[-- Attachment #2: Type: text/html, Size: 3940 bytes --]
next prev parent reply other threads:[~2018-04-27 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 5:35 bug#31270: 26.1; Emacs 26.1 RC1 -- flymake-err-info is no longer available Da Zhang
2018-04-26 9:25 ` João Távora
2018-04-26 15:14 ` Da Zhang
2018-04-26 16:26 ` João Távora
2018-04-27 13:35 ` Da Zhang
2018-04-27 13:45 ` João Távora [this message]
2018-04-27 13:47 ` Da Zhang
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=CALDnm50A-wqpDZtkENhmvyUNMLJts0fw0CG_UrKrTRH-JUEjQw@mail.gmail.com \
--to=joaotavora@gmail.com \
--cc=31270@debbugs.gnu.org \
--cc=Jorgen.Schaefer@gmail.com \
--cc=zhangda82@gmail.com \
/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).