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: =?utf-8?Q?Re=3A_emacs-29_56cd810b9d1=3A_Don=E2=80=99t_signal_warn?= =?utf-8?Q?ing_when_loading_go-ts-mode=2Eel_without_grammar?= Date: Thu, 2 Mar 2023 19:05:27 -0800 Message-ID: <6B49E4E7-8FB6-47A6-A380-538BEE2DE1E1@gmail.com> References: <83r0u7eh2f.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.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="26908"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 03 04:06:38 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 1pXvkj-0006rJ-3J for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Mar 2023 04:06:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXvjy-0007qm-GW; Thu, 02 Mar 2023 22:05:50 -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 1pXvjr-0007lY-JY for emacs-devel@gnu.org; Thu, 02 Mar 2023 22:05:46 -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 1pXvjq-0004R5-0f; Thu, 02 Mar 2023 22:05:43 -0500 Original-Received: by mail-pj1-x102f.google.com with SMTP id cp7-20020a17090afb8700b0023756229427so4822265pjb.1; Thu, 02 Mar 2023 19:05:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677812740; 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=3toFryGM9yxcoNwM+AU8lgzlDkUQpe++gYV+JeDo8bc=; b=N7/hI5LdarYtXUyp0L4YAbwoGsqpbrW/nD+gt3VkN9qERh3bk0cHweTqe/QpojTsBq t23aPHWLfte3xbKPTQJVdc9AWZIj4EuyVKy2iXK20nQnDIeU7oShKHAgNAjh5vTVzsow BI63U/SpN268zY182qWth9pzNPeOseqX6Yfk8frk/ZwN2qSxXWeQ+kjQPnu9SC0o01XD 33LRdvsVEt4vqtY8ntNhUPsZSJ5bCgF4nt/np1ZYkSrioLGdStIj8fVTsgKXn2JzaPZR PbSFv89LdFWhHijCg71wZ4wwR5CvteF2oIUAUci9I3M4jvGHFxmkPN1uhRQO6Gpor0oc 6qGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677812740; 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=3toFryGM9yxcoNwM+AU8lgzlDkUQpe++gYV+JeDo8bc=; b=OBFnDhZVtZifKOQZRvkrZLskP0+cZBHPYHf6JExo38etzwpqdSyfNjSYyb4Jk6Ih3b cuDn3nlT7MDJRkaebve5ym5/x3B/71qRgwVDhlxx54HUsO1OTn35SExMiZQ0VbWetkyZ o7H/dhpqaxfuZ7JOQHFJ7Iw7Kvd8Hj+B9de8cGHsvh5EwqQ/zKUArtHqmVQilgoG5P9K 6fLzGCrSRX+LcPSSkC+D1A2JBlQ4cQQZa4ZdIc532XH0KLLT9DnVpAJwzZBI/25CoF6r vRzkL/7qD1CC55Tqd8Su8N3gfvAZd/kR+sob7cZNOWe77ahJMaPawVxstl3Iu+Dq7gis jk/w== X-Gm-Message-State: AO0yUKXrs5WV7YywC011pqPPDd1jHEKyHknazZT8ZdCBvmNFTM/5fMhA PLh9nWCgdKjEKgfiIgS1heKUyx0Z2AQJYQ== X-Google-Smtp-Source: AK7set/zYXZTFGsXwpixvp++HKbSMzcF/QBJCXTMZb4YAXqWhX4wgoGn5K8J1NFH9WW2bJOI0bhAYw== X-Received: by 2002:a17:902:8c87:b0:19e:7d62:a3c9 with SMTP id t7-20020a1709028c8700b0019e7d62a3c9mr429636plo.41.1677812739500; Thu, 02 Mar 2023 19:05:39 -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 j14-20020a170903024e00b0019462aa090bsm336478plh.284.2023.03.02.19.05.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2023 19:05:39 -0800 (PST) In-Reply-To: <83r0u7eh2f.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.400.51.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:303905 Archived-At: >=20 > Yuan, why was this change made? The fact that loading go-ts-mode.el > without a grammar library causes a warning is the intended behavior: > users who don't have tree-sitter setup for Go shouldn't load this > mode, and if they do, they should know it failed, and why. The above > change makes it fail silently, which is not a Good Thing. I thought that we=E2=80=99d want the warning to appear when user calls = go-mod-ts-mode or open a file that uses that mode, rather than at load = time. What I had in mind is when someone only install tree-sitter-go and = want to edit some Go file, and they get this warning of go-mod being not = available. This is what I encountered which prompted this change. I = didn=E2=80=99t know that was intentional; since it=E2=80=99s = intentional, please revert it (maybe you already have), and sorry for = the hiccup :-) > made this even worse: now we have a byte-compilation warning in a > build without tree-sitter, and this code will signal a generic error > (whose text is not very helpful to users) if the file is loaded in a > build without tree-sitter. This is all against the intended behavior > of these modes. >=20 > Again, what problem were you trying to fix with that change? Treesit-ready-p is intended to be used for major modes, so it includes = checks for current buffer=E2=80=99s size, which doesn=E2=80=99t make = much sense when called when loading the file. But if you intentionally = used that function for the warning, I guess there is no harm using it = this way, as the default size threshold is rather large. Yuan