Subject: Re: bug#77809: adding next-error support for flymake diagnostics buffers

From: Spencer Baugh <[email-masked]>
Date: Wed, 16 Apr 2025 13:42:21 -0400

[email-masked] writes:

> Spencer Baugh <[email-masked]> writes:
>>>>                   (funcall visit bbeg bend)))))
>>>> +      (setq next-error-buffer diagnostics-buffer
>>>> +            next-error-last-buffer diagnostics-buffer)
>>
>> Setting next-error-last-buffer makes sense and matches other buffers
>> which set next-error-function (e.g. xref-goto-xref), but do we need to
>> set next-error-buffer?  It seems like setting that is managed by
>> next-error itself.
>
> I think you're right.  That should be removed.

OK, make sure to include that in the next version of the patch, if one
is needed.

>>>>  (define-derived-mode flymake-diagnostics-buffer-mode tabulated-list-mode
>>>>    "Flymake diagnostics"
>>>>    "A mode for listing Flymake diagnostics."
>>>> @@ -2015,6 +2040,9 @@ flymake-diagnostics-buffer-mode
>>>>    (setq tabulated-list-format flymake--diagnostics-base-tabulated-list-format)
>>>>    (setq tabulated-list-entries
>>>>          'flymake--diagnostics-buffer-entries)
>>>> +
>>>> +  (setq-local next-error-function #'flymake--diagnostics-next-error)
>>>> +
>>
>> This should be set in the major mode initialization (the body of the
>> define-derived-mode).
>
> It is set in the body of the define-derived-mode.
>
>>>> @@ -2085,6 +2114,9 @@ flymake-project-diagnostics-mode
>>>>    (setq tabulated-list-format
>>>>          (vconcat [("File" 25 t)]
>>>>                   flymake--diagnostics-base-tabulated-list-format))
>>>> +
>>>> +  (setq-local next-error-function #'flymake--diagnostics-next-error)
>>>> +
>>
>> Likewise, this should be set in the major mode initialization (the body
>> of the define-derived-mode).

Oh, my mistake, sorry.

This looks good to me then, seems to work fine.  Let's wait a few more
days for comments and then I think this can be installed.