all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: daniel@kraus.my, 59677@debbugs.gnu.org
Subject: bug#59677: 30.0.50; Error when calling (treesit-end-of-defun)
Date: Thu, 1 Dec 2022 21:17:44 -0800	[thread overview]
Message-ID: <AD212529-FC05-49E2-BB22-7B71AB1A807C@gmail.com> (raw)
In-Reply-To: <87lenuko4o.fsf@kraus.my>


Daniel Martín <mardani29@yahoo.es> writes:

> Daniel Kraus <daniel@kraus.my> writes:
>
>> Hi,
>>
>> I tried the latest -ts-modes and ran into a problem with the
>> symbol-overlay ( https://github.com/wolray/symbol-overlay )
>> package.
>>
>> The problem is that `(end-of-defun)` calls `(treesit-end-of-defun)`
>> when in a ...-ts-mode and this function seems to raise an error when
>> point is not inside a function.
>>
>> Steps to reproduce:
>> - emacs -Q
>> - find-file "foo.py"
>> - Then if you run `M-: (end-of-defun)` it works as expected.
>> - After switching to `M-x python-ts-mode`,
>>   the same command raises an error.
>
> The error is signaled by the goto-char call in treesit-end-of-defun.
> Protecting it from possible nil node positions fixes the issue for me
> (there is a similar check in treesit-beginning-of-defun):
>

Thanks, I applied this patch. Tho technically end-of-defun shouldn’t
call end-of-defun-function unless point is on the beginning of a defun.
So we should really fix end-of-defun instead. I tried to fix it earlier
but that fix didn’t cover all cases where we call end-of-defun-function.

Anyway, I applied the patch and this particular problem should be gone
now :-)

Yuan





      parent reply	other threads:[~2022-12-02  5:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 11:08 bug#59677: 30.0.50; Error when calling (treesit-end-of-defun) Daniel Kraus
2022-11-29 12:27 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-29 12:35   ` Daniel Kraus
2022-12-02  5:17 ` Yuan Fu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AD212529-FC05-49E2-BB22-7B71AB1A807C@gmail.com \
    --to=casouri@gmail.com \
    --cc=59677@debbugs.gnu.org \
    --cc=daniel@kraus.my \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.