Subject: Re: bug#75170: add-to-alist: new function

From: Roland Winkler <[email-masked]>
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.