From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?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: Thu, 26 Apr 2018 10:25:50 +0100 Message-ID: <87muxq1fq9.fsf@gmail.com> References: <51aff540-e37b-e590-a125-b9ce87366a14@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1524734707 24213 195.159.176.226 (26 Apr 2018 09:25:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2018 09:25:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) Cc: 31270@debbugs.gnu.org To: Da Zhang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 26 11:25:03 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 1fBd9A-00068E-Vm for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Apr 2018 11:25:01 +0200 Original-Received: from localhost ([::1]:41148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBdBG-0002uF-MK for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Apr 2018 05:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBdBA-0002u9-Qt for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 05:27:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBdB8-0002Kc-6c for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 05:27:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60245) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBdB8-0002KT-1e for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 05:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fBdB7-00027Y-OA for bug-gnu-emacs@gnu.org; Thu, 26 Apr 2018 05:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: joaotavora@gmail.com (=?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: Thu, 26 Apr 2018 09:27: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.15247347678087 (code B ref 31270); Thu, 26 Apr 2018 09:27:01 +0000 Original-Received: (at 31270) by debbugs.gnu.org; 26 Apr 2018 09:26:07 +0000 Original-Received: from localhost ([127.0.0.1]:39909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fBdAE-00026N-Vv for submit@debbugs.gnu.org; Thu, 26 Apr 2018 05:26:07 -0400 Original-Received: from mail-wr0-f173.google.com ([209.85.128.173]:46124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fBdAD-00025t-O0 for 31270@debbugs.gnu.org; Thu, 26 Apr 2018 05:26:06 -0400 Original-Received: by mail-wr0-f173.google.com with SMTP id d1-v6so55988780wrj.13 for <31270@debbugs.gnu.org>; Thu, 26 Apr 2018 02:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=mxnaraW09/Z1XUBAlrYXjcIwdTezyH3st17LmB5ovBU=; b=I5c39k+J203ZZ/Y1skiBEzMt2tYzt/qhrTTKorqiASqt2JxfuUzccUPw2lA4w2RbzJ mE8nJ1qXGMgNSztOm7alaEw3mm1Waj2nPQGwSOrxLaP1jvQ8e1YGDMdFYNP0nx4LmvzL 07TbR40w9CGJFbv7V0pN7gL62C+UTfvRAo12H9q1tleNSiootYvVS3eMl9J7qmnasmk9 Ni1Lm02mZLyjPe9Ich9i/r+Y+kQLdWxA6ndaOwJ4FlzwuSfxqk+lns9LIl6hkLSZ6vub f1vJ2V2TFiN0M4+tkbV8h+K7Cz1ATimWQNKa9JkPrMZNHgTkwlgEKehJ4XDRUt+km9Hq O9AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=mxnaraW09/Z1XUBAlrYXjcIwdTezyH3st17LmB5ovBU=; b=dVHnSqwQQ+Zkyl2GN5KQLG7R2lZqDcbW71HVMxn0vTp8bM2DuAL6/fYb1jWV8TIM8d XrWVIyTvu/cmCIHsEQD6qW/VkTviRCVQ69Awk8o73n2Ctt0CkCs3TlxZpC04Dfbi81pb y3s3+ZZHTtemOJM5GV2rdJiwDWD+yxc9wG6nh3o8aDTlzFlpUjFjDy6WdDEnxkL+jBF5 CUttPOvyeYafUk8uumQBJs96E6ieAWUso50EtFjqCvoR9vFJUUycNCso8HBHYJrNnx9t N4yrPCNlvyzFDhgGqlM1NLxSGL7wvg6lpVQLobLamn3j2voBOUwhaFXFkGM8wMavqJB2 DMMA== X-Gm-Message-State: ALQs6tA6OWiSzhZKIK8Pm0PgjpbEzBbIOWYYL/29+eFRkYBpQS21IQpq ZAeBtoIXl4CKlOa2xlyB0Q2eELlo X-Google-Smtp-Source: AIpwx49euuNWJ8tVgic6LO2oDxGgNFej4J9K2S6jzXnBkAa5P8LSVF8wv/M2+9Pg1q20OBeaFRf76A== X-Received: by 2002:adf:8827:: with SMTP id d36-v6mr26262804wrd.41.1524734759660; Thu, 26 Apr 2018 02:25:59 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id f2-v6sm15571463wre.76.2018.04.26.02.25.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 02:25:58 -0700 (PDT) In-Reply-To: <51aff540-e37b-e590-a125-b9ce87366a14@gmail.com> (Da Zhang's message of "Thu, 26 Apr 2018 01:35:15 -0400") 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:145758 Archived-At: 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 () > =C2=A0 "Return the flymake error at point, or nil if there is none." > =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 (c= ar (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-text > =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." (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