From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>,
Dominique Quatravaux <dominique@quatravaux.org>
Cc: 68956@debbugs.gnu.org
Subject: bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
Date: Wed, 10 Apr 2024 13:51:33 +0300 [thread overview]
Message-ID: <865xwpwkwa.fsf@gnu.org> (raw)
In-Reply-To: <83B8FE6B-7C87-4D79-AF1A-2A0D265632C5@gmail.com> (message from Yuan Fu on Tue, 9 Apr 2024 23:03:21 -0700)
> From: Yuan Fu <casouri@gmail.com>
> Date: Tue, 9 Apr 2024 23:03:21 -0700
> Cc: 68956@debbugs.gnu.org
>
> [Adding the bug tracker back, forgot to replay-all]
And it might be a good idea to add Dominique as well ;-)
>
> > On Apr 8, 2024, at 8:42 PM, Yuan Fu <casouri@gmail.com> wrote:
> >
> >
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> >>> Cc: 68956@debbugs.gnu.org
> >>> Date: Sat, 10 Feb 2024 10:44:01 +0200
> >>> From: Eli Zaretskii <eliz@gnu.org>
> >>>
> >>>> From: Dominique Quatravaux <dominique@quatravaux.org>
> >>>> Date: Tue, 6 Feb 2024 18:32:27 +0100
> >>>>
> >>>> When invoking `prog-fill-reindent-defun' from inside a bash-ts-mode buffer, an exception (regardless of where
> >>>> point is), an error is raised that reads
> >>>>
> >>>> Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
> >>>>
> >>>> Investigation reveals that `prog-fill-reindent-defun' calls `treesit-node-match-p' with 'text as the second
> >>>> argument, which can only succeed if `(assq 'text (assq 'bash treesit-thing-settings))' is non-nil; whereas the
> >>>> corresponding setting for `treesit-thing-settings' prepared by `bash-ts-mode', doesn't provide a value for 'text
> >>>> (only for 'sentence).
> >>>>
> >>>> I had success applying the following workaround:
> >>>>
> >>>> (advice-add 'bash-ts-mode
> >>>> :after (lambda (&rest ignored)
> >>>> (when-let ((bash-things (assq 'bash treesit-thing-settings)))
> >>>> (setf (alist-get 'text (cdr bash-things)) '(sentence)))))
> >>>>
> >>>> Now M-q does the right thing for me everywhere in bash-ts-mode.
> >>>
> >>> Yuan, any comments or ideas?
> >>>
> >>> Thanks.
> >
> > Sorry for the delay. Dominique, what version are you using? I can see
> > that this is fixed on master[1], but not on emacs-29, perhaps due to
> > the size of the change.
> >
> > [1] b392d05089014ac6d41e35a016d46f496964f879
> >
> > Yuan
>
>
next prev parent reply other threads:[~2024-04-10 10:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <27A9A540-66CC-4017-AC7A-5D8937A780B4@gmail.com>
2024-04-10 6:03 ` bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil Yuan Fu
2024-04-10 10:51 ` Eli Zaretskii [this message]
2024-04-20 7:45 ` Eli Zaretskii
2024-04-22 10:53 ` Dominique Quatravaux
2024-04-22 10:55 ` Eli Zaretskii
2024-02-06 17:32 Dominique Quatravaux
2024-02-06 17:44 ` bug#68956: Workaround Dominique Quatravaux
2024-02-10 8:44 ` bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil Eli Zaretskii
2024-02-24 9:32 ` Eli Zaretskii
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=865xwpwkwa.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=68956@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=dominique@quatravaux.org \
/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.