all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Flymake ignores buffer specified in `flymake-make-diagnostic'?
Date: Wed, 12 Dec 2018 20:48:57 +0100	[thread overview]
Message-ID: <CAArVCkTTVnHMn5O6p5bGViZYeRVQV3F_2iW4+84dDpOabt3H0Q@mail.gmail.com> (raw)

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	other threads:[~2018-12-12 19:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 19:48 Philipp Stephani [this message]
2019-01-03 15:40 ` Flymake ignores buffer specified in `flymake-make-diagnostic'? João Távora
2019-02-10 19:47   ` Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAArVCkTTVnHMn5O6p5bGViZYeRVQV3F_2iW4+84dDpOabt3H0Q@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.