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

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

bug#59945: [PATCH] Fix empty pairs in js tree-sitter imenu alist


From: Charl P. Botha
Subject: bug#59945: [PATCH] Fix empty pairs in js tree-sitter imenu alist
Date: Wed, 21 Dec 2022 12:15:47 +0200
User-agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730

Dear Yuan,

On Wed, Dec 21, 2022, at 06:48, Yuan Fu wrote:
> Thanks! I applied your patch. I made a little change to it so it’s more
> idiomatic.
>
> Elisp tip of the day: if you want to make a list of possibly nil objects
> and don’t want nil’s in the list, you can use append. Basically change
>
> (list a b c)
>
> to
>
> (append (and xxx (list a)) (and yyy (list b)) (and zzz (list c)))
>
> If the condition aren’t met, eg, (and xxx (list a)) returns nil, append
> just appends an empty list.

Thank you very much for taking care of this, and thank you for your emacs-lisp 
improvement and tip. On that day, I searched for but was not able to find a 
better formulation than my klunky one.

Kind regards,
Charl





reply via email to

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