From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: Changing company-mode settings while still running emacs Date: Thu, 12 Dec 2024 04:32:31 +0200 Message-ID: <855dc0d0-dea9-4ef7-a25f-273823268704@gutov.dev> References: <0b9e06eb-05a7-44e7-b23b-2c32b0bbd950@gutov.dev> <7ScaWnsN7LxWEzAMgHpn61X5Banhsg3FSWB214hzmmd62clELxffrQqK9tPWcepVOeJzVQQ573F9nj9CQgpNbym6Hex1zvC5XfLWTcN8wg4=@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36168"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 12 03:33:24 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 1tLZ11-0009CN-NJ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 12 Dec 2024 03:33:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLZ0M-0006gQ-DL; Wed, 11 Dec 2024 21:32:42 -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 1tLZ0K-0006g7-36 for help-gnu-emacs@gnu.org; Wed, 11 Dec 2024 21:32:40 -0500 Original-Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLZ0H-0006gA-MR for help-gnu-emacs@gnu.org; Wed, 11 Dec 2024 21:32:39 -0500 Original-Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id 91A7A11402C7; Wed, 11 Dec 2024 21:32:34 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Wed, 11 Dec 2024 21:32:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1733970754; x=1734057154; bh=OGPyhj6UNpKSHOYtiVSh3rq5Tu258VvTYxzBtD03ZSc=; b= ZqbYWxixFMHHnC6tZFelTjwyroT9a20TS7woO95yXiw8DHqxsrvSFvmR7wVCMdLe zdYDkX5ZcsR0HCp6l5EFCBr86uICDXZHmM0eF6Cm6EUsgWF6tuwVQCRgCLlX0scC Ulf+kDi6dQz+CfUi98irI/OnVqCkSexNzHx+5zofyMMKBH/DIx1XZaDsqh2nw87A MPUUDxRZXr8AN+BBTzEc/31Cj9/qJtlgCfOUJ8lSV7OIxIBAOnQLqrZJpBn8k+v9 FqWkbPQM9mfmAtRldCMgt+nPfgDYma09ag/2bj0Obe8sqIcL7EqizJf8nhgzUr5e JEXLK8wzS/YsG1P+lAaPmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1733970754; x= 1734057154; bh=OGPyhj6UNpKSHOYtiVSh3rq5Tu258VvTYxzBtD03ZSc=; b=C p3pPXvVsBHabvmfY5NaGh6w3GJm9ttt6V70sum/Zi3Z6gzp+C66IIzSNXUSuIzMy P+xkBqb4OeOiisWNwyezaPSPmgMMDBZ9uBwHuP3A61rsn6M/XJ5sVlccg/vhteY0 RWurFZJPhJwbfs9Kb/1fFmI5CaRScNDioNwWp1M7yOQHnfb2q8Og2WZaduDTDON0 yqIBefBt8bhJ8+9/yMB9claNTtg+n+7T8Pn2cL0cnpVWESnep5wqm8Hh/Hb7exwx aexYjjaGOKNXlPRzy7zq4zn/GrCOIPbVKBTpgRjxZAPNMunWQ2tJYGZNaY8CQPlY qRHIU5VvwDJu+1EgTvyFw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkedvgddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedt vddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep vddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohephhgvihhmvggsohhrghhirgesph hrohhtohhnmhgrihhlrdgtohhmpdhrtghpthhtohephhgvlhhpqdhgnhhuqdgvmhgrtghs sehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Dec 2024 21:32:33 -0500 (EST) Content-Language: en-US In-Reply-To: <7ScaWnsN7LxWEzAMgHpn61X5Banhsg3FSWB214hzmmd62clELxffrQqK9tPWcepVOeJzVQQ573F9nj9CQgpNbym6Hex1zvC5XfLWTcN8wg4=@protonmail.com> Received-SPF: pass client-ip=202.12.124.145; envelope-from=dmitry@gutov.dev; helo=fout-b2-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 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:148764 Archived-At: On 11/12/2024 13:28, Heime wrote: > 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)) ) No need to re-enable the mode to have the new value picked up. As long as there's no buffer-local value (set up by yourself or your "distribution" such as Doom or Spacemacs), that should work right away, at least if there is no current completion session (to simplify, no popup visible).