diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 797f40ca1ba..5cbd4213028 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -250,6 +250,8 @@ defined by the current language mode. With ARG, do this that many times. A negative argument means move backward but still to a less deep spot. +Calls `up-list-function' to do the work, if that is non-nil. + If ESCAPE-STRINGS is non-nil (as it is interactively), move out of enclosing strings as well. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 848a26229e6..b6981c9156c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -7485,7 +7485,8 @@ implementations: `python-mode' and `python-ts-mode'." (treesit-major-mode-setup) ;; Enable the `sexp' navigation by default (setq-local forward-sexp-function #'treesit-forward-sexp - treesit-sexp-thing 'sexp) + treesit-sexp-thing 'sexp + treesit-sexp-thing-down-list 'list) (when (>= emacs-major-version 31) (setq-local hs-treesit-things '(or defun sexp))