all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Tassilo Horn <tsdh@gnu.org>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Add/remove an element into/from a cons.
Date: Tue, 26 Oct 2021 14:39:51 +0800	[thread overview]
Message-ID: <CAGP6PO+6rxN=AkjOXXp-4oD_VRj7qOx46GxrcXfQ=kQKC_S7+w@mail.gmail.com> (raw)
In-Reply-To: <87wnm0papx.fsf@gnu.org>

On Tue, Oct 26, 2021 at 2:21 PM Tassilo Horn <tsdh@gnu.org> wrote:
>
> 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...

The default value is set this way, as I've posted:

(setq company-backends '((company-tabnine :separate company-dabbrev
company-keywords company-files company-ispell company-capf)))

>     (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



  parent reply	other threads:[~2021-10-26  6:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  2:05 Add/remove an element into/from a cons Hongyi Zhao
2021-10-26  4:57 ` Tassilo Horn
2021-10-26  5:40   ` Hongyi Zhao
2021-10-26  5:42     ` Hongyi Zhao
2021-10-26  6:07       ` Hongyi Zhao
2021-10-26  6:18         ` Tassilo Horn
2021-10-26  6:30           ` Hongyi Zhao
2021-10-26  6:39           ` Hongyi Zhao [this message]
2021-10-26  6:08       ` Tassilo Horn
2021-10-26  6:17         ` Hongyi Zhao
2021-10-26  6:22           ` Tassilo Horn
2021-10-26  8:12             ` Hongyi Zhao
2021-10-26  8:15               ` Tassilo Horn
2021-10-26  9:26                 ` Hongyi Zhao
2021-10-26  9:31                   ` Hongyi Zhao
2021-10-26 18:56                   ` Tassilo Horn
2021-10-27  1:39                     ` Hongyi Zhao
2021-10-27  4:54                       ` Hongyi Zhao
2021-10-27  5:13                         ` Hongyi Zhao
2021-10-27 18:43                         ` Tassilo Horn
2021-10-28  4:14                           ` Hongyi Zhao
2021-10-28  4:36                             ` Hongyi Zhao
2021-10-28  5:40                             ` Hongyi Zhao
2021-10-26 12:36                 ` Stefan Monnier
2021-10-26 13:41                   ` Hongyi Zhao
2021-10-26  6:22           ` Hongyi Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGP6PO+6rxN=AkjOXXp-4oD_VRj7qOx46GxrcXfQ=kQKC_S7+w@mail.gmail.com' \
    --to=hongyi.zhao@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.