From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Changing company-mode settings while still running emacs Date: Wed, 11 Dec 2024 11:28:40 +0000 Message-ID: <7ScaWnsN7LxWEzAMgHpn61X5Banhsg3FSWB214hzmmd62clELxffrQqK9tPWcepVOeJzVQQ573F9nj9CQgpNbym6Hex1zvC5XfLWTcN8wg4=@protonmail.com> References: <0b9e06eb-05a7-44e7-b23b-2c32b0bbd950@gutov.dev> Reply-To: Heime Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33671"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Dmitry Gutov Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 11 12:29:23 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tLKuA-0008Ty-En for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 12:29:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLKtd-0002kw-Pd; Wed, 11 Dec 2024 06:28:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLKtb-0002kW-Qp for help-gnu-emacs@gnu.org; Wed, 11 Dec 2024 06:28:48 -0500 Original-Received: from mail-4319.protonmail.ch ([185.70.43.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLKta-00080z-5F for help-gnu-emacs@gnu.org; Wed, 11 Dec 2024 06:28:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1733916524; x=1734175724; bh=1PKeYeII/O0Zgevr2ZbD2tYnLRIDbwjhirta34dQ+ps=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=AbUiuXe4sanPITrFmUbGvI8pUo/82K5a01lVgq1swYIU0ROvSyg03Vv52dKsJMT68 +Lk3NJjjSOvyafs9Oe19S3wSdYWruWw1JPgs1wQ9vuXAQZfAZxBD4HY7hIeuL99swX S/RtfzSfYH66wd4hweVJ5Tr6jwiSAiDfcblGbbSRrmjqDIQQn0JL1OiGGb0/JSmvEx rYdogghAR7Nf4BFD1nekj4KuGWSxAbOdqPWbTwtN0mm6juJNmoUOytiL38RdIqaGnV F/9tGqsLB/mXOaUhV1jHz61+aTjryaHG1WtulCIUMuzl2GVvsOniFdJJjcr44V0g0N UW9N6sVdn6DNg== In-Reply-To: <0b9e06eb-05a7-44e7-b23b-2c32b0bbd950@gutov.dev> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: c5eca32f2d1ed4fac2e72a3e010744173ba0a030 Received-SPF: pass client-ip=185.70.43.19; envelope-from=heimeborgia@protonmail.com; helo=mail-4319.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148755 Archived-At: Sent with Proton Mail secure email. On Wednesday, December 11th, 2024 at 2:08 PM, Dmitry Gutov wrote: > On 10/12/2024 15:42, Heime via Users list for the GNU Emacs text editor > wrote: >=20 > > I would like the ability to change company-backends and other company > > variable and apply them globally while still running emacs. >=20 >=20 > M-x customize-variable >=20 > usually helps - like with most other options in Emacs (it has a "save" > button). >=20 > 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=20 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)) )