[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Flymake ignores buffer specified in `flymake-make-diagnostic'?
From: |
João Távora |
Subject: |
Re: Flymake ignores buffer specified in `flymake-make-diagnostic'? |
Date: |
Thu, 3 Jan 2019 15:40:31 +0000 |
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? 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).
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!
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Flymake ignores buffer specified in `flymake-make-diagnostic'?,
João Távora <=