emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61691: closed ((wrong-type-argument stringp nil) error when indentin


From: GNU bug Tracking System
Subject: bug#61691: closed ((wrong-type-argument stringp nil) error when indenting some C code in c-ts-mode)
Date: Sun, 26 Feb 2023 11:11:01 +0000

Your message dated Sun, 26 Feb 2023 12:10:24 +0100
with message-id <m1mt50d6n3.fsf@yahoo.es>
and subject line Re: bug#61691: (wrong-type-argument stringp nil) error when 
indenting some C code in c-ts-mode
has caused the debbugs.gnu.org bug report #61691,
regarding (wrong-type-argument stringp nil) error when indenting some C code in 
c-ts-mode
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
61691: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61691
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- 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.

Attachment: 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 ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]