magit-todos
magit-todos copied to clipboard
Fix Error with regexp Stack Overflows
Hi, I kept getting error in process sentinel: Wrong type argument: magit-todos-item, t
whenever I opened the magit status buffer for a file in the https://github.com/github/linguist repo.
I found that when a stack overflow occurred during regexp matching (display-warning 'magit-todos (concat "File has lines too long for Emacs to search. Consider excluding it from scans: " filename))
was returning t
, which was causing the enclosing --when-let
to treat the t
as a todo item and add it to the list of todo items, which caused the above error when writing it to a buffer.
AFAICS the doc for display-warning
doesn't say anything about its return value ((display-warning 'foo "foo")
returns t
:shrug:), so for surety this PR just adds nil
to the next line.
I can reproduce it with minimal config using the following:
-
git clone https://github.com/github/linguist
(though I think any repo with an uber line will do, e.g. this file is the culprit in that repo: https://github.com/github/linguist/blob/master/test/fixtures/Data/bootstrap.css.map) -
./makem.sh interactive
-
magit-todos-mode
,magit
- Open any file in the repo, wait a bit
Thanks!
Thanks. I'll try to merge this soon.
Great, no rush :slightly_smiling_face:
Thanks. I'll try to merge this soon.
I have the same problem.
@LaurenceWarne Thanks for your patience.
@b40yd Thanks for reminding me.