From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.help Subject: Re: Replace element in list Date: Mon, 2 Sep 2019 13:05:50 +0200 Message-ID: <20190902110550.GF1466@tuxteam.de> References: <6a632b18-bbd6-7096-229d-6c890b6bdb6f@easy-emacs.de> <20190902103723.GC1466@tuxteam.de> <20190902104107.GD1466@tuxteam.de> <20190902104635.GE1466@tuxteam.de> <87ef0z7yfa.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SnV5plBeK2Ge1I9g" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="81103"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 02 13:06:30 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i4kAH-000KuC-SY for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Sep 2019 13:06:29 +0200 Original-Received: from localhost ([::1]:35124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4kAG-00082e-7C for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Sep 2019 07:06:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60484) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4k9q-00081x-CO for help-gnu-emacs@gnu.org; Mon, 02 Sep 2019 07:06:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4k9m-0000TY-NG for help-gnu-emacs@gnu.org; Mon, 02 Sep 2019 07:06:02 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:40598) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4k9h-0000O6-50 for help-gnu-emacs@gnu.org; Mon, 02 Sep 2019 07:05:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=B6gtcRmr7C7bCgfqihDG09XFcGlUTh8hBnHq5LfjnA0=; b=UQ3BivJmF8WKB+JIeesi/7UMx81JE6JTOTFTA8rWe4obYdID13ignIbtn0uLQ0jNmoVT5Rn+ZjMF0M9eFSfxpuZHEt30GgkeXSWVp40NUT4qQF+4+QCf6qA7s5FFRUIizeuf2sq/99mbV4p4nYgkv6HtYRto62BCDwHCZuLdgVUcSTzR2mrhrBNVdq2d7Rbbut69hVgCbbtxTPMTWuNFN1YmF077P+f3FBuABAYL6ddxcRcmd7xWVpRpAQjFDeKaUY5tNCXNbzG5l7SxzatMEXk8rY1i1EDDA5glgxyvUECzS5bpeTNcAcJy/AchTHO0uonLB8EQHQAa/UMuVUkRag==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1i4k9e-0002Th-7p; Mon, 02 Sep 2019 13:05:50 +0200 Content-Disposition: inline In-Reply-To: <87ef0z7yfa.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121414 Archived-At: --SnV5plBeK2Ge1I9g Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 02, 2019 at 01:03:21PM +0200, Michael Heerdegen wrote: > tomas@tuxteam.de writes: >=20 > > In Emacs Lisp you could try: > > > > (setcar (nthcdr 3 foo) 'mud) >=20 > Another way to write that is >=20 > (setf (nth 3 foo) 'mud) Yes, much nicer. I always forget about setf. Thanks for the reminder! Cheers -- tom=C3=A1s --SnV5plBeK2Ge1I9g Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl1s944ACgkQBcgs9XrR2kat8QCeKVCHPfc0+KEtYDKnWBYql0rz +usAnRg/yjMgCwTAtCaPmUq2yYvycSD5 =WV87 -----END PGP SIGNATURE----- --SnV5plBeK2Ge1I9g--