From 7207002caeb54f59e2005acb2bb835b458123202 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 22 Apr 2024 09:54:18 +0300 Subject: [PATCH] * lisp/progmodes/flymake.el: Small improvements for buffers display. (flymake-mode-map): Bind mouse-1 click on the fringe to 'flymake-show-buffer-diagnostics' (bug#70459). (flymake-show-buffer-diagnostics): Display buffer diagnostics at the bottom. (flymake-show-project-diagnostics): Display project diagnostics at the bottom. (cherry picked from commit 419550c7907275bf962986e1cc8fba1989d8659c) --- lisp/progmodes/flymake.el | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 22a139d3045..f5bf68db574 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1331,7 +1331,10 @@ Interactively, with a prefix arg, FORCE is t." nil)))))))) (defvar flymake-mode-map - (let ((map (make-sparse-keymap))) map) + (let ((map (make-sparse-keymap))) + (define-key map `[,flymake-fringe-indicator-position mouse-1] + #'flymake-show-buffer-diagnostics) + map) "Keymap for `flymake-mode'.") ;;;###autoload @@ -1972,8 +1975,12 @@ buffer." (current-buffer))))) (with-current-buffer target (setq flymake--diagnostics-buffer-source source) - (display-buffer (current-buffer)) - (revert-buffer)))) + (revert-buffer) + (display-buffer (current-buffer) + `((display-buffer-reuse-window + display-buffer-below-selected) + (window-height . (lambda (window) + (fit-window-to-buffer window 10)))))))) ;;; Per-project diagnostic listing @@ -2073,8 +2080,11 @@ some of this variable's contents the diagnostic listings.") (with-current-buffer buffer (flymake-project-diagnostics-mode) (setq-local flymake--project-diagnostic-list-project prj) - (display-buffer (current-buffer)) - (revert-buffer)))) + (revert-buffer) + (display-buffer (current-buffer) + `((display-buffer-reuse-window + display-buffer-at-bottom) + (window-height . fit-window-to-buffer)))))) (defun flymake--update-diagnostics-listings (buffer) "Update diagnostics listings somehow relevant to BUFFER." -- 2.39.5