* 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.
This commit is contained in:
Juri Linkov 2024-04-22 09:54:18 +03:00
parent 086608876a
commit 419550c790

View file

@ -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."