grep-last-buffer
grep-last-buffer is a variable defined in `grep.el
'.
Its value is nilDocumentation: The most recent grep buffer. A grep buffer becomes most recent when you select Grep mode in it. Notice that using C-x ` or M-x compile-goto-error modifies `compilation-last-buffer' rather than `grep-last-buffer'.