11

Is there a way to tell emacs to always kill flymake processes when I'm closing the associated buffer? I don't want to get the confirmation when the only process associated with the buffer is a flymake process?

Mat
  • 202,337
  • 40
  • 393
  • 406
kanak
  • 271
  • 2
  • 8

2 Answers2

12

You can also turn the process-query-on-exit-flag off with advice:

(defadvice flymake-start-syntax-check-process (after
                                               cheeso-advice-flymake-start-syntax-check-1
                                               (cmd args dir)
                                               activate compile)
  ;; set flag to allow exit without query on any
  ;;active flymake processes
  (set-process-query-on-exit-flag ad-return-value nil))

This has the same effect as the patch above, but it does not require modifying flymake.el .

Cheeso
  • 189,189
  • 101
  • 473
  • 713
  • 1
    BTW, I don't use flymake any longer. Flymake was a cool idea, but the execution was wanting. There are problems with running flymake when you have lots of buffers open (http://www.flycheck.org/en/latest/user/flycheck-versus-flymake.html#flycheck-versus-flymake), which for me is "all the time." Flycheck, on the other hand, seems better executed. I've switched over to flycheck and am quite happy. – Cheeso Jan 19 '17 at 20:21
5

Here's a patch. The gist is to modify the function that invokes flymake to use set-process-query-on-exit-flag to set the process-query-on-exit-flag variable to nil for the flymake process. See also C-h f set-process-query-on-exit-flag.

Ross Patterson
  • 5,702
  • 20
  • 38
  • 1
    Does this properly delete the flymake files that flymake generates? – asmeurer May 11 '13 at 07:20
  • 2
    Then this isn't very helpful. Way is really needed is an exit hook that does whatever normally happens when the fly make process exits without asking. Or at the very least, explicitly delete this file. – asmeurer May 11 '13 at 17:55
  • 3
    Did you read the question? It's helpful for what the person actually *asked*. If you have a different question, ask it in a different question. – Ross Patterson May 11 '13 at 21:31