mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 14:30:50 -08:00
Fix 'flymake-show-diagnostics-buffer' when line numbers are displayed
* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries): Do nothing if 'flymake--diagnostics-buffer-source' is not a buffer. (Bug#40529)
This commit is contained in:
parent
63e8d0ea87
commit
ff09b4eeac
1 changed files with 36 additions and 29 deletions
|
|
@ -1321,6 +1321,13 @@ POS can be a buffer position or a button"
|
|||
(flymake-show-diagnostic (if (button-type pos) (button-start pos) pos))))
|
||||
|
||||
(defun flymake--diagnostics-buffer-entries ()
|
||||
;; Do nothing if 'flymake--diagnostics-buffer-source' has not yet
|
||||
;; been set to a valid buffer. This could happen when this function
|
||||
;; is called too early. For example 'global-display-line-numbers-mode'
|
||||
;; calls us from its mode hook, when the diagnostic buffer has just
|
||||
;; been created by 'flymake-show-diagnostics-buffer', but is not yet
|
||||
;; set up properly.
|
||||
(when (bufferp flymake--diagnostics-buffer-source)
|
||||
(with-current-buffer flymake--diagnostics-buffer-source
|
||||
(cl-loop for diag in
|
||||
(cl-sort (flymake-diagnostics) #'< :key #'flymake-diagnostic-beg)
|
||||
|
|
@ -1349,7 +1356,7 @@ POS can be a buffer position or a button"
|
|||
help-echo "mouse-2: visit this diagnostic"
|
||||
face nil
|
||||
action flymake-goto-diagnostic
|
||||
mouse-action flymake-goto-diagnostic)]))))
|
||||
mouse-action flymake-goto-diagnostic)])))))
|
||||
|
||||
(define-derived-mode flymake-diagnostics-buffer-mode tabulated-list-mode
|
||||
"Flymake diagnostics"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue