From: Eli Zaretskii Date: Sat, 23 Dec 2023 11:30:40 +0000 (-0500) Subject: Merge from origin/emacs-29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1be62044732df0c4f1be9679a4ada09850a9e2ab;p=emacs.git Merge from origin/emacs-29 a4751657389 * doc/man/emacsclient.1: Fix --tramp option. 1e5357d3d1f * doc/man/emacsclient.1: Add missing sections (bug#66598) fba7b9db397 Add explanation for extra parentheses in ELisp Introduction 77232826821 Add sample code to the "let*" section in "forward-paragraph" 7a00ca92c19 Fix treesit test (bug#67117) d220893216c Fix c++-ts-mode indentation (bug#67975) d386a8aa43f Recommend customizing eglot for python-base-mode bd0c7589715 Improve documentation of new native-compilation commands 1ad126c0f28 ; Fix typo 77678244b83 doc/lispintro: Don't mention `set` (bug#67734) cb3684e9dfa Fix script for some characters 2922d683b78 ; * src/treesit.c (treesit_traverse_child_helper): Fix co... 7b315e8a5c9 Fix an issue when searching subtree backward (bug#67117) 03625c2fefa Fix passive mode for tnftp client in ange-ftp.el. b6429b1c1c7 ; Improve documentation of ispell.el's dictionary database 75cc1593412 ; * etc/PROBLEMS: Update the "GnuPG hangs" entry. 67d9af1c074 Fix using disabled command without a docstring f68f3500236 Improve documentation of text properties handling when ya... 06c399914fa Eglot: Add Uiua language server --- 1be62044732df0c4f1be9679a4ada09850a9e2ab diff --cc test/src/treesit-tests.el index 791e902bd0a,1763c3894f5..e5f3a5d992e --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@@ -1160,13 -1076,49 +1160,49 @@@ This tests bug#60355. "Test top-level only defun navigation." (skip-unless (treesit-language-available-p 'python)) ;; Nested defun navigation - (let ((treesit-defun-tactic 'top-level)) - (require 'python) - (treesit--ert-test-defun-navigation - 'python-ts-mode - treesit--ert-defun-navigation-python-program - treesit--ert-defun-navigation-top-level-master))) + (require 'python) + (treesit--ert-test-defun-navigation + 'python-ts-mode + treesit--ert-defun-navigation-python-program + treesit--ert-defun-navigation-top-level-master + 'top-level)) + (ert-deftest treesit-search-subtree-forward-1 () + "Test search subtree forward." + (skip-unless (treesit-language-available-p 'python)) + (require 'python) + (python-ts-mode) + (insert "Temp(1, 2)") + (goto-char (point-min)) + (pcase-let* ((`((,_ . ,call-node)) + (treesit-query-capture (treesit-buffer-root-node) + '((call) @c))) + (node (treesit-search-subtree + call-node + (lambda (n) (equal (treesit-node-type n) "integer"))))) + + (should node) + (should (equal (treesit-node-text node) "1")))) + + (ert-deftest treesit-search-subtree-backward-1 () + "Test search subtree with backward=t." + (skip-unless (treesit-language-available-p 'python)) + (require 'python) + (python-ts-mode) + (insert "Temp(1, 2)") + (goto-char (point-min)) + (pcase-let* ((`((,_ . ,call-node)) + (treesit-query-capture (treesit-buffer-root-node) + '((call) @c))) + (node (treesit-search-subtree + call-node + (lambda (n) (equal (treesit-node-type n) "integer")) + t))) + + (should node) + (should (equal (treesit-node-text node) "2")))) + + ;; TODO ;; - Functions in treesit.el ;; - treesit-load-name-override-list