unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66673: [PATCH] Fix treesit-install-language-grammar recipe addition
@ 2023-10-22  3:09 nvp
  2023-10-22  3:40 ` Yuan Fu
  0 siblings, 1 reply; 3+ messages in thread
From: nvp @ 2023-10-22  3:09 UTC (permalink / raw)
  To: 66673


[-- 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#66673: [PATCH] Fix treesit-install-language-grammar recipe addition
  2023-10-22  3:09 bug#66673: [PATCH] Fix treesit-install-language-grammar recipe addition nvp
@ 2023-10-22  3:40 ` Yuan Fu
  2023-10-22  5:15   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Yuan Fu @ 2023-10-22  3:40 UTC (permalink / raw)
  To: nvp; +Cc: 66673-done



> On Oct 21, 2023, at 8:09 PM, nvp <noah.v.peart@gmail.com> wrote:
> 
> 
> 
> * 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.

Thank you! I applied the path on emacs-29.

Yuan





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#66673: [PATCH] Fix treesit-install-language-grammar recipe addition
  2023-10-22  3:40 ` Yuan Fu
@ 2023-10-22  5:15   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2023-10-22  5:15 UTC (permalink / raw)
  To: Yuan Fu; +Cc: noah.v.peart, 66673

> Resent-To: bug-gnu-emacs@gnu.org
> Cc: 66673-done@debbugs.gnu.org
> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 21 Oct 2023 20:40:52 -0700
> 
> 
> 
> > On Oct 21, 2023, at 8:09 PM, nvp <noah.v.peart@gmail.com> wrote:
> > 
> > 
> > 
> > * 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.
> 
> Thank you! I applied the path on emacs-29.

Thanks.

Yuan, if we are fixing treesit-install-language-grammar, I think it
lacks the "-ltree-sitter" command-line option for the link command.
At least on MS-Windows, this is required, as the link command will
fail if we don't supply that option: the linker _must_ scan the
tree-sitter library when generating the shared library for the
grammar.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-22  5:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-22  3:09 bug#66673: [PATCH] Fix treesit-install-language-grammar recipe addition nvp
2023-10-22  3:40 ` Yuan Fu
2023-10-22  5:15   ` Eli Zaretskii

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).