From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Need for "-ts-mode" modes Date: Thu, 29 Dec 2022 11:27:41 -0800 Message-ID: <279658FD-ABF9-4127-A646-038C60A79EA1@gmail.com> References: <877cyagmti.fsf@posteo.net> <831qoi85u7.fsf@gnu.org> <87mt76f4n4.fsf@posteo.net> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="36128"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 29 20:28:29 2022 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 1pAyZp-0009DO-Kb for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Dec 2022 20:28:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAyZH-0000z7-HU; Thu, 29 Dec 2022 14:27:55 -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 1pAyZD-0000yq-6g for emacs-devel@gnu.org; Thu, 29 Dec 2022 14:27:51 -0500 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAyZA-0003fZ-MN; Thu, 29 Dec 2022 14:27:50 -0500 Original-Received: by mail-pj1-x102f.google.com with SMTP id o31-20020a17090a0a2200b00223fedffb30so19741583pjo.3; Thu, 29 Dec 2022 11:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=t6g5kMk3bbOQJLzZC5XJkJXoY3ZIoVvTyEewNsNgj40=; b=RNmaTlQ9YcLeLKEX+6jz5UsxmBk2T5EWicANlxcQqGZwD/fS9KIqja3m2guSNPBqJG W1WNzq2r/x3oEytISlrM97dmSzNgXDR7eqONHJrWhHlPSpyHUwnJV69aDMzQpyHIz/rZ ARkrrhCXf8LBaqF2J/gC+8gNO18OFrIeA+7xPq/KHLkNFZq6w3yLY+YJpy1/TAPn529F uS3sO/iQjWtEaeUA5qULN+Nj2stUFW5cf3ee27Mm1D/I9S2Ifr0yTwvuC5FvXQLavRku bia3Y5kTADdSTiUjeTGd9QNq+25fIrumpP26OkhVqZNuuhTJqgneQvZYUXid3iKyLx36 jhMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t6g5kMk3bbOQJLzZC5XJkJXoY3ZIoVvTyEewNsNgj40=; b=m+R9d0ZA6QjlRP7XHLN8nFYJkOiyKbkzIm/wLTOQwjtcqBbNouL1c/t9x2AbJW2Uar I6tMU8gcxtOyJdseK4en2FZA3R6OtAPqhIaUA6pEUDw/+u/mBK6pMOm3HI+8CME9SXSB UUYVal4wk80aFWh0OLJSbj4SBb3xISdgS4AOGj5z5KqT2ncSDQ9n3KNjs0hNyxSkO/ZC puczs38OckyZDFdJR1cdWelIEx1wtvFOQE5nU2qZGKPyxEA42aOnk2oCmcQnwdoCcivp DJYVhV7JUKL17Nwh8KJAj05a0gsyeaBl54OUPEAPISHf/eF6KaYNElIIqIC+qyO83+L8 y9Tw== X-Gm-Message-State: AFqh2kr5GFuknEtKyxok2Nw97p8JWi+JBu+P06f80fNRbE4dZPc56gdi TCup7E2nym+Ib8zm4p20Ts4= X-Google-Smtp-Source: AMrXdXttz+EUqjCASGQ8tu8/XF2/YJFGxOD8AmED+8qxJREfZ/Nvvzgq62/HvquMPD64KK7Nye2eow== X-Received: by 2002:a17:902:a3c7:b0:192:a1e0:260c with SMTP id q7-20020a170902a3c700b00192a1e0260cmr2996849plb.2.1672342066399; Thu, 29 Dec 2022 11:27:46 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id b11-20020a170903228b00b001867fdec154sm13393482plh.224.2022.12.29.11.27.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Dec 2022 11:27:46 -0800 (PST) In-Reply-To: <87mt76f4n4.fsf@posteo.net> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=casouri@gmail.com; helo=mail-pj1-x102f.google.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:302060 Archived-At: >=20 >>> or creating new modes that depend >>> on tree-sitter and that don't work or even try to provide some = fall-back >>> if the library is not available. >>=20 >> I fail to see what's wrong with that. It is entirely legitimate to >> have a major mode which depends on an optional feature and doesn't >> work without it. =20 >=20 > Naturally, if there is no way around this. My argument is that there > is. What prompted me to ask this question was when I just opened a > Dockerfile and a warning popped up, telling me that I was missing the > right libraries.=20 I think we should not enable docker-ts-mode in auto-mode-alist if = (treesit-language-available-p 'dockerfile) is nil. This way you don=E2=80=99= t get the warning. In Emacs 30 we can upgrade the auto-mode facility to = use different modes based on some condition. Yuan=