From: Eli Zaretskii <eliz@gnu.org>
To: Dominique Quatravaux <dominique@quatravaux.org>,
Yuan Fu <casouri@gmail.com>
Cc: 68956@debbugs.gnu.org
Subject: bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
Date: Sat, 10 Feb 2024 10:44:01 +0200 [thread overview]
Message-ID: <864jegvhda.fsf@gnu.org> (raw)
In-Reply-To: <CA+tDuRwYC4Lx4Y_6v-iEPEOM5a9=0o2R6LDU4OhWGUORzt1rJQ@mail.gmail.com> (message from Dominique Quatravaux on Tue, 6 Feb 2024 18:44:18 +0100)
> 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.
next prev parent reply other threads:[~2024-02-10 8:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 17:32 bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil Dominique Quatravaux
2024-02-06 17:44 ` bug#68956: Workaround Dominique Quatravaux
2024-02-10 8:44 ` Eli Zaretskii [this message]
2024-02-24 9:32 ` bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil Eli Zaretskii
[not found] <27A9A540-66CC-4017-AC7A-5D8937A780B4@gmail.com>
2024-04-10 6:03 ` Yuan Fu
2024-04-10 10:51 ` Eli Zaretskii
2024-04-20 7:45 ` Eli Zaretskii
2024-04-22 10:53 ` Dominique Quatravaux
2024-04-22 10:55 ` 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=864jegvhda.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.