From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Da Zhang 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 09:35:12 -0400 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: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1524836164 9098 195.159.176.226 (27 Apr 2018 13:36:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Apr 2018 13:36:04 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Cc: Jorgen.Schaefer@gmail.com, 31270@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 27 15:35:59 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 1fC3Xb-0002GS-Bn for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Apr 2018 15:35:59 +0200 Original-Received: from localhost ([::1]:48166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC3Zi-0007J9-5S for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Apr 2018 09:38:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC3Xl-0005wV-4I for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:36:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fC3Xe-0002rk-H7 for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:36:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fC3Xe-0002rV-CL for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fC3Xe-00035v-0D for bug-gnu-emacs@gnu.org; Fri, 27 Apr 2018 09:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Da Zhang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Apr 2018 13:36:01 +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.152483612211849 (code B ref 31270); Fri, 27 Apr 2018 13:36:01 +0000 Original-Received: (at 31270) by debbugs.gnu.org; 27 Apr 2018 13:35:22 +0000 Original-Received: from localhost ([127.0.0.1]:41034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fC3X0-000352-D7 for submit@debbugs.gnu.org; Fri, 27 Apr 2018 09:35:22 -0400 Original-Received: from mail-qt0-f173.google.com ([209.85.216.173]:42208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fC3Wx-00034o-Sy for 31270@debbugs.gnu.org; Fri, 27 Apr 2018 09:35:20 -0400 Original-Received: by mail-qt0-f173.google.com with SMTP id c2-v6so2224386qtn.9 for <31270@debbugs.gnu.org>; Fri, 27 Apr 2018 06:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CBmWGlILp5MQZm0vQ6AAaJWZwmsH5jK2ewyw2/Q5Rm8=; b=lIWnhyuNF0wx25eTmThGNGjFZcWPT1M67TIox8s+SzNS4QvDvhbUziNlqmrjeRjguG N7KMiOQu1I4z1eAIEt/1hwv1nTzRItn01pC+OWjVuTXz4YAY85vy+im8bRiQqd73iBX/ jMOQWiJ8q9eg9+JQxRIauFpTq4Q4LJeEZOcUOHvBB61SgpZrWzbQW1VsHHGqKBon1S8I 5kyGb6ffKRI8XvObcpEazCMhgF3YEp6BDQmm5xIBinLwxQ9hvIFR0bDI3wkVmFvmVIDu g9ec/isCGeNHG2cWjYzKG+kLe7ntSUqTpaurlSgTEqMDKjD2mCofugs/irzv14GDF2zE 8WFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CBmWGlILp5MQZm0vQ6AAaJWZwmsH5jK2ewyw2/Q5Rm8=; b=erWe+g48yxhO9D6kIEKTfeqjutVFVsVgHMzGefhEyRWUuI9cY0PZqcbUeYa4TF66ds 3U1xYEGBNCy749Aj1G/9P+yRSbx4YWHlcm4XpsraF5Ll6sLBokERVji878EuRbnSB5Er ggSL5vPczmwfKraRylE386iSmMCuo2j8cJlD4GOcp7amqstNiz2SK+uH1gpKtXW1CdRt JOY7koBh94MgqeOoNZr4mlz3IRGM4z0IfH9C//Hr4v3LiaWfuLYO8EJW83bZT0f9SqZK VJNAZN5CQPTMpgHBOj5CcXqdqnivlS5fNhPw1ZZkle+GQB2Jd2nDZDkkmB3IoWZoZS/W KySA== X-Gm-Message-State: ALQs6tDIBrB0gWQGTQ1Gl5k9/vuDb7O635DQmm+9PZ79aKwFLv8pW//M flOyfJIlZGn+wpL4QG4e4jw= X-Google-Smtp-Source: AB8JxZoGCza6FjP7S4Kwba08NuYCfYbvN6Tlp9sFbe38F45427IoTPl55FZDGPPK79dP5EsbKaPasw== X-Received: by 2002:aed:38e4:: with SMTP id k91-v6mr2098766qte.408.1524836114397; Fri, 27 Apr 2018 06:35:14 -0700 (PDT) Original-Received: from [10.35.157.64] ([134.174.110.14]) by smtp.gmail.com with ESMTPSA id b27-v6sm1038766qtc.66.2018.04.27.06.35.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Apr 2018 06:35:13 -0700 (PDT) In-Reply-To: <87muxq1fq9.fsf@gmail.com> Content-Language: en-US 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:145783 Archived-At:

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> 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