From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Add/remove an element into/from a cons. Date: Tue, 26 Oct 2021 06:57:08 +0200 Message-ID: <875ytkqt4x.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14681"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.4; emacs 29.0.50 Cc: help-gnu-emacs@gnu.org To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 26 06:59:18 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mfEYQ-0003c2-AZ for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 06:59:18 +0200 Original-Received: from localhost ([::1]:48224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfEYN-0000VC-SR for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 00:59:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfEXq-0000Uo-8A for help-gnu-emacs@gnu.org; Tue, 26 Oct 2021 00:58:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfEXp-00021D-Vh; Tue, 26 Oct 2021 00:58:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=kDd8GejPho9HXOxGSamzJMKmYxwNibOeq+zHNpPE2tA=; b=dqCup1WWrz8HJB IuJIAwklL/encvNbO+zbAO3SD7JR1pr38YSY5naqw9WTjOPTAlM4G/mlv3rx2q5M2uR8tVygoAaZF Z/nhZoDTP/JDQPw5q4QMwfogTvDuCKM1g/4TpiaNfPB/eO+iALE4EDHpcljX1d3CyRLJcKznoNtHK WWeGETe5ccHqXRXyA0oh66iNiilg/F8DQb1DzJjWLaIt6v2619LXoaAiH44awd2AhdtpyHuPnCe6+ PTr2K5x9tJXrxmfK0xruCwqGaMFz72Kuga96xxGtPf3iFBCdDtSpeub55vGIbYrYvJWavl8A/WzHH g03QuaX3iZVYaKItlc0Q==; Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:41977) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfEXp-0005y2-NU; Tue, 26 Oct 2021 00:58:41 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 05A2B27C0054; Tue, 26 Oct 2021 00:58:40 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 26 Oct 2021 00:58:41 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefiedgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepve evieekteekveeigfefffeivdetgeduvdffueeuudevgedttdehvdfhueevfffhnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Oct 2021 00:58:39 -0400 (EDT) In-reply-to: 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134173 Archived-At: Hongyi Zhao writes: > How can I add/remove an element into/from a cons, taking the following > one as an example: > > ```emacs-lisp > (setq company-backends '((company-tabnine :separate company-capf > company-dabbrev company-keywords company-files company-ispell))) > ``` > > How can I remove `company-ispell` from and re-add it into the > company-backends defined above? You can use `setf' with the place being the alist entry like this (company-backends replaced with th/test in my example): --8<---------------cut here---------------start------------->8--- (setq th/test '(( company-tabnine :separate company-capf company-dabbrev company-keywords company-files company-ispell))) (let ((place (assoc 'company-tabnine th/test))) (setf place (remove 'company-ispell place))) --8<---------------cut here---------------end--------------->8--- HTH, Tassilo