[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add/remove an element into/from a cons.
From: |
Tassilo Horn |
Subject: |
Re: Add/remove an element into/from a cons. |
Date: |
Tue, 26 Oct 2021 06:57:08 +0200 |
User-agent: |
mu4e 1.7.4; emacs 29.0.50 |
Hongyi Zhao <hongyi.zhao@gmail.com> 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
- Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/25
- Re: Add/remove an element into/from a cons.,
Tassilo Horn <=
- Re: Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/26
- Re: Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/26
- Re: Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/26
- Re: Add/remove an element into/from a cons., Tassilo Horn, 2021/10/26
- Re: Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/26
- Re: Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/26
- Re: Add/remove an element into/from a cons., Tassilo Horn, 2021/10/26
- Re: Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/26
- Re: Add/remove an element into/from a cons., Hongyi Zhao, 2021/10/26
- Re: Add/remove an element into/from a cons., Tassilo Horn, 2021/10/26