From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.help
Subject: Re: Flymake ignores buffer specified in `flymake-make-diagnostic'?
Date: Sun, 10 Feb 2019 20:47:09 +0100
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
logging-data="18406"; mail-complaints-to="usenet@blaine.gmane.org"
Cc: help-gnu-emacs
To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?=
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 10 20:48:46 2019
Return-path:
Envelope-to: geh-help-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256)
(Exim 4.89)
(envelope-from )
id 1gsv5p-0004bF-1R
for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Feb 2019 20:48:45 +0100
Original-Received: from localhost ([127.0.0.1]:34791 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1gsv5o-0000D0-1V
for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Feb 2019 14:48:44 -0500
Original-Received: from eggs.gnu.org ([209.51.188.92]:38769)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1gsv4Y-0008LU-UM
for help-gnu-emacs@gnu.org; Sun, 10 Feb 2019 14:47:27 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1gsv4U-0003iL-T3
for help-gnu-emacs@gnu.org; Sun, 10 Feb 2019 14:47:23 -0500
Original-Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]:39162)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1gsv4U-0003i1-AK
for help-gnu-emacs@gnu.org; Sun, 10 Feb 2019 14:47:22 -0500
Original-Received: by mail-ot1-x32e.google.com with SMTP id n8so14157422otl.6
for ; Sun, 10 Feb 2019 11:47:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc:content-transfer-encoding;
bh=hh5YjuHy+wbUVjpEnrnNzDloccu1EVTpueQjb81ArjM=;
b=L9VTIQm0KVX6mQlG3zLhaqYYoqklIIg1hWrx9AYTWrPYZxQswbj3/uOKtEUsbYgxLp
APSjE2CqYGm3ISJljITgvU0FrLTkE3QdeQj5ccptNpPgtrst8SCiFHRiiNzUZ5LJLTk7
Z7khfy9YSuyPYXOBe3vikgJQfK8l/rsLmLhp5OO2bIRsn7Nw7ttOM30eVyWul0XWOESy
PZZ9HyJkhhVha1fx8SdrbwzcAhGA4+YJyUNaMqLF32AnNSBXVeMKbAafWGJi3w8d2CV/
OftQDoEHeigmIlRV2a6/2I253cyJkybvBtpiRyYYuhKXzTSzN1w9l79Gr0FPORVtAdbO
A1ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc:content-transfer-encoding;
bh=hh5YjuHy+wbUVjpEnrnNzDloccu1EVTpueQjb81ArjM=;
b=sKwp5DdARFz9j/2YWDQjD+f+uUNs5Vwl10F9+g/+HonC6dOOUmD7VBC94IzAACLiHA
sLGGO8A8kjKjU6n86imdwEYN7qLb+IRTyGy/0vHHMxCS1WMaS/YJ31Ts/yplh2BSyzFN
C5f4/QNZIJGE+EcMREcgr/P4OlJAXCfOF+yF5ogbouz6pBvoYiDDiDH4Y1C9uar71hpN
j4GWJ5O9sitnkeC3kuz9MXjvMbo1HWeYAMR5kXz7M+xtdGWdVM0iXxDXKP1iaLbzowwz
qJOPQBep1nRIoTj3QJ/R+o+6d2XQ2/Go02AQ1RMgl2y95TSE30XWlI90n7MMui8dqCdn
aZwg==
X-Gm-Message-State: AHQUAubSJsxFREtXWxjFPJM5zRke+qXLYC7/cy7zk4YxYmopJIya7tEf
Q7BfE7lz5XUeYG4nTiMk7xrqSJ0PYa8W6zrnzXo=
X-Google-Smtp-Source: AHgI3IZHrQ7HTcpFGlqmlOA10o+Dq7jMTMrSPMplTafGnbDSq0MiXtbZ+9/UVa0wiZwZKIESxxXxYzxUqLb79Ug1OMI=
X-Received: by 2002:a9d:130:: with SMTP id 45mr5377224otu.355.1549828040567;
Sun, 10 Feb 2019 11:47:20 -0800 (PST)
In-Reply-To:
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 2607:f8b0:4864:20::32e
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: Users list for the GNU Emacs text editor
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "help-gnu-emacs"
Xref: news.gmane.org gmane.emacs.help:119321
Archived-At:
Am Do., 3. Jan. 2019 um 16:40 Uhr schrieb Jo=C3=A3o T=C3=A1vora :
>
> I stumbled upon this by chance (I don't systematically read
> help-gnu-emacs).
>
> Can you make a bug report out of this, and explain what the
> problem is in terms of user UI and Emacs -Q?
Done (see bug#34418).
> Your code example is
> a bit too convoluted for me to grok an understand right now. Are
> you running into trouble writing a new backend?
>
> Also, flymake-make-diagnostic doesn't ignore the buffer passed to
> it, flymake-show-diagnostic uses it. But it is currently unspecified
> behaviour if you make a diagnostic for any buffer other than
> the one you're explicitly checking. It might be specified to do
> something useful in the future (think checking a .c file
> including a .h file).
I think it should either signal an error or use the diagnostic for the
other buffer. At the very least, please document this fact in
https://www.gnu.org/software/emacs/manual/html_node/flymake/Backend-functio=
ns.html.
>
> Jo=C3=A3o
>
> On Wed, Dec 12, 2018 at 8:11 PM Philipp Stephani =
wrote:
> >
> > Hi,
> >
> > I've noticed that Flymake ignores the buffer passed to
> > `flymake-make-diagnostic' and always uses the source buffer. For
> > example, in *scratch*:
> >
> > (require 'flymake)
> > (with-temp-buffer
> > (flymake-mode)
> > (insert "text a")
> > (let ((buf-a (current-buffer)))
> > (with-temp-buffer
> > (flymake-mode)
> > (insert "text b")
> > (let ((buf-b (current-buffer)))
> > (add-hook 'flymake-diagnostic-functions
> > (lambda (report-fn &rest _args)
> > (funcall report-fn (list (with-current-buffer buf-a
> >
> > (flymake-make-diagnostic buf-a (point-min) (point-max)
> >
> > :error "message"))) ))
> > nil :local)
> > (flymake-start)
> > (sit-for 1)
> > (list (cons 'buf-a (with-current-buffer buf-a (flymake-diagnost=
ics)))
> > (cons 'buf-b (with-current-buffer buf-b
> > (flymake-diagnostics))))))))
> >
> > =E2=87=92 ((buf-a) (buf-b #s(flymake--diag # 1 7 :error
> > "message" (lambda ... ...) nil #)))
> >
> > This seems a bit surprising, and I couldn't find documentation on it.
> > Is this working as intended? If so, would it be possible to clarify
> > the documentation a bit? Thanks!
> >