From: Yuan Fu Date: Sat, 31 Dec 2022 22:27:51 +0000 (-0800) Subject: ; Remove GRAMMAR-DIR from treesit-language-source-alist X-Git-Tag: emacs-29.0.90~889 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0dc788aa013db1222918c2dfe2ffad3d17b4b9f6;p=emacs.git ; Remove GRAMMAR-DIR from treesit-language-source-alist Removing it doesn't affect building all the language grammars in batch.sh, so it must be an artifact I added for something else and later forgot to remove. * lisp/treesit.el (treesit-language-source-alist) (treesit--install-language-grammar-1): Remove GRAMMAR-DIR. --- diff --git a/lisp/treesit.el b/lisp/treesit.el index e3edaabe996..477abf65fb9 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2619,7 +2619,7 @@ window." The value should be an alist where each element has the form - (LANG . (URL SOURCE-DIR GRAMMAR-DIR CC C++)) + (LANG . (URL SOURCE-DIR CC C++)) Only LANG and URL are mandatory. LANG is the language symbol. URL is the Git repository URL for the grammar. @@ -2627,9 +2627,6 @@ URL is the Git repository URL for the grammar. SOURCE-DIR is the relative subdirectory in the repository in which the grammar's parser.c file resides, defaulting to \"src\". -GRAMMAR-DIR is the relative subdirectory in the repository -in which the grammar.js file resides, defaulting to \".\". - CC and C++ are C and C++ compilers, defaulting to \"cc\" and \"c++\", respectively.") @@ -2683,7 +2680,7 @@ content as signal data, and erase buffer afterwards." (erase-buffer))) (defun treesit--install-language-grammar-1 - (out-dir lang url &optional source-dir grammar-dir cc c++) + (out-dir lang url &optional source-dir cc c++) "Install and compile a tree-sitter language grammar library. OUT-DIR is the directory to put the compiled library file. If it @@ -2698,7 +2695,6 @@ function signals an error." (default-directory (make-temp-file "treesit-workdir" t)) (workdir (expand-file-name "repo")) (source-dir (expand-file-name (or source-dir "src") workdir)) - (grammar-dir (expand-file-name (or grammar-dir "") workdir)) (cc (or cc (seq-find #'executable-find '("cc" "gcc" "c99")) ;; If no C compiler found, just use cc and let ;; `call-process' signal the error. @@ -2717,10 +2713,8 @@ function signals an error." (treesit--call-process-signal "git" nil t nil "clone" url "--depth" "1" "--quiet" workdir) - ;; cp "${grammardir}"/grammar.js "${sourcedir}" - (copy-file (expand-file-name "grammar.js" grammar-dir) - (expand-file-name "grammar.js" source-dir) - t t) + ;; We need to go into the source directory because some + ;; header files use relative path (#include "../xxx"). ;; cd "${sourcedir}" (setq default-directory source-dir) (message "Compiling library")