unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: nvp <noah.v.peart@gmail.com>
To: 66673@debbugs.gnu.org
Subject: bug#66673: [PATCH] Fix treesit-install-language-grammar recipe addition
Date: Sat, 21 Oct 2023 20:09:21 -0700	[thread overview]
Message-ID: <CAPVBTSchb32Pua+tTqRtCOmzskzWunPgLQFVXCzqCp1Fge-dSQ@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1018 bytes --]

Tags: patch


* lisp/treesit.el (treesit-install-language-grammar): fix recipe
addition to `treesit-language-source-alist`

Bug: `treesit-install-language-grammar` adds repeated language
entry to `treesit-language-source-alist` causing circular list.

Recipe to reproduce:
1. `M-x treesit-install-language-grammar` `bash` (enter all defaults)
2. `M-x treesit-install-language-grammar` `bash`

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2023-10-21 built on noah-X580VD
Repository revision: 6f87ee0e3a0727e16079778a4264e6e35cd7f3a8
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.3 LTS

Configured using:
 'configure --prefix=/usr/local --with-modules --with-tree-sitter
--with-threads --with-x-toolkit=gtk3 --with-xwidgets --with-gnutls
--with-json --with-mailutils --with-jpeg --with-png --with-rsvg
--with-tiff --with-xml2 --with-xpm --with-imagemagick CC=gcc-12
CXX=gcc-12'

[-- Attachment #1.2: Type: text/html, Size: 1158 bytes --]

[-- Attachment #2: fix-treesit-install.patch --]
[-- Type: text/x-patch, Size: 790 bytes --]

From 9968ab4c223e1f65ab6984543cb63d3c9d62860e Mon Sep 17 00:00:00 2001
From: nverno <noah.v.peart@gmail.com>
Date: Sat, 21 Oct 2023 19:54:10 -0700
Subject: [PATCH] Fix treesit-install-language-grammar recipe addition

---
 lisp/treesit.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 80bdf164b07..8100e418303 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -3354,7 +3354,7 @@ treesit-install-language-grammar
                           " ")))
               ;; If success, Save the recipe for the current session.
               (setf (alist-get lang treesit-language-source-alist)
-                    recipe))))
+                    (cdr recipe)))))
       (error
        (display-warning
         'treesit
-- 
2.34.1


             reply	other threads:[~2023-10-22  3:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-22  3:09 nvp [this message]
2023-10-22  3:40 ` bug#66673: [PATCH] Fix treesit-install-language-grammar recipe addition Yuan Fu
2023-10-22  5:15   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPVBTSchb32Pua+tTqRtCOmzskzWunPgLQFVXCzqCp1Fge-dSQ@mail.gmail.com \
    --to=noah.v.peart@gmail.com \
    --cc=66673@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).