From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#73557: c-ts-mode 'emacs-c broken with treesit-load-name-override-list Date: Sun, 29 Sep 2024 15:08:29 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000eaffdb062346d068" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21492"; mail-complaints-to="usenet@ciao.gmane.io" To: 73557@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 29 21:09:47 2024 Return-path: Envelope-to: geb-bug-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 1suzIg-0005Su-Hs for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Sep 2024 21:09:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suzIT-0000OR-0D; Sun, 29 Sep 2024 15:09:33 -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 1suzIR-0000OF-LN for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:09:31 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1suzIR-0005nD-D0 for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:09:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=83uEG00Li/vFQQHMFuKYPO14zilAFGYxOO8CSL4XuaQ=; b=aUSWcH6s20Du9H8DgnR6CIIpfyitwkzFyzWQeMgEex2XyS3360TPZ0vuzckpSnKs95RjJhnqWPD6+PrXXSSs3KA/SXxsxqgBLBxiVQug1t/F1GCUvyuosZzbBcE3o/0US7QXa3+orjFJBn7vuUdDTSwc4NyFijcPtqJuIGLPrijmLOrlrrZMJEzdKSV58584aOs7/u7OiOOQlw2R8yHZZApSLMiwHIex63IR4Razcm7XIabALcWtJrEMyxA7KddEchex1/MWxWvCvQn1fdXQX4KHuRgOqaotVbbcfX1C4dzBexVhnr52OoSbdMqS0UG545nuVJcCUyAu6nvqZakx4A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1suzIw-0005h1-Pg for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Sep 2024 19:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73557 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172763695721843 (code B ref -1); Sun, 29 Sep 2024 19:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Sep 2024 19:09:17 +0000 Original-Received: from localhost ([127.0.0.1]:41784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suzID-0005gE-Ea for submit@debbugs.gnu.org; Sun, 29 Sep 2024 15:09:17 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suzIB-0005g6-Ka for submit@debbugs.gnu.org; Sun, 29 Sep 2024 15:09:16 -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 1suzHf-0000MO-KV for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:08:43 -0400 Original-Received: from mail-vk1-xa34.google.com ([2607:f8b0:4864:20::a34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1suzHd-0005kV-Ub for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2024 15:08:43 -0400 Original-Received: by mail-vk1-xa34.google.com with SMTP id 71dfb90a1353d-509fc9d2074so235862e0c.3 for ; Sun, 29 Sep 2024 12:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727636920; x=1728241720; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=83uEG00Li/vFQQHMFuKYPO14zilAFGYxOO8CSL4XuaQ=; b=IMFDyzSih06KAunHxNOpwBXmbEFF/njjQC8bsws9QDdOPCSxXEkk+Zk2AiOEuAoJRx a09+puBFMrlBWM6tgisqYLPhxGHMFuQRim0j15aBYsr93GXhYA5sG1bDlxwAKFkYF94a ZuRfXIjkO+gsvt1+JafBFoPDNdOXjcopK9ZhtLfC/vv5Ka6bKfLw2p2VRESgypy8psuS ORb2nx7wbXgtG9cPB5Veo4q7QjEBbcAdrKvr5RKy61o69Ow4t6x0bFiSxJyFEUvoWskc YYkrwcvJqhXCyT4ClsbINnuMIBjFnfQ9pKq0AgJFx/B8dGIiXsfC7ipmqywe1MY7b24B qJ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727636920; x=1728241720; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=83uEG00Li/vFQQHMFuKYPO14zilAFGYxOO8CSL4XuaQ=; b=ci/psVl5icgLvnVVOYQ5fq9+YfsX0Y7f7MW1UUTBc/frhsEbxuTXDdcPZHK4Wxzld/ XqfCZ+9JRGqvi60E6UfEYiq7M3j+O3rV8Urvz6lF5VjPgBqsvD+L0wl1HKbaEg8/uXwW YAtikBSKWYOh+O/jaDtznDy0l40GphC1XztPCqFlAl/TFSRn6Z4LonXY5gmGkdrgoUyL X1gGcrnIdUCJDuSAqF96ZlN+Uh3YTkTqGmx/wbFrZ8vVyAAd/OKQAI7qYdzwKQmXPQ+i K+qQSnFF7Jfdo/PieEke2vqj0OI9aZYEK/jrhxLGY+gGDN6gLEEQJ7Fv18VO5hJyPkJa RRzg== X-Gm-Message-State: AOJu0YwWviotKbNuOqRhhX+K/NZuElhjXYaLOm29cAuz5gGD2dG/N4zV hEeOX+03hbiaYn0mpWjq7FlJseHCdnE5ZlDmgow0WHZAQCj8GUoNddeGA8bjxI8g9r3+C+wUY6t CA2PkvfqcocyuSZ0CcLL7mFWTpHj14lZO X-Google-Smtp-Source: AGHT+IFLuVt9TF9c6qBjwyPrHigP4KYquxJKMWARlWH/0Mnnuxq6ZLk8SaIq1rTZDVdOsNtk8eWb9fkHvr+AbkgXhzg= X-Received: by 2002:a05:6122:180d:b0:4ed:52b:dd29 with SMTP id 71dfb90a1353d-5078169bb5cmr6196136e0c.3.1727636920006; Sun, 29 Sep 2024 12:08:40 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::a34; envelope-from=shipmints@gmail.com; helo=mail-vk1-xa34.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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292661 Archived-At: --000000000000eaffdb062346d068 Content-Type: text/plain; charset="UTF-8" The c-ts-mode "fake" emacs-c grammar does not work in the presence of a 'c grammar provided in treesit-load-name-override-list. For example, I set this override to point to my treesitter c grammar which uses the file name "c.dylib" on Mac, not "tree_sitter_c.dylib": (add-to-list 'treesit-load-name-override-list '(c "c" "tree_sitter_c")) c-ts-mode says: (define-derived-mode c-ts-mode c-ts-base-mode "C" ... (setf (alist-get 'emacs-c treesit-load-name-override-list) '("libtree-sitter-c" "tree_sitter_c")) I think this code should first look for the 'c grammar in 'treesit-load-name-override-list before setting a hard-coded file name that may not work for everyone. I can get around this, temporarily, by setting a symlink from c.dylib to libtree-sitter-c.dylib. It took a while to figure out what was going on, though. This is surely going to confuse other people. Thank you, Stephane --000000000000eaffdb062346d068 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The c-ts-mode "fake" emacs-c grammar does not work in the = presence of a 'c grammar provided in treesit-load-name-override-list.

For example, I set this override to point to my treesitter c gramma= r which uses the file name "c.dylib" on Mac, not "tree_sitte= r_c.dylib":

(add-to-list 'treesit-load-name-override-list= '(c "c" "tree_sitter_c"))

c-ts-mode says:
(define-derived-mode c-ts-mode= c-ts-base-mode "C"
...
=C2=A0 =C2=A0 (setf (alist-get &#= 39;emacs-c treesit-load-name-override-list)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 '("libtree-sitter-c" "tree_sitter_c"))

I think this code should first look for the 'c grammar in '= treesit-load-name-override-list=C2=A0before setting a hard-coded file name = that may not work for everyone.

I can get around this, temporarily= , by setting a symlink from c.dylib to libtree-sitter-c.dylib. It took a wh= ile to figure out what was going on, though. This is surely going to confus= e other people.

= Thank you,

Stephane
--000000000000eaffdb062346d068--