aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2025-06-14 11:23:54 -0400
committerEli Zaretskii2025-06-14 11:23:54 -0400
commit336253ddd398fed75d3e404f860691171de4d9d3 (patch)
tree986c5575c45a1db7d6b93a85ed218da7d5033191 /src
parent4cc6cdcf9d408407c69cdd9d468ec0de58038a44 (diff)
parentdf3fb94f09143285980348a3c6264ace913d3c73 (diff)
downloademacs-336253ddd398fed75d3e404f860691171de4d9d3.tar.gz
emacs-336253ddd398fed75d3e404f860691171de4d9d3.zip
Merge from origin/emacs-30
df3fb94f091 Insert missing step to make use of directory tracking OSC... 1bed2949583 * lisp/keymap.el (keymap-set): Refer to 'key-description'... 941158fc133 Support new tree-sitter grammar filename format (bug#78754) 888f846d377 Fix crash when evaluating "(signal nil 5)" (bug#78738) 51b9e92ab8e Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/... c0a913ea4f3 ; * doc/lispref/modes.texi (Font Lock Basics): Remove old... 37de076017a Adapt emba integration (don't merge)
Diffstat (limited to 'src')
-rw-r--r--src/eval.c2
-rw-r--r--src/treesit.c19
2 files changed, 18 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c
index fbb881d682d..46705dc4543 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1888,7 +1888,7 @@ See also the function `condition-case'. */
1888 (Lisp_Object error_symbol, Lisp_Object data) 1888 (Lisp_Object error_symbol, Lisp_Object data)
1889{ 1889{
1890 /* If they call us with nonsensical arguments, produce "peculiar error". */ 1890 /* If they call us with nonsensical arguments, produce "peculiar error". */
1891 if (NILP (error_symbol) && NILP (data)) 1891 if (NILP (error_symbol) && !CONSP (data))
1892 error_symbol = Qerror; 1892 error_symbol = Qerror;
1893 signal_or_quit (error_symbol, data, false); 1893 signal_or_quit (error_symbol, data, false);
1894 eassume (false); 1894 eassume (false);
diff --git a/src/treesit.c b/src/treesit.c
index 7fbe331c234..7b8e5d161f7 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -682,14 +682,29 @@ treesit_load_language_push_for_each_suffix (Lisp_Object lib_base_name,
682 Lisp_Object candidate1 = concat2 (lib_base_name, XCAR (suffixes)); 682 Lisp_Object candidate1 = concat2 (lib_base_name, XCAR (suffixes));
683#ifndef WINDOWSNT 683#ifndef WINDOWSNT
684 /* On Posix hosts, support libraries named with ABI version 684 /* On Posix hosts, support libraries named with ABI version
685 numbers. In the foreseeable future we only need to support 685 numbers. Originally tree-sitter grammars are always versioned
686 version 0.0. For more details, see 686 at 0.0, so we first try that. For more details, see
687 https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00386.html. */ 687 https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00386.html. */
688 Lisp_Object candidate2 = concat2 (candidate1, Vtreesit_str_dot_0); 688 Lisp_Object candidate2 = concat2 (candidate1, Vtreesit_str_dot_0);
689 Lisp_Object candidate3 = concat2 (candidate2, Vtreesit_str_dot_0); 689 Lisp_Object candidate3 = concat2 (candidate2, Vtreesit_str_dot_0);
690 690
691 *path_candidates = Fcons (candidate3, *path_candidates); 691 *path_candidates = Fcons (candidate3, *path_candidates);
692 *path_candidates = Fcons (candidate2, *path_candidates); 692 *path_candidates = Fcons (candidate2, *path_candidates);
693
694 /* Since 2025, tree-sitter grammars use their supported
695 TREE_SITTER_LANGUAGE_VERSION as the major version. So we need
696 to try all the version supported by the tree-sitter library
697 too. (See bug#78754) */
698 for (int version = TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION;
699 version <= TREE_SITTER_LANGUAGE_VERSION;
700 version++)
701 {
702 char ext[16]; // 16 should be enough until the end of universe.
703 snprintf ((char *) &ext, 16, ".%d.0", version);
704 Lisp_Object versioned_candidate = concat2 (candidate1,
705 build_string (ext));
706 *path_candidates = Fcons (versioned_candidate, *path_candidates);
707 }
693#endif 708#endif
694 *path_candidates = Fcons (candidate1, *path_candidates); 709 *path_candidates = Fcons (candidate1, *path_candidates);
695 } 710 }