[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing company-mode settings while still running emacs
From: |
Heime |
Subject: |
Re: Changing company-mode settings while still running emacs |
Date: |
Wed, 11 Dec 2024 11:28:40 +0000 |
Sent with Proton Mail secure email.
On Wednesday, December 11th, 2024 at 2:08 PM, Dmitry Gutov <dmitry@gutov.dev>
wrote:
> On 10/12/2024 15:42, Heime via Users list for the GNU Emacs text editor
> wrote:
>
> > I would like the ability to change company-backends and other company
> > variable and apply them globally while still running emacs.
>
>
> M-x customize-variable
>
> usually helps - like with most other options in Emacs (it has a "save"
> button).
>
> Or you can manipulate those values using Lisp. I'm guessing you're not
> at that level (hence the question), so the Customize interface should be
> the easier option.
I want to do it with lisp. Have made this interactive function to
set up the company-backends, but instead of applying the changes
locally, I want to apply them globally.
(defun companiol-backends-kntlr (actm-seqr)
(interactive
(let* ( (cseq '("company-dabbrev"
"company-dabbrev-code"
"company-keywords"
"company-capf"
"company-yasnippet"
"company-files"))
(backends-seltr
(completing-read-multiple "Backends: " cseq nil t)))
(list (mapcar #'intern backends-seltr))))
(setq company-backends actm-seqr)
;; Refresh company-mode to apply the changes
(when (bound-and-true-p company-mode)
(company-mode -1) (company-mode 1)) )