all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adding a list to the beginning of a list of lists
@ 2022-11-09 21:58 Heime
  2022-11-10 18:15 ` Emanuel Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Heime @ 2022-11-09 21:58 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

Is this a good way to add a list to the beginning of a list of lists

(setq cbchart (cons '("Test" "" "" "") cbchart))




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

* Re: Adding a list to the beginning of a list of lists
  2022-11-09 21:58 Adding a list to the beginning of a list of lists Heime
@ 2022-11-10 18:15 ` Emanuel Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg @ 2022-11-10 18:15 UTC (permalink / raw)
  To: help-gnu-emacs

Heime wrote:

> Is this a good way to add a list to the beginning of a list
> of lists

`push' or the backquote.

Also see `cl-pushnew'.

> (setq cbchart (cons '("Test" "" "" "") cbchart))

C-h f push RET

Examples:

(setq c '(2 (3 4) 5))

(setq c `(1 ,@c))

(push 0 c)

(push '(-3 -2 -1) c)

-- 
underground experts united
https://dataswamp.org/~incal




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

end of thread, other threads:[~2022-11-10 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 21:58 Adding a list to the beginning of a list of lists Heime
2022-11-10 18:15 ` Emanuel Berg

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.