Subject: bug#77732: grep-edit-buffer errors with incionsistent behaviour

From: Visuwesh <[email-masked]>
Date: Fri, 11 Apr 2025 16:07:54 +0530

[வெள்ளி ஏப்ரல் 11, 2025] Johann Höchtl wrote:

> I am using Emacs from HEAD on Windows
>
> I tried to reproduce the behaviour with emacs -Q but it still remains
> inconsistent.
>
> When I rgrep and there are few results (< 15) , I can enter grep buffer
> pres 'e' to enter grep-edit mode, get out of it with C-c C-c, re-enter with
> 'e' and so on.
>
> When there are more results, (between 15 and 70)  I still can enter with
> 'e' get out with C-c C-c but when I try to re-enter I get the error message
> Wrong type argument: stringp, nil
> The buffer later although still in grp-mode does not behave any longer as a
> grep mode, 'g' or 'e' results in the error Buffer is read only : #<buffer
> *grep*>
>
> When there are many results, I get the error message Wrong type argument:
> stringp, nil already on the first invocation attempt.
>
> Thew boundaries are somewhat moving but at least I have the feeling the
> more matches are, the more frequently I run into the
>
> Wrong type argument: stringp, nil
>
> already at first try.

Can you please share the backtrace?  Say M-x toggle-debug-on-error RET
before trying to reproduce the error above.  I mostly tested
grep-edit-mode with M-x rgrep, and a good amount of results.