>> Since we removed the rule of visibility of next-error-function buffers >> as a criteria for deciding what navigation to use for next-error, >> so e.g. next-error in *Occur* or *Diff* that is the current buffer >> and a single visible buffer on the frame will still use the last next-error >> buffer that might be e.g. *compilation* or *grep* buffer buried long ago, >> now we need to support the same way to switch next-error navigation as >> already is possible in *compilation* and *grep* by typing RET or ‘C-c C-c’ >> that sets next-error-last-buffer in next-error-internal among other things. > > Sorry, I don't understand what kind of solution are you proposing in > user terms. Can you please describe what the user should do under the > proposed solution in various cases, such as if they need to invoke > navigation in the current Occur buffer or in a Compilation/Grep > buffer, either shown or not shown? I propose to set the global value of next-error-last-buffer after typing one of the following keybindings in the corresponding buffers: in *xref* xref-goto-xref: RET in *Diff* diff-goto-source: RET, C-c C-c, o in ChangeLogs change-log-goto-source: C-c C-c in *Occur* occur-mode-goto-occurrence: RET, C-c C-c, occur-mode-goto-occurrence-other-window: o occur-mode-display-occurrence: C-o IOW, doing the same what RET and C-c C-c in *compilation* and *grep* already do. Here is the final tested patch with these changes: