From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: On treesit preference for "consumer" modes Date: Sat, 26 Aug 2023 20:14:07 +0300 Message-ID: <83fs45lo9s.fsf@gnu.org> References: <7649A9B7-3697-4CA4-BCBE-BAC7DA814B12@gmail.com> <83il91loqd.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36022"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: jdtsmith@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 26 19:14:24 2023 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 1qZwrg-0009E3-1z for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Aug 2023 19:14:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZwqw-0003LY-76; Sat, 26 Aug 2023 13:13:38 -0400 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 1qZwqu-0003LN-VH for emacs-devel@gnu.org; Sat, 26 Aug 2023 13:13:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZwqu-00044L-Md; Sat, 26 Aug 2023 13:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TM0V9EbnihWHK2AXS+ORLezZI+/mrbElqyk05A0fKaI=; b=UHdTUk9pxX8i lM9ZzX/yMl9wXJfX9d/HlciWrXkB3CD4t+R5ciE3ZyiDoDQN1getP6+oW8Odh2OrBMtTwkOu/cDkr XuMC9eYgZV+m9yqv9yGHN2rjuRyugPLZFqmof/nh6J/4GTUheRh+C2mCmXuY2d0KnR+KfZc8YpJD2 gKKkvfxzxk7DneSHBkAN9WVpNlStMuCf/2MfXN211b0KAzd3/UV6GhZ6acp2suVH4xssfpQtrMNhr o3b22Nb+uRyN5Jk3ErUThHZKh9SueqYOz/E40jqa8XiE4apTgAXM85Ix8gr0zqesrd1ydEjogN8TC 8oV9dvQvpXFLYT9ZdjOQFw==; In-Reply-To: <83il91loqd.fsf@gnu.org> (message from Eli Zaretskii on Sat, 26 Aug 2023 20:04:10 +0300) 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:309265 Archived-At: > Date: Sat, 26 Aug 2023 20:04:10 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > From: JD Smith > > Date: Sat, 26 Aug 2023 12:47:18 -0400 > > > > In the new era of LANG-mode and LANG-ts-mode duality, how should the consumer mode decide which one to use? > > A user option, I think. There's no other reliable way ATM. You could also use telltale signs, if they exist: . if a ts mode is already loaded (featurep test) . if auto-mode-alist defines a ts mode for the relevant files But these cannot be relied upon 100%, because the user might prefer a ts mode, but has not yet loaded it or used it in this session. So a fallback is needed, and that can only be a user option, I think.