[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 08:18:44 +0200 |
User-agent: |
mu4e 1.7.4; emacs 29.0.50 |
Hongyi Zhao <hongyi.zhao@gmail.com> writes:
> (defun my-scratch-init ()
> (with-current-buffer "*scratch*"
> (setq-local company-backends (let ((place (assoc 'company-tabnine
> company-backends)))
> (setf place (remove 'company-ispell place))))
> ))
setf returns the new value, so here you are setting company-backends to
the modified alist entry, not the alist itself. This should work:
--8<---------------cut here---------------start------------->8---
(defun my-scratch-init ()
(with-current-buffer "*scratch*"
;; Ensure it has a local variable. Not sure if it has by default...
(make-local-variable 'company-backends)
(let ((place (assoc 'company-tabnine company-backends)))
(setf place (remove 'company-ispell place)))))
--8<---------------cut here---------------end--------------->8---
Bye,
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, 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., 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