unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21268: 24.4; request: add-several-to-list
@ 2015-08-15 18:26 Michael Hoffman
  2019-08-01 19:59 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Hoffman @ 2015-08-15 18:26 UTC (permalink / raw)
  To: 21268

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.






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#21268: 24.4; request: add-several-to-list
  2015-08-15 18:26 bug#21268: 24.4; request: add-several-to-list Michael Hoffman
@ 2019-08-01 19:59 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-01 19:59 UTC (permalink / raw)
  To: Michael Hoffman; +Cc: 21268

Michael Hoffman <gmane3-hoffman@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-01 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-15 18:26 bug#21268: 24.4; request: add-several-to-list Michael Hoffman
2019-08-01 19:59 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).