map)
"Keymap for `flymake-mode'.")
+(defvar-local flymake-current-diagnostic-pos nil)
+
;;;###autoload
(define-minor-mode flymake-mode
"Toggle Flymake mode on or off.
("Origin" 8 t)
("Message" 0 t)])
+(defun flymake--diagnostics-next-error (n &optional reset)
+ "`next-error-function' for flymake diagnostics buffers.
+N is an integer representing how many errors to move.
+If RESET is non-nil, return to the beginning of the errors before
+moving."
+ (flymake-diagnostics-buffer-goto-diagnostic
+ (save-excursion
+ (goto-char (if (or reset (not flymake-current-diagnostic-pos))
+ (point-min)
+ flymake-current-diagnostic-pos))
+ (forward-line n)
+ (setq flymake-current-diagnostic-pos (point)))))
+
(define-derived-mode flymake-diagnostics-buffer-mode tabulated-list-mode
"Flymake diagnostics"
"A mode for listing Flymake diagnostics."
:interactive nil
- (setq tabulated-list-format flymake--diagnostics-base-tabulated-list-format)
- (setq tabulated-list-entries
- 'flymake--diagnostics-buffer-entries)
+ (setq tabulated-list-format flymake--diagnostics-base-tabulated-list-format
+ tabulated-list-entries 'flymake--diagnostics-buffer-entries)
+ (setq-local next-error-function #'flymake--diagnostics-next-error)
(tabulated-list-init-header))
(defun flymake--diagnostics-buffer-name (&optional buffer)
(setq tabulated-list-format
(vconcat [("File" 25 t)]
flymake--diagnostics-base-tabulated-list-format))
- (setq tabulated-list-entries
- 'flymake--project-diagnostics-entries)
+ (setq tabulated-list-entries 'flymake--project-diagnostics-entries)
+ (setq-local next-error-function #'flymake--diagnostics-next-error)
(tabulated-list-init-header))
(cl-defun flymake--project-diagnostics (&optional (project (project-current)))