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

From: "Charl P. Botha" <[email-masked]>
Date: Wed, 21 Dec 2022 12:15:47 +0200

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