From: "e190@163.com" <e190@163.com>
To: casouri <casouri@gmail.com>, "Eli Zaretskii" <eliz@gnu.org>
Cc: 60296 <60296@debbugs.gnu.org>
Subject: bug#60296: Re: bug#60296: The imenu is not created properly in c-ts-mode
Date: Mon, 26 Dec 2022 15:58:47 +0800 [thread overview]
Message-ID: <2022122615584707191012@163.com> (raw)
In-Reply-To: <202212241731446537597@163.com>
[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]
>> On Dec 24, 2022, at 10:53 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>
>>> Cc: 60296-done@debbugs.gnu.org
>>> From: Yuan Fu <casouri@gmail.com>
>>> Date: Sat, 24 Dec 2022 19:00:21 -0800
>>>
>>>> From: sniper <e190@163.com>
>>>> To: bug-gnu-emacs@gnu.org
>>>> Subject: 29.0.60; The imenu is not created properly in c-ts-mode.
>>>>
>>>> ``` c
>>>> char *test(int size){
>>>> return NULL;
>>>> }
>>>> ```
>>>> If c-ts-mode is enabled in a c file, the imenu created will be [` test(int size)`] if the return type of the function is a
>>>> pointer.
>>>> The expected display should just be the function name [` test `], with no subsequent arguments
>>>
>>> Thanks, this should be fixed now.
>>
>> This change leads to
>>
>> In c-ts-mode--fontify-declarator:
>> progmodes/c-ts-mode.el:405:69: Warning: Unused lexical argument `args'
>>
>> And "&rest args" is indeed unused there, AFAICT.
>My bad. I’ve fixed that by changing args to _.
Hi, Yuan:
I tested it in the latest version and found several more issues.
``` c
int main(int argc, char *argv[])
{
.....
struct name_t name = (struct name_t)name;
name.a = sizeof(struct name_t);
.....
}
```
If Forced conversion or ` sizeof(struct name_t) ` occurs in a function, it will occur in the Struct entry of imenu.
``` c
int func_1(int v); // <-- function declaration
int main(int argc, char *argv[])
{
}
```
If there is a function declaration in the c file, it will also appear in imenu's Variable entry.
e190@163.com
From: Yuan Fu
Date: 2022-12-25 16:31
To: Eli Zaretskii
CC: 60296; e190
Subject: Re: bug#60296: The imenu is not created properly in c-ts-mode
> On Dec 24, 2022, at 10:53 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> Cc: 60296-done@debbugs.gnu.org
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Sat, 24 Dec 2022 19:00:21 -0800
>>
>>> From: sniper <e190@163.com>
>>> To: bug-gnu-emacs@gnu.org
>>> Subject: 29.0.60; The imenu is not created properly in c-ts-mode.
>>>
>>> ``` c
>>> char *test(int size){
>>> return NULL;
>>> }
>>> ```
>>> If c-ts-mode is enabled in a c file, the imenu created will be [` test(int size)`] if the return type of the function is a
>>> pointer.
>>> The expected display should just be the function name [` test `], with no subsequent arguments
>>
>> Thanks, this should be fixed now.
>
> This change leads to
>
> In c-ts-mode--fontify-declarator:
> progmodes/c-ts-mode.el:405:69: Warning: Unused lexical argument `args'
>
> And "&rest args" is indeed unused there, AFAICT.
My bad. I’ve fixed that by changing args to _.
Yuan
[-- Attachment #2: Type: text/html, Size: 8055 bytes --]
next prev parent reply other threads:[~2022-12-26 7:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-24 9:31 bug#60296: The imenu is not created properly in c-ts-mode e190
2022-12-25 3:00 ` Yuan Fu
2022-12-25 6:53 ` Eli Zaretskii
2022-12-25 8:31 ` Yuan Fu
2022-12-26 7:58 ` e190 [this message]
2022-12-26 9:47 ` Yuan Fu
2022-12-27 10:03 ` bug#60296: " e190
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2022122615584707191012@163.com \
--to=e190@163.com \
--cc=60296@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).