From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: Turning on/off tree-sitter modes Date: Sun, 24 Nov 2024 11:23:08 +0100 Message-ID: <87y1190w37.fsf@gmx.net> References: <8634jnt5e3.fsf@gnu.org> <4864104c-cb23-4356-ad89-2fea111db66c@gutov.dev> <86ttc2rrh8.fsf@gnu.org> <86cyipsp94.fsf@gnu.org> <9cd17f8b-f88c-49f6-9024-0b6d297e18ac@gutov.dev> <867c8xsmri.fsf@gnu.org> <566ac897-ea5e-4141-bcb3-306d43c9118a@gutov.dev> <865xohrvfa.fsf@gnu.org> <86wmgwnyle.fsf@gnu.org> <178dfc7f-bc2d-4e3b-8417-a616ccc0eef3@gutov.dev> <86v7wgnxlz.fsf@gnu.org> <01d83ec8-c02b-4806-8764-38dc89a89125@gutov.dev> <86ttbzojho.fsf@gnu.org> <930f5c8e-1481-43a5-8f1d-2c13a98df74f@gutov.dev> <86r072krq5.fsf@gnu.org> <8b907a41-aa08-4b61-bced-7d4d3fcef4b2@gutov.dev> <87frnhsvp3.fsf@mail.linkov.net> <865xodlr7t.fsf@gnu.org> 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="31914"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Juri Linkov , dmitry@gutov.dev, johan.myreen@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 24 11:23:35 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tF9mA-0008Bm-II for ged-emacs-devel@m.gmane-mx.org; Sun, 24 Nov 2024 11:23:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tF9lu-0004X5-U9; Sun, 24 Nov 2024 05:23:18 -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 1tF9lt-0004Wu-SD for emacs-devel@gnu.org; Sun, 24 Nov 2024 05:23:17 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tF9ls-0000q4-9e; Sun, 24 Nov 2024 05:23:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1732443789; x=1733048589; i=stephen.berman@gmx.net; bh=Fc8a2Y1VT25ApfFzJsbuc4uIA9/ciCM0pqNgLX5/6ck=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=qTXWmjuCjY6Y4gcppyGoq5ZzFgNUh+S9GS6cNDx7b/n9bsOlISpPeQrAOHcQQwW8 LUBXieGXOYFAQ9qoeioD2AH3Rn3FiPbnZEWJsiD2V1jpjiUbMH/rTMWU1YmyWQEy0 BPqZp/FXFi15gZRiSFLhHecXLqAQPjWotKcCTMJAwqhLuYRkZnYaucSvuSTcPxUhR UQuL2HqYTBUNW9SF/FUAiTusSsmZTU6HK0ECLMP5zIIPhqiaf7lszMkARzLQSDYl/ k35tBDCb7BQ4aLbtKRQvHGHDqfmBEAOGC9dZHMV721AlLXqakl5gjpjMYiFff0Yv2 v4oEHHpLyBR2RDc3Xw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([94.134.95.109]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Msq6M-1tYjx71SUS-016pOu; Sun, 24 Nov 2024 11:23:09 +0100 In-Reply-To: <865xodlr7t.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Nov 2024 20:50:30 +0200") X-Provags-ID: V03:K1:MzrE7YDggN49GZOpYBUnCMkVziPpvAuCD1A+nMAaPnD3MPq9TY1 qdtsXGc/e0zteZjH9XlcNOfq6Gr42C/IvSuLHJQBFxSGS4Hw9HxSKdM803z0RQ189xrBeAX KPVPxfONtSuBj9d+f/9D1+l+ADhjCZfK2BQn5MuJcmK/m3i+Zhmez3/ZphIO8n6WTvl5S9R PyEt3wzzv59b2ddrva5/w== UI-OutboundReport: notjunk:1;M01:P0:wy7b4ksHlvw=;2H27KU/iq7tu7m8unDnkJaFlP40 87gMxhluf2oBmHL6OO01AxSeIEvPN/PsWz0cZ/G8IgCEVtKdGshfWqYERHBhscADk2iqRqM9T dUIozMumA3tYlv8BZNGsnoWorbcUQWTHkPbbo/4uIUPSA41mBiVEIAyErt8skHBVkWqmZf4ML hsFbIxjoAerPdmXB1OrDkm8jGJ46MjbRdp4i+4xrLSbwOzaq1LSaz/a7Y71QBoac87/ac2fqn wmCuDRNB72ekXsLOA6n7MgPnR4k6mseJjmAmAyG8JTTJhH2irjbZRBp+McJMpz4L5xlNIOAB+ 1Zg55+w+NFFNvbPOMYWefQ5tDZEJUlGoxeITzz4BkCyr6LYoGl8NCEFTWpT/aZXWECmnyJw4K cTVN/UofwVXTw7rf6vgOtaWIQJC0gb2TWe1U2Pt/KjSNmn8RdgTJGzYkS3hzutzWMudJ+QeAX F4cziFEPMhWYOTx0KtMApJBK31jMSEYdeG3KYBRNdtdkxkFek0Cqg9iusIvHK3SF5KkeBASLS hnjOsssdJEusZUGvSCwbBf1C37gD4JVagBYhIXo1AkZiO822TcsML09xhcZUxbu7BY34p6DZ3 Ruxc+VJwxoXSUymvALPSPfDNYI+cHtoSipAGDRpisgis49feaPMiLAy4ZtL3ogrYW6VaxiRk6 05J2332NtYKZM6uRvjhmzPvj3CsUQXApl0AffpQv6ETHQiEs7GywNTzTGq54yok9stCEf6de7 OwBrovlbbErrqjAVRcVpO6NA2cnYPoqIjD0C/WDZWWFVq+6CyAsZurUxqLaa6KLiMB9q3fJ1 Received-SPF: pass client-ip=212.227.15.19; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325655 Archived-At: On Sat, 23 Nov 2024 20:50:30 +0200 Eli Zaretskii wrote: >> From: Juri Linkov >> Cc: Eli Zaretskii , johan.myreen@gmail.com, emacs-devel@= gnu.org >> Recently Philip rightly noticed that 'major-mode-remap-alist' >> would be sufficient. And indeed, such a command could be implemented >> just as >>=20 >> (defun treesit-add-enabled-mode (non-ts-mode ts-mode) >> (setopt major-mode-remap-alist >> (cons (cons non-ts-mode ts-mode) >> major-mode-remap-alist))) > > But is it okay to have a command modify a user option? Do we have > examples of this anywhere else? One example (admittedly having a much narrower scope than the tree-sitter case) is `todo-top-priorities-overrides' in todo-mode.el. Here's its doc string: List of rules specifying number of top priority items to show. These rules override =E2=80=98todo-top-priorities=E2=80=99 on invocations= of M-x todo-filter-top-priorities and M-x todo-filter-top-priorities-multifile. Each rule is a list of the form (FILE NUM ALIST), where FILE is a member of =E2=80=98todo-files=E2=80=99, NUM is a number specifying the default numb= er of top priority items for each category in that file, and ALIST, when non-nil, consists of conses of a category name in FILE and a number specifying the default number of top priority items in that category, which overrides NUM. =20=20 This variable should be set interactively by M-x todo-set-top-priorities-in-file or M-x todo-set-top-priorities-in-category. Steve Berman