aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuan Fu2023-12-26 22:37:19 -0800
committerYuan Fu2023-12-26 22:37:19 -0800
commit8044140b54bfe7e88c28a49cc0dc4ae129029e4f (patch)
tree8dcdbf635205957187eecdedaf13260d07baf591 /src
parent5213e92f203b0ec934860d6026bdc5d3cddc0173 (diff)
downloademacs-8044140b54bfe7e88c28a49cc0dc4ae129029e4f.tar.gz
emacs-8044140b54bfe7e88c28a49cc0dc4ae129029e4f.zip
Revert e8df6c311fcf59bf23d31b9db2bb8fec9d78fbe7
Diffstat (limited to 'src')
-rw-r--r--src/treesit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/treesit.c b/src/treesit.c
index 3f4337ba97e..c65873a28f7 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -600,8 +600,6 @@ treesit_load_language (Lisp_Object language_symbol,
600 /* First push just the filenames to the candidate list, which will 600 /* First push just the filenames to the candidate list, which will
601 make dynlib_open look under standard system load paths. */ 601 make dynlib_open look under standard system load paths. */
602 treesit_load_language_push_for_each_suffix (lib_base_name, &path_candidates); 602 treesit_load_language_push_for_each_suffix (lib_base_name, &path_candidates);
603 /* This is used for reporting errors (i.e., just filenames). */
604 Lisp_Object base_candidates = path_candidates;
605 /* Then push ~/.emacs.d/tree-sitter paths. */ 603 /* Then push ~/.emacs.d/tree-sitter paths. */
606 Lisp_Object lib_name 604 Lisp_Object lib_name
607 = Fexpand_file_name (concat2 (build_string ("tree-sitter/"), lib_base_name), 605 = Fexpand_file_name (concat2 (build_string ("tree-sitter/"), lib_base_name),
@@ -624,6 +622,7 @@ treesit_load_language (Lisp_Object language_symbol,
624 fail. */ 622 fail. */
625 dynlib_handle_ptr handle; 623 dynlib_handle_ptr handle;
626 const char *error; 624 const char *error;
625 Lisp_Object error_list = Qnil;
627 626
628 tail = path_candidates; 627 tail = path_candidates;
629 error = NULL; 628 error = NULL;
@@ -637,13 +636,17 @@ treesit_load_language (Lisp_Object language_symbol,
637 error = dynlib_error (); 636 error = dynlib_error ();
638 if (error == NULL) 637 if (error == NULL)
639 break; 638 break;
639 else
640 error_list = Fcons (build_string (error), error_list);
640 } 641 }
641 642
642 if (error != NULL) 643 if (error != NULL)
643 { 644 {
645 /* Yes, the error message list gets a bit verbose, but those
646 messages will be helpful for certain errors like libc version
647 mismatch. */
644 *signal_symbol = Qtreesit_load_language_error; 648 *signal_symbol = Qtreesit_load_language_error;
645 *signal_data = list3 (Qnot_found, base_candidates, 649 *signal_data = Fcons (Qnot_found, Fnreverse (error_list));
646 build_string ("No such file or directory"));
647 return NULL; 650 return NULL;
648 } 651 }
649 652