diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 8a072b94a17..e911faf603d 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1891,6 +1891,10 @@ TYPE is usually keyword `:error', `:warning' or `:note'." (let ((map (make-sparse-keymap))) (define-key map (kbd "RET") 'flymake-goto-diagnostic) (define-key map (kbd "SPC") 'flymake-show-diagnostic) + (keymap-set map "C-o" #'flymake-show-diagnostic) + (keymap-set map "C-m" #'flymake-goto-diagnostic) + (keymap-set map "n" #'next-error-this-buffer-no-select) + (keymap-set map "p" #'previous-error-this-buffer-no-select) map)) (defun flymake-show-diagnostic (pos &optional other-window) @@ -2187,6 +2191,11 @@ some of this variable's contents the diagnostic listings.") (defvar-local flymake--project-diagnostic-list-project nil) +(defvar flymake-project-diagnostics-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map flymake-diagnostics-buffer-mode-map) + map)) + (define-derived-mode flymake-project-diagnostics-mode tabulated-list-mode "Flymake diagnostics" "A mode for listing Flymake diagnostics in a project." diff --git a/lisp/simple.el b/lisp/simple.el index f686907ad68..fa173b26289 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -478,6 +478,16 @@ select the source buffer." '(nil (inhibit-same-window . t)))) (next-error n)))) +(defun next-error-this-buffer-no-select (&optional n) + "Move point to the next error in the current buffer and highlight match. +Prefix arg N says how many error messages to move forwards (or +backwards, if negative). +Finds and highlights the source line like \\[next-error], but does not +select the source buffer." + (interactive "p") + (next-error-select-buffer (current-buffer)) + (next-error-no-select n)) + (defun previous-error-no-select (&optional n) "Move point to the previous error in the `next-error' buffer and highlight match. Prefix arg N says how many error messages to move backwards (or @@ -487,6 +497,16 @@ select the source buffer." (interactive "p") (next-error-no-select (- (or n 1)))) +(defun previous-error-this-buffer-no-select (&optional n) + "Move point to the previous error in the current buffer and highlight match. +Prefix arg N says how many error messages to move forwards (or +backwards, if negative). +Finds and highlights the source line like \\[previous-error], but does not +select the source buffer." + (interactive "p") + (next-error-select-buffer (current-buffer)) + (previous-error-no-select n)) + ;; Internal variable for `next-error-follow-mode-post-command-hook'. (defvar next-error-follow-last-line nil)