emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code navigation for sh-mode with Tree-sitter


From: Stefan Monnier
Subject: Re: Code navigation for sh-mode with Tree-sitter
Date: Tue, 06 Dec 2022 18:50:01 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> However, with negative arguments that does not happen, as
> `sh-mode--treesit-beginning-of-defun' moves point to (beginning of) the
> closest sibling function (after point) and
> `sh-mode--treesit-end-of-defun' moves
> point to (end of) the closest sibling function (before point).  In this
> case, the selected functions to which point move to are not the same.

Please read the docstring of `end-of-defun-function`, because I suspect
that you are confused about what it's supposed to do.  E.g. it's not
supposed to "move point to (end of) the closest sibling function", so
I think you'll need to set it to a different function than
`sh-mode--treesit-end-of-defun`.

> A second look revealed that the function set to `end-of-defun-function' is
> called without arguments,

As documented in its docstring, yes.

> thus when used can only produce motions that are symmetric to
> `beginning-of-defun-function'.

Not sure what you mean by that.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]