GNU bug report logs - #21268
24.4; request: add-several-to-list

Previous Next

Package: emacs;

Reported by: Michael Hoffman <gmane3-hoffman <at> sneakemail.com>

Date: Sat, 15 Aug 2015 19:02:01 UTC

Severity: wishlist

Tags: wontfix

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Hoffman <gmane3-hoffman <at> sneakemail.com>
Cc: 21268 <at> debbugs.gnu.org
Subject: bug#21268: 24.4; request: add-several-to-list
Date: Thu, 01 Aug 2019 21:59:18 +0200
Michael Hoffman <gmane3-hoffman <at> sneakemail.com> writes:

> I would like to request the following function be added to subr.el:
>
> (defun add-several-to-list (list-var &rest elements)
>   "Add to LIST-VAR all ELEMENTS."
>   (dolist (element (reverse elements))
>     (add-to-list list-var element)))
>
> This is useful in adding many items to configuration variables without
> duplication, while keeping the same order, and avoiding repeated calls
> to add-to-list.

I think this seems like a too specialised function to be generally
useful.  And it's about the same thing as

(cl-delete-duplicates (append old new))

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 6 years and 22 days ago.

Previous Next


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