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

Previous Next

Package: emacs;

Reported by: "Charl P. Botha" <cpbotha <at> vxlabs.com>

Date: Sat, 10 Dec 2022 17:46:03 UTC

Severity: normal

Tags: patch

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Charl P. Botha" <cpbotha <at> vxlabs.com>
To: "Yuan Fu" <casouri <at> gmail.com>
Cc: 59945 <at> debbugs.gnu.org
Subject: bug#59945: [PATCH] Fix empty pairs in js tree-sitter imenu alist
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




This bug report was last modified 2 years and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.