commit 8044140b54bfe7e88c28a49cc0dc4ae129029e4f (HEAD, refs/remotes/origin/master) Author: Yuan Fu Date: Tue Dec 26 22:37:19 2023 -0800 Revert e8df6c311fcf59bf23d31b9db2bb8fec9d78fbe7 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, /* First push just the filenames to the candidate list, which will make dynlib_open look under standard system load paths. */ treesit_load_language_push_for_each_suffix (lib_base_name, &path_candidates); - /* This is used for reporting errors (i.e., just filenames). */ - Lisp_Object base_candidates = path_candidates; /* Then push ~/.emacs.d/tree-sitter paths. */ Lisp_Object lib_name = Fexpand_file_name (concat2 (build_string ("tree-sitter/"), lib_base_name), @@ -624,6 +622,7 @@ treesit_load_language (Lisp_Object language_symbol, fail. */ dynlib_handle_ptr handle; const char *error; + Lisp_Object error_list = Qnil; tail = path_candidates; error = NULL; @@ -637,13 +636,17 @@ treesit_load_language (Lisp_Object language_symbol, error = dynlib_error (); if (error == NULL) break; + else + error_list = Fcons (build_string (error), error_list); } if (error != NULL) { + /* Yes, the error message list gets a bit verbose, but those + messages will be helpful for certain errors like libc version + mismatch. */ *signal_symbol = Qtreesit_load_language_error; - *signal_data = list3 (Qnot_found, base_candidates, - build_string ("No such file or directory")); + *signal_data = Fcons (Qnot_found, Fnreverse (error_list)); return NULL; } commit 5213e92f203b0ec934860d6026bdc5d3cddc0173 Author: Dmitry Gutov Date: Wed Dec 27 02:20:39 2023 +0200 Fix Tramp error in project-find-file * lisp/progmodes/project.el (project--read-file-cpd-relative): Avoid new Tramp connections (bug#68041). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0082f12666a..79bb3173d3d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1147,14 +1147,15 @@ project--read-file-cpd-relative (new-collection (project--file-completion-table substrings)) (abs-cpd (expand-file-name common-parent-directory)) (abs-cpd-length (length abs-cpd)) - (relname (cl-letf (((symbol-value hist) - (mapcan - (lambda (s) - (setq s (expand-file-name s)) - (and (string-prefix-p abs-cpd s) - (not (eq abs-cpd-length (length s))) - (list (substring s abs-cpd-length)))) - (symbol-value hist)))) + (relname (cl-letf* ((non-essential t) ;Avoid new Tramp connections. + ((symbol-value hist) + (mapcan + (lambda (s) + (setq s (expand-file-name s)) + (and (string-prefix-p abs-cpd s) + (not (eq abs-cpd-length (length s))) + (list (substring s abs-cpd-length)))) + (symbol-value hist)))) (project--completing-read-strict prompt new-collection predicate commit d376462c7183752bf44b9bd20bf5020fe7eaf75a Author: João Távora Date: Tue Dec 26 08:10:04 2023 -0600 Revert "Eglot: Make 'try-completion' less broken" This reverts commit 4dcbf61c1518dc53061707aeff8887517e050003. It's not correct, breaks tests. I declare it impossible to make C-M-i use of 'try-completion' behave sanely with LSP in its current state. YMMV. Use a completion tooltip, like Company. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index a97c9e2a3e0..d777e488c43 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3113,8 +3113,8 @@ eglot-completion-at-point ((eq action 'lambda) ; test-completion (test-completion pattern (funcall proxies))) ((eq (car-safe action) 'boundaries) nil) ; boundaries - ((null action) ; try-completion (github#1339) - pattern) + ((null action) ; try-completion + (try-completion pattern (funcall proxies))) ((eq action t) ; all-completions (let ((comps (funcall proxies))) (dolist (c comps) (eglot--dumb-flex pattern c t)) @@ -3215,8 +3215,7 @@ eglot-completion-at-point ;; was obtained from server. If a `proxy' ;; "bar" was obtained from a buffer with ;; "foo.b", the LSP edit applies to that - ;; state, _not_ the current "foo.bar" - ;; (github#1339) + ;; state, _not_ the current "foo.bar". (delete-region orig-pos (point)) (insert (substring bounds-string (- orig-pos (car bounds)))) (eglot--dbind ((TextEdit) range newText) textEdit commit 4dcbf61c1518dc53061707aeff8887517e050003 Author: João Távora Date: Tue Dec 26 07:47:29 2023 -0600 Eglot: Make 'try-completion' less broken The 'try-completion' completion operation, used mostly in vanilla 'completion-at-point' invoked with C-M-i is close to impossible to get right in LSP because of the arbitrary edits handled in ':exit-function'. When this operation is invoked on the table, returning the pattern argument unchanged somehow (TM) makes a sole completion show the *Completions* buffer, where selecting it will recover context necessary for `:exit-function' and call that function. It doesn't break any other cases I know, and that's good enough for now. https://github.com/joaotavora/eglot/issues/1339 * lisp/progmodes/eglot.el (eglot-completion-at-point): Return pattern when 'try-completion' is invoked. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index d777e488c43..a97c9e2a3e0 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3113,8 +3113,8 @@ eglot-completion-at-point ((eq action 'lambda) ; test-completion (test-completion pattern (funcall proxies))) ((eq (car-safe action) 'boundaries) nil) ; boundaries - ((null action) ; try-completion - (try-completion pattern (funcall proxies))) + ((null action) ; try-completion (github#1339) + pattern) ((eq action t) ; all-completions (let ((comps (funcall proxies))) (dolist (c comps) (eglot--dumb-flex pattern c t)) @@ -3215,7 +3215,8 @@ eglot-completion-at-point ;; was obtained from server. If a `proxy' ;; "bar" was obtained from a buffer with ;; "foo.b", the LSP edit applies to that - ;; state, _not_ the current "foo.bar". + ;; state, _not_ the current "foo.bar" + ;; (github#1339) (delete-region orig-pos (point)) (insert (substring bounds-string (- orig-pos (car bounds)))) (eglot--dbind ((TextEdit) range newText) textEdit