unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Changing company-mode settings while still running emacs
Date: Wed, 11 Dec 2024 11:28:40 +0000	[thread overview]
Message-ID: <7ScaWnsN7LxWEzAMgHpn61X5Banhsg3FSWB214hzmmd62clELxffrQqK9tPWcepVOeJzVQQ573F9nj9CQgpNbym6Hex1zvC5XfLWTcN8wg4=@protonmail.com> (raw)
In-Reply-To: <0b9e06eb-05a7-44e7-b23b-2c32b0bbd950@gutov.dev>






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




  reply	other threads:[~2024-12-11 11:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 13:42 Changing company-mode settings while still running emacs Heime via Users list for the GNU Emacs text editor
2024-12-11  2:08 ` Dmitry Gutov
2024-12-11 11:28   ` Heime via Users list for the GNU Emacs text editor [this message]
2024-12-12  2:32     ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='7ScaWnsN7LxWEzAMgHpn61X5Banhsg3FSWB214hzmmd62clELxffrQqK9tPWcepVOeJzVQQ573F9nj9CQgpNbym6Hex1zvC5XfLWTcN8wg4=@protonmail.com' \
    --to=help-gnu-emacs@gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=heimeborgia@protonmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).