]> git.eshelyaron.com Git - emacs.git/commitdiff
Make flymake-show-buffer-diagnostics error out in non-Flymake buffers
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 25 Apr 2022 08:05:44 +0000 (10:05 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 25 Apr 2022 08:05:44 +0000 (10:05 +0200)
* 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

index 83d7bc8641cd42b5f1cef8760dfcbf9ee36dad54..8cbebe78fe1334d5501eef41b073b297c78404e0 100644 (file)
@@ -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)