From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <51aff540-e37b-e590-a125-b9ce87366a14@gmail.com> <87muxq1fq9.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d55c3c056ad4b81c" X-Trace: blaine.gmane.org 1524836737 16277 195.159.176.226 (27 Apr 2018 13:45:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Apr 2018 13:45:37 +0000 (UTC) Cc: Jorgen.Schaefer@gmail.com, 31270@debbugs.gnu.org To: Da Zhang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 27 15:45:32 2018 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 1fC3gq-00049T-G3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Apr 2018 15:45:32 +0200 Original-Received: from localhost ([::1]:48212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC3ix-00057c-E6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Apr 2018 09:47:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC3hO-0004KB-1S for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:46:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fC3hK-0006Pi-U9 for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:46:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fC3hK-0006Pd-Ou for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fC3hK-0003Ku-FQ for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Apr 2018 13:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31270 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 31270-submit@debbugs.gnu.org id=B31270.152483675712808 (code B ref 31270); Fri, 27 Apr 2018 13:46:02 +0000 Original-Received: (at 31270) by debbugs.gnu.org; 27 Apr 2018 13:45:57 +0000 Original-Received: from localhost ([127.0.0.1]:41041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fC3hE-0003KW-Nu for submit@debbugs.gnu.org; Fri, 27 Apr 2018 09:45:57 -0400 Original-Received: from mail-qt0-f179.google.com ([209.85.216.179]:39010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fC3hD-0003KK-L1 for 31270@debbugs.gnu.org; Fri, 27 Apr 2018 09:45:56 -0400 Original-Received: by mail-qt0-f179.google.com with SMTP id f1-v6so2280676qtj.6 for <31270@debbugs.gnu.org>; Fri, 27 Apr 2018 06:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lYnSRkIHlR1Bw11lNrY/yKYqAKLrtK8aLPSedfqVCPo=; b=YEkoCAEuVoCZBtWrTTR0VSItB5rikpnhPDky0amGmwO6ptgpp9rXVFt7u0esshxwRk us6jy8tuD4V9TFL47OCjLJQbE8dm1F5OEfSLXvnzhjpfFjG10H8OBu6+HD5Emi5xB/nK fa6BCpeq97cjYiourr7rCmczr8DShIB48sx0lNNDha38axxCF1v2GsvcekVoCGFUiD4k i60KbTMXHaeTYouhCSbCJVTTB6b+Wi2eQ8tl3hLIGhxfDWTBae0y0vpyMMGM5afmftSR euUc+Kslhj8iaL/RG5T/yPD+O0apd+Jq8HcLTpSEa2Y+/PdHTZPYBIeCjNSPBC5CIa2S kMYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lYnSRkIHlR1Bw11lNrY/yKYqAKLrtK8aLPSedfqVCPo=; b=Qm7ql1Cx9CZmntJjmqlpsWp2auEpOli/2k5qiwpb9UpJtlIbbabxKK2oeckUaJug/m VHnnIX65quhVUFHHe2NlsniqyJAnrd3HC2QKuYfaww2C7fAxub/Iwg4zrq8ew6sTNS54 MwxfG6JdzYjJzu+swRLcfIud64wrHp9IgO8B5IasV6bEa6RatbGlQi5pBpdN8b9l2v0I +yk+uQr8ISBMK0xZkDA7A5oF4hV1+idV9V2a5Xl12nuuGjkNr6LIyopqhAfXPPCLh8ku rha39SB27WgQJsOnkrLKjtMGVa9wVgKpbZfkWSTUj0H6sxTP93Saj89d0dzTtujPBzaA Fe+Q== X-Gm-Message-State: ALQs6tDxWfceBkA2U8dslTDmsgn1+jWvlm0i38lEG7yF9/pgA2rThpxA W9T0uUcS8kzx1mPNJ+rhD+ZHH3GVXtRWesyrCfc= X-Google-Smtp-Source: AB8JxZpOe9LYPKXG/GSAl/3gAbQUBZXZj54221L2/FxmS8ywd0dSOLe8V2QLUu139YSQfD1YxfHsleMZ0FGnHn10h8U= X-Received: by 2002:ac8:7217:: with SMTP id a23-v6mr1939289qtp.243.1524836750153; Fri, 27 Apr 2018 06:45:50 -0700 (PDT) In-Reply-To: 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:145785 Archived-At: --000000000000d55c3c056ad4b81c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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=C3=A3o T=C3=A1vora wrote: > > Da Zhang writes: > > > Hello -- > > I am a long term Emacs user and I use flymake together with flymake-curso= r 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=C3=A3o > > > > > > > > > > > --000000000000d55c3c056ad4b81c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I believe (fboundp 'flymake-diagnostics) is a simple = and effective enough check.

In= cidentally, I don't know what elpy does in regards to syntax checking, = but it might have been completely or partially superseded by the new flymak= e python backend.

On Fri, Apr 27, 2018, 14:35 Da Zhang <zhangda82@gmail.com> wrote:
=20 =20 =20

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=C3=A3o T=C3=A1vora wrote:
Da Zhang &=
lt;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 ()
=C2=A0 "Return the flymake error at point, or nil if there is none.&qu=
ot;
=C2=A0 (when (boundp 'flymake-err-info)
=C2=A0=C2=A0=C2=A0 (let* ((lineno (line-number-at-pos))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (err-info (car=
 (flymake-find-err-info flymake-err-info
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 lineno))))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (when err-info
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mapconcat #'flymake-ler-tex=
t
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 err-info
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ", ")))))

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 ()
=C2=A0 "Return the flymake error at point, or nil if there is none.&qu=
ot;
  (mapconcat #'flymake-diagnostic-text (flymake-diagnostics (point)) &q=
uot;\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 manu=
al
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=C3=A3o









--000000000000d55c3c056ad4b81c--