--- Begin Message ---
Subject: |
(wrong-type-argument stringp nil) error when indenting some C code in c-ts-mode |
Date: |
Wed, 22 Feb 2023 00:23:37 +0100 |
Tags: patch
Given the following code in c-ts-mode:
int
foo ()
{
int c;
if (!CHAR_VALID_P (c))
/* This is a comment. */
c = 'a';
return c;
}
If point is in line "c = 'a'" and you press TAB, a (wrong-type-argument
stringp nil) error is thrown.
The attached patch fixes the problem by checking the return value of
(treesit-node-field-name node) before passing the result to
string-match-p.
0001-Fix-wrong-argument-error-indenting-C-code-in-c-ts-mo.patch
Description: Text Data
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#61691: (wrong-type-argument stringp nil) error when indenting some C code in c-ts-mode |
Date: |
Sun, 26 Feb 2023 12:10:24 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) |
Version: 29.1
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Wed, 22 Feb 2023 00:23:37 +0100
>> From: Daniel MartÃn via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> Given the following code in c-ts-mode:
>>
>> int
>> foo ()
>> {
>> int c;
>> if (!CHAR_VALID_P (c))
>> /* This is a comment. */
>> c = 'a';
>>
>> return c;
>> }
>>
>> If point is in line "c = 'a'" and you press TAB, a (wrong-type-argument
>> stringp nil) error is thrown.
>
> With today's emacs-29 branch, I cannot reproduce this. Was the
> problem solved meanwhile?
I cannot reproduce the issue anymore in Emacs 29, so I'm closing the bug
report.
--- End Message ---