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: Mon, 05 Dec 2022 15:12:22 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> Yes.  beginning-of-defun and end-of-defun are broken, and have been for
>> a long time.  They cannot, in general, work, for the reason you've just
>> noted.
> Thanks for confirming this, Alan. For a moment I thought that I was making
> one of those elisp newbie mistakes.

Well, "broken" is an opinion, not a fact.  AFAIK they can work.  Maybe
not as efficiently as some other API, but that's a different question.

> I think for now I will use the same workaround.

I'd urge you to try and find a way to make it work without such
a workaround.

>> Yes.  I suggest you submit a bug report for this bug.
> I will put some time into this and see if I can come up with a patch
> before flagging it as a bug.

Once you get it to work without the above workaround, you'll be able to
write a much better bug report.

>> To work properly, beginning/end-of-defun need to know whether the
>> starting point is inside a defun or between defuns.

Calling beginning-of-defun-function followed by end-of-defun-function
(and comparing the resulting position to the start position) should be
sufficient to let you know whether or not you're inside the function
whose definition starts most closely before point.


        Stefan




reply via email to

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