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

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

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


From: Philipp Stephani
Subject: Flymake ignores buffer specified in `flymake-make-diagnostic'?
Date: Wed, 12 Dec 2018 20:48:57 +0100

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]