From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuta Yamada Newsgroups: gmane.emacs.devel Subject: Re: feature request: public API to get new flymake's errors/warnings Date: Thu, 19 Oct 2017 05:31:14 -0700 Message-ID: References: <87inffhrzq.fsf@gmail.com> <87r2tzid3u.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c0437043fe6d7055be5886a" X-Trace: blaine.gmane.org 1508416779 20150 195.159.176.226 (19 Oct 2017 12:39:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 19 Oct 2017 12:39:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 19 14:39:33 2017 Return-path: Envelope-to: ged-emacs-devel@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 1e5A6X-0002q6-74 for ged-emacs-devel@m.gmane.org; Thu, 19 Oct 2017 14:39:17 +0200 Original-Received: from localhost ([::1]:49158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5A6e-0008RN-IV for ged-emacs-devel@m.gmane.org; Thu, 19 Oct 2017 08:39:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e59yo-00072p-4x for emacs-devel@gnu.org; Thu, 19 Oct 2017 08:31:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e59yn-0005d3-6D for emacs-devel@gnu.org; Thu, 19 Oct 2017 08:31:18 -0400 Original-Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:54748) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e59yn-0005b3-0C for emacs-devel@gnu.org; Thu, 19 Oct 2017 08:31:17 -0400 Original-Received: by mail-qk0-x22b.google.com with SMTP id n5so10067267qke.11 for ; Thu, 19 Oct 2017 05:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=inB+10S+/TkU8TAkM8AWFh4oJPNUp1pXZJL1nmC1Yf4=; b=tkVLeHYi4b0bApiInaMVpeKG53rqlaisB6/CPuSKVTRx9ZFoRycz/+NaJWQvGV19kz 3TUI08I/hw/3EH7qAUvjaMQUv4dDaquUYTdZPFxBn5Gx9Bwe/G1numA45s0KedlX2jgD mL2B/lQVcoEKaxpk2t8pgB3py5YaBPwm4xR5QlX9LxiumfnL8HMGWT9XWtrItXtn35p8 Ji26BjwgHsNq+cqAOkC8skz5mySG3gIFutrVc5v0mTAOUWFKXyNsfhM7sSB6SvDNRGM0 LA4M2lnXwNJLMrucUPTBCl1rOBjwhA1G6KL0AlPOOhp5kyzhJS212aoPtGx6lRXAuHLZ DMwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=inB+10S+/TkU8TAkM8AWFh4oJPNUp1pXZJL1nmC1Yf4=; b=BKnaoRkS2Xde5WwvxkMupq+oufbqtm3pyaH4+C9hSGJy0VFIEWpiyfLje78NinJVAp xd0U53ESRwGGN/73UfJbfkI7VCeQQep+r2ocaTL12p4y0gpm/BrcuBddodWdHS2bPniA kXZkMbmo7wFX9X6lNoDKdCaNbVOcJwrWBLq8e+6lEm/IFFvsaNhi9FU0MYON3V7/6Nlr WRjhQLOjTw5M51052CxaON/S/O3frlL6m1R3dc5Rx3IXmH+OLU+Fz34LV24a1CBh0qVw e4McBKkNV+8txCLDNd4AYpHU3ZFrdpMW9dD4Q5tqrBLbaPVliXWBGg0qu4truFXJbLdU 5ciQ== X-Gm-Message-State: AMCzsaWgvfGUN+5Gstmkxe2nWFxqBvAIHjhSJ57daLQB0nBFnHHgIGmo YYhK31pDrNst51Sdkhx3gCq1VL+vFzw3/ITa+p4= X-Google-Smtp-Source: ABhQp+RWviNmPz7GW+/hjuufq+8iX76O8SCQjprZL1G33ghtlzbYlhBkde76wkQCCTrJooSBMW9hgjHUjyy/FWly6XI= X-Received: by 10.233.223.2 with SMTP id t2mr1585823qkf.331.1508416275079; Thu, 19 Oct 2017 05:31:15 -0700 (PDT) Original-Received: by 10.140.101.52 with HTTP; Thu, 19 Oct 2017 05:31:14 -0700 (PDT) In-Reply-To: <87r2tzid3u.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22b X-Mailman-Approved-At: Thu, 19 Oct 2017 08:39:18 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219629 Archived-At: --94eb2c0437043fe6d7055be5886a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > You should be able to just do: > > (defun flymake-tip-get-diag-text-on-line () > "Return list of string of error/warning info on the current line." > (cl-loop for diag in (flymake-diagnostics (point-at-bol) > (point-at-eol)) > collect (flymake-diagnostic-text diag))) > > If noone objects I shall push the patch to emacs-26 in a couple of days > time. > Thanks Joao, there is no objection from me. I'll try `flymake-diagnostic-XXX' stuff after you pushed. Yuta Yamada On Thu, Oct 19, 2017 at 4:36 AM, Jo=C3=A3o T=C3=A1vora wrote: > Yuta Yamada writes: > > > --- code: > > (defun flymake-tip-get-diag-text-on-line () > > "Return list of string of error/warning info on the current line." > > (cl-loop for ov in (flymake--overlays :beg (point-at-bol) :end > (point-at-eol)) > > collect (flymake--diag-text (overlay-get ov > 'flymake--diagnostic)))) > > --- > > > > As you can see, I used 1 (flymake--overlays), 2 (flymake--diag-text), 3 > (flymake--diagnostic). > > So, I hope those functions/symbol become public API. (i mean "-" > > instead of "--") > > Thanks, > > The attached patch augments the API for these purposes (and describes it > in the manual). > > You should be able to just do: > > (defun flymake-tip-get-diag-text-on-line () > "Return list of string of error/warning info on the current line." > (cl-loop for diag in (flymake-diagnostics (point-at-bol) > (point-at-eol)) > collect (flymake-diagnostic-text diag))) > > If noone objects I shall push the patch to emacs-26 in a couple of days > time. > > Jo=C3=A3o > > --94eb2c0437043fe6d7055be5886a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

=C2=A0 (defun flymake-tip-get-diag-text-on-line ()
=C2=A0 =C2=A0 =C2=A0 "Return list of string of error/warning info on t= he current line."
=C2=A0 =C2=A0 =C2=A0 (cl-loop for diag in (flymake-diagnostics (poin= t-at-bol) (point-at-eol))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0collect (flymake-dia= gnostic-text diag)))

If noone objects I shall push the patch to emacs-26 in a couple of days tim= e.

Thanks Joao, there is no objection= from me.
I'll try `flymake-diagnostic-XXX' stuff after yo= u pushed.

