GNU bug report logs - #75170
add-to-alist: new function

Previous Next

Package: emacs;

Reported by: Roland Winkler <winkler <at> gnu.org>

Date: Sun, 29 Dec 2024 05:35:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Roland Winkler <winkler <at> gnu.org>
To: Thierry Volpiatto <thievol <at> posteo.net>
Cc: 75170 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, Andrea Corallo <acorallo <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>
Subject: bug#75170: add-to-alist: new function
Date: Sun, 19 Jan 2025 15:21:38 -0600
On Sun, Jan 19 2025, Thierry Volpiatto wrote:
> While you are at it why not implementing a add-to-(a)list function that
> add/remove an elemnt at INDEX in list?
> It is what I am providing for my users in Helm.
>
> (setq example '((a . 1) (b . 6) (c . 3) (d . 4)))
>
> (helm-add-to-list 'example '(b . 2) 1 'replace)
>
> =>((a . 1) (b . 2) (c . 3) (d . 4))

I am just curious: when can this be useful?  Off my head, I cannot think
of any alists (alists that users my want to modify in their init file)
where order matters.




This bug report was last modified 142 days ago.

Previous Next


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