aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2023-04-24 21:46:35 +0300
committerEli Zaretskii2023-04-24 21:46:35 +0300
commit98c6cfcbe4a07191f73e3bb94ff1f047551533e6 (patch)
treef7e5ba2903bf6ac345d70cf7106476520ff393c9 /src
parent8f71c1546dfc70ae7e646834c8d8baf23d4b4d90 (diff)
downloademacs-98c6cfcbe4a07191f73e3bb94ff1f047551533e6.tar.gz
emacs-98c6cfcbe4a07191f73e3bb94ff1f047551533e6.zip
Don't support versioned grammar libraries on MS-Windows
* src/treesit.c (treesit_load_language_push_for_each_suffix): Don't append ".0.0" on WINDOWSNT.
Diffstat (limited to 'src')
-rw-r--r--src/treesit.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/treesit.c b/src/treesit.c
index 2d0df10ec44..a2d32770ed8 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -404,7 +404,9 @@ init_treesit_functions (void)
404 404
405static Lisp_Object Vtreesit_str_libtree_sitter; 405static Lisp_Object Vtreesit_str_libtree_sitter;
406static Lisp_Object Vtreesit_str_tree_sitter; 406static Lisp_Object Vtreesit_str_tree_sitter;
407#ifndef WINDOWSNT
407static Lisp_Object Vtreesit_str_dot_0; 408static Lisp_Object Vtreesit_str_dot_0;
409#endif
408static Lisp_Object Vtreesit_str_dot; 410static Lisp_Object Vtreesit_str_dot;
409static Lisp_Object Vtreesit_str_question_mark; 411static Lisp_Object Vtreesit_str_question_mark;
410static Lisp_Object Vtreesit_str_star; 412static Lisp_Object Vtreesit_str_star;
@@ -532,15 +534,17 @@ treesit_load_language_push_for_each_suffix (Lisp_Object lib_base_name,
532 FOR_EACH_TAIL (suffixes) 534 FOR_EACH_TAIL (suffixes)
533 { 535 {
534 Lisp_Object candidate1 = concat2 (lib_base_name, XCAR (suffixes)); 536 Lisp_Object candidate1 = concat2 (lib_base_name, XCAR (suffixes));
535 /* Support libraries named with ABI version numbers. In the 537#ifndef WINDOWSNT
536 foreseeable future we only need to support version 0.0. See 538 /* On Posix hosts, support libraries named with ABI version
537 the thread titled "Versioned Tree-sitter parser libraries" on 539 numbers. In the foreseeable future we only need to support
538 emacs-devel. */ 540 version 0.0. For more details, see
541 https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00386.html. */
539 Lisp_Object candidate2 = concat2 (candidate1, Vtreesit_str_dot_0); 542 Lisp_Object candidate2 = concat2 (candidate1, Vtreesit_str_dot_0);
540 Lisp_Object candidate3 = concat2 (candidate2, Vtreesit_str_dot_0); 543 Lisp_Object candidate3 = concat2 (candidate2, Vtreesit_str_dot_0);
541 544
542 *path_candidates = Fcons (candidate3, *path_candidates); 545 *path_candidates = Fcons (candidate3, *path_candidates);
543 *path_candidates = Fcons (candidate2, *path_candidates); 546 *path_candidates = Fcons (candidate2, *path_candidates);
547#endif
544 *path_candidates = Fcons (candidate1, *path_candidates); 548 *path_candidates = Fcons (candidate1, *path_candidates);
545 } 549 }
546} 550}
@@ -3595,8 +3599,10 @@ then in the system default locations for dynamic libraries, in that order. */);
3595 Vtreesit_str_libtree_sitter = build_pure_c_string ("libtree-sitter-"); 3599 Vtreesit_str_libtree_sitter = build_pure_c_string ("libtree-sitter-");
3596 staticpro (&Vtreesit_str_tree_sitter); 3600 staticpro (&Vtreesit_str_tree_sitter);
3597 Vtreesit_str_tree_sitter = build_pure_c_string ("tree-sitter-"); 3601 Vtreesit_str_tree_sitter = build_pure_c_string ("tree-sitter-");
3602#ifndef WINDOWSNT
3598 staticpro (&Vtreesit_str_dot_0); 3603 staticpro (&Vtreesit_str_dot_0);
3599 Vtreesit_str_dot_0 = build_pure_c_string (".0"); 3604 Vtreesit_str_dot_0 = build_pure_c_string (".0");
3605#endif
3600 staticpro (&Vtreesit_str_dot); 3606 staticpro (&Vtreesit_str_dot);
3601 Vtreesit_str_dot = build_pure_c_string ("."); 3607 Vtreesit_str_dot = build_pure_c_string (".");
3602 staticpro (&Vtreesit_str_question_mark); 3608 staticpro (&Vtreesit_str_question_mark);