Yuta Yamada

On Thu, Oct 19, 2017 at 4:36 AM, Jo=C3=A3o= T=C3=A1vora <joaotavora@gmail.com> wrote:
Yuta Yamada <sleepboy.zzz@gmail.com> writes:

> --- code:
> (defun flymake-tip-get-diag-text-on-line ()
>=C2=A0 =C2=A0 =C2=A0"Return list of string of error/warning info o= n the current line."
>=C2=A0 =C2=A0 =C2=A0(cl-loop for ov in (flymake--overlays :beg (point-a= t-bol) :end (point-at-eol))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 collect (flymake--diag= -text (overlay-get ov 'flymake--diagnostic))))
> ---
>
> As you can see, I used 1 (flymake--overlays), 2 (flymake--diag-text), = 3 (flymake--diagnostic).
> So, I hope those functions/symbol become public API. (i mean "-&q= uot;
> instead of "--")

Thanks,

The attached patch augments the API for these purposes (and describes it in the manual).

You should be able to just do:

=C2=A0 (defun flymake-tip-get-diag-text-on-line ()
=C2=A0 =C2=A0 =C2=A0 "Return list of string of error/warning info on t= he current line."
=C2=A0 =C2=A0 =C2=A0 (cl-loop for diag in (flymake-diagnostics (poin= t-at-bol) (point-at-eol))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0collect (flymake-dia= gnostic-text diag)))

If noone objects I shall push the patch to emacs-26 in a couple of days tim= e.

Jo=C3=A3o


--94eb2c0437043fe6d7055be5886a--