unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Flymake ignores buffer specified in `flymake-make-diagnostic'?
@ 2018-12-12 19:48 Philipp Stephani
  2019-01-03 15:40 ` João Távora
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Stephani @ 2018-12-12 19:48 UTC (permalink / raw)
  To: help-gnu-emacs

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!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-10 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-12 19:48 Flymake ignores buffer specified in `flymake-make-diagnostic'? Philipp Stephani
2019-01-03 15:40 ` João Távora
2019-02-10 19:47   ` Philipp Stephani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).