From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: feature request: public API to get new flymake's errors/warnings Date: Mon, 16 Oct 2017 19:23:05 +0100 Message-ID: <87inffhrzq.fsf@gmail.com> References: 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 1508178230 1320 195.159.176.226 (16 Oct 2017 18:23:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Oct 2017 18:23:50 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: emacs-devel@gnu.org To: Yuta Yamada Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 16 20:23:46 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 1e4A3F-0007p3-9G for ged-emacs-devel@m.gmane.org; Mon, 16 Oct 2017 20:23:45 +0200 Original-Received: from localhost ([::1]:34618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4A3J-0003rQ-Ji for ged-emacs-devel@m.gmane.org; Mon, 16 Oct 2017 14:23:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4A2j-0003rJ-OO for emacs-devel@gnu.org; Mon, 16 Oct 2017 14:23:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4A2h-0001WF-3m for emacs-devel@gnu.org; Mon, 16 Oct 2017 14:23:13 -0400 Original-Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:50811) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4A2g-0001VH-TY for emacs-devel@gnu.org; Mon, 16 Oct 2017 14:23:11 -0400 Original-Received: by mail-wr0-x22c.google.com with SMTP id q42so3846670wrb.7 for ; Mon, 16 Oct 2017 11:23:09 -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=Ln2HJCbMnc21hS0RokuslyYN1mHJwOt5dNoJ6tY+yOA=; b=XE1hWkFE7i/j2Qf/8q0rwm00TWhah0b2Oy1zxzy/yxssYpFzUEMeOercIPhAOVmk9r 7ZI/VBC/T8G/ZAPh+xYHErbun1YqcU4EyuR/oYNDrhWfH3UWMZrhkbSBdL1k9s/I63fY yHYpGZIyeGEGG0DU48EoeYIltKMQnAKeswjFWQUIdOTMHeYLevFCJWwhrudBnCRcZ3Wu EauedRnVsCCPQ5IJfXgNSQchyULL2Pn+6InOnQsiBaoXCHWPpFM2SxCrguJh0yB9zYM+ QG76jbpoGbC1BobMnskilA02NiEVWWg0z668uPR39a6wzBVd0qjQB7LKUp2czLvv0inp vsuA== 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=Ln2HJCbMnc21hS0RokuslyYN1mHJwOt5dNoJ6tY+yOA=; b=Zc7/d/1xX+TNRSaxYb7tSjRWxT47QEkKm8Y5Z2SptWP+PLJiiSFvM12Zy97UwUlhe7 nQ2sxvDsaxgS7tfp2KmkfY70uVFmfA27EqjiXpivju4wL2SG3rUWUQIXLgLhlAIbkiYf njO2mcIy9/vKaN4d0nGnOQ3sDXIKZsQ+1jOY+FSgs58SJP7WA6ic4a9pSpQtdBckYa1W 2rjF7lTVAsDe1yWgjZWzwWkesqAhe2JO6oHojbBw4wlyRifEmY9sM7CBqwWI539bfVJ4 tfOxAiMVP71pu/U4TyZcj35sHa3t8f046lC1RdmZlO91gNT4lUYRGsVctTP3VIMc/OmD Mi6A== X-Gm-Message-State: AMCzsaV4T6IxQeags3uaIT8KBIjz3Yi+dpIBxACY8Ko/6dIMaEkZENv3 GF/tTqnntylGZN1w/kO9SOGcnat2 X-Google-Smtp-Source: ABhQp+QCgOIZpXe/Pm/SDRdaIV3QG4AEPLZqJgm6yNo27v5S4gbr/lkDF3dsCsuC+A3UIqiDLdfQUQ== X-Received: by 10.223.170.154 with SMTP id h26mr1295351wrc.87.1508178188405; Mon, 16 Oct 2017 11:23:08 -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 b190sm9041185wma.22.2017.10.16.11.23.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 11:23:07 -0700 (PDT) In-Reply-To: (Yuta Yamada's message of "Mon, 16 Oct 2017 09:41:16 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22c 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:219587 Archived-At: Yuta Yamada writes: > Hello Emacs devel. > > First of all, thank you to rewritten of flymake! > > I'm an emacs' package maintainer of flycheck-tip and > flycheck-nimsuggest (nim language's flycheck backend) and I could > convert to flycheck-nimsuggest.el for flymake very easy. > > But, as for flycheck-tip (which show flycheck/flymake's errors and > warning on a tooltip), or other flymake related packages, could you > support public API to get errors and warnings object? (I mean a public > function for it) > I see. I think you could try to write it with the internal functions that I mention in the rest of this message and then we can more easily see which parts are currently "internal" that could be "external": 1) Most important you need an easy way to get the the "diagnostic" object at point. This is held by the overlays within their 'flymake--diagnostic' property. 2) You'll probably need accessors for the flymake--diag object (text, type, issuing backend function). I think this is a question of renameing the existing flymake--diag-text, flymake--diag-type, flymake--diag-backend. 3) Perhaps a way to get all the diagnostics in a region. There is flymake--overlays for this. 4) Maybe check the properties (severity) of a given type? This is currently done via flymake--lookup-type-property. My only doubt is if 1 and 3 should work through the overlays API (flymake--overlays and overlay-get for discrimination) i.e. If so the API is smaller, but ties Flymake to an overlay overlay-based implementation. Otherwise we can make flymake-diagnostics-at-point etc... > because I don't feel the fear of devel's change. :-) Jo=C3=A3o