From dad2a41a2ab792ab6fdc3ff972117102c3c3e5ca Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 25 Apr 2022 10:05:44 +0200 Subject: [PATCH] Make flymake-show-buffer-diagnostics error out in non-Flymake buffers * lisp/progmodes/flymake.el (flymake-show-buffer-diagnostics): Signal an error if run outside of a buffer with Flymake enabled (bug#55097). --- lisp/progmodes/flymake.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 83d7bc8641c..8cbebe78fe1 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1637,6 +1637,8 @@ buffer." (defun flymake-show-buffer-diagnostics () "Show a list of Flymake diagnostics for current buffer." (interactive) + (unless flymake-mode + (user-error "Flymake mode is not enabled in the current buffer")) (let* ((name (flymake--diagnostics-buffer-name)) (source (current-buffer)) (target (or (get-buffer name) -- 2.39.2