help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flymake ignores buffer specified in `flymake-make-diagnostic'?


From: Philipp Stephani
Subject: Re: Flymake ignores buffer specified in `flymake-make-diagnostic'?
Date: Sun, 10 Feb 2019 20:47:09 +0100

Am Do., 3. Jan. 2019 um 16:40 Uhr schrieb João Távora <joaotavora@gmail.com>:
>
> 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-functions.html.



>
> João
>
> On Wed, Dec 12, 2018 at 8:11 PM Philipp Stephani <p.stephani2@gmail.com> 
> 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-diagnostics)))
> >               (cons 'buf-b (with-current-buffer buf-b
> > (flymake-diagnostics))))))))
> >
> > ⇒ ((buf-a) (buf-b #s(flymake--diag #<killed buffer> 1 7 :error
> > "message" (lambda ... ...) nil #<overlay in no buffer>)))
> >
> > 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!
> >



reply via email to

[Prev in Thread] Current Thread [Next in Thread]