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: Thu, 26 Apr 2018 11:14:44 -0400 Message-ID: <092a56e4-88c3-d87a-a44b-c1a9a452a757@gmail.com> 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 1524755597 10877 195.159.176.226 (26 Apr 2018 15:13:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2018 15:13:17 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Cc: 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 Thu Apr 26 17:13:13 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 1fBia8-0002ZU-G0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Apr 2018 17:13:12 +0200 Original-Received: from localhost ([::1]:42833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBicA-00060b-3t for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Apr 2018 11:15:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBibz-0005yE-F9 for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 11:15:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBibu-00028o-8m for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 11:15:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBibu-00028b-4h for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 11:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fBibt-0005oJ-Qt for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 11:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Da Zhang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Apr 2018 15:15: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: Original-Received: via spool by 31270-submit@debbugs.gnu.org id=B31270.152475569322307 (code B ref 31270); Thu, 26 Apr 2018 15:15:01 +0000 Original-Received: (at 31270) by debbugs.gnu.org; 26 Apr 2018 15:14:53 +0000 Original-Received: from localhost ([127.0.0.1]:40644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fBibl-0005nj-F6 for submit@debbugs.gnu.org; Thu, 26 Apr 2018 11:14:53 -0400 Original-Received: from mail-qt0-f180.google.com ([209.85.216.180]:34308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fBibj-0005nV-F6 for 31270@debbugs.gnu.org; Thu, 26 Apr 2018 11:14:51 -0400 Original-Received: by mail-qt0-f180.google.com with SMTP id m5-v6so2568902qti.1 for <31270@debbugs.gnu.org>; Thu, 26 Apr 2018 08:14:51 -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=TqAbqqw1uwnTrgZ5TSvuD6/Rspi7UUoBq501kY5x4/k=; b=EuCWpZ4TbHe6ggUM/W8r2Y2HNgla7AiRDxTPvYewaCY7txE5ZQxJArnqmuCjfREc3u 4PO107Q1Ouo3eQKI/xwdqX3uiWBe6sBdutRUHByMBVpYUUthr0bbRvysc+/TyXTKekHk lAYvHGFhnXFXcJbKMNbuS76Nuzm/K6ssXjoSulV6YN7cVT/tkKkLVMbFEj5QWdgUSnNq jLP4XufRA4+cidnHJAcOnIN/sHQ+Rneyy5SrppAFRRh+XCMXXhqvIz0O0yscA8UGhJdy 1JGCJ+fPcf5VLKNOBomsO+BFkd0ebIpWt6daHxa+MosmuvYr0Rq94T0WeY8pmQLSTHhA XS/Q== 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=TqAbqqw1uwnTrgZ5TSvuD6/Rspi7UUoBq501kY5x4/k=; b=W48iEYwhQi/M0emDto/jHu1oQnkfKJk+iLQbiEOBsHJjMdvyqw1bGKyeFVabPgsMYh 2f/mSBQFB/pNO/9TTAEXaaRhA0BeLeL5t/y9NRxqGQcQVKyBSrCJIQwCPuPzpFbXeJt6 OS4fszv1SklriTCxDizrT6pRUnCHvgKsX7kw0Bb9RcBrT5DCOuOm4XHHIrxaGDuDBjkl uhm5Zt54bP9WL4fycu3ROei/Wg5t+lftfj62eqHT1biFSW4amawfdJGUmEkthmLFyq/7 ExtVaNvkWrkUqRbSD/usI8EOTAidBj3NQeHEY4uOp+ABUn9m/Z/+O1aaPksGmuKJsi+J RUGg== X-Gm-Message-State: ALQs6tDZG2K2ezmIetNCqgT7EGe1B2mZGZl4GF2ek5r175l9SDAS+L+b Q8OXlohCVXv6Lwyyeul61ywQsA== X-Google-Smtp-Source: AB8JxZpa8lmCXl6lo5cYFbE6n7UHY/3UlMnFTHkP/PsBvgCB23H3UNH1Fl4xvK7gYf1JL6SMxaRe1w== X-Received: by 10.12.209.72 with SMTP id c8mr11557450qvh.38.1524755685866; Thu, 26 Apr 2018 08:14:45 -0700 (PDT) Original-Received: from [10.35.157.64] ([134.174.110.14]) by smtp.gmail.com with ESMTPSA id w22-v6sm16236759qtg.60.2018.04.26.08.14.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 08:14:45 -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:145766 Archived-At:

Thank you very much!!

Dave


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