unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
@ 2024-02-06 17:32 Dominique Quatravaux
  2024-02-06 17:44 ` bug#68956: Workaround Dominique Quatravaux
  0 siblings, 1 reply; 8+ messages in thread
From: Dominique Quatravaux @ 2024-02-06 17:32 UTC (permalink / raw)
  To: 68956

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]

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).

--
 Dominique Quatravaux
 dominique@quatravaux.org

[-- Attachment #2: Type: text/html, Size: 942 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
  2024-02-06 17:44 ` bug#68956: Workaround Dominique Quatravaux
@ 2024-02-10  8:44   ` Eli Zaretskii
  2024-02-24  9:32     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-02-10  8:44 UTC (permalink / raw)
  To: Dominique Quatravaux, Yuan Fu; +Cc: 68956

> 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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
  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
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2024-02-24  9:32 UTC (permalink / raw)
  To: casouri; +Cc: dominique, 68956

Ping!  Yuan, any comments?

> 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.
> 
> 
> 
> 





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
       [not found] <27A9A540-66CC-4017-AC7A-5D8937A780B4@gmail.com>
@ 2024-04-10  6:03 ` Yuan Fu
  2024-04-10 10:51   ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Yuan Fu @ 2024-04-10  6:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 68956

[Adding the bug tracker back, forgot to replay-all]

> 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






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
  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
  2024-04-20  7:45     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-04-10 10:51 UTC (permalink / raw)
  To: Yuan Fu, Dominique Quatravaux; +Cc: 68956

> 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
> 
> 





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
  2024-04-10 10:51   ` Eli Zaretskii
@ 2024-04-20  7:45     ` Eli Zaretskii
  2024-04-22 10:53       ` Dominique Quatravaux
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-04-20  7:45 UTC (permalink / raw)
  To: dominique; +Cc: 68956, casouri

Ping!  Dominique, could you please answer Yuan's question below?

> Cc: 68956@debbugs.gnu.org
> Date: Wed, 10 Apr 2024 13:51:33 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > 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
> > 
> > 
> 
> 
> 
> 





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
  2024-04-20  7:45     ` Eli Zaretskii
@ 2024-04-22 10:53       ` Dominique Quatravaux
  2024-04-22 10:55         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Dominique Quatravaux @ 2024-04-22 10:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 68956, casouri

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

Le sam. 20 avr. 2024 à 09:45, Eli Zaretskii <eliz@gnu.org> a écrit :

> Ping!  Dominique, could you please answer Yuan's question below?
>


Dear Eli, dear Yuan, I just rebuilt my Emacs to version
4d9629b087fe6df941b553c6931b2f8996901e21 and indeed M-q doesn't crash
anymore.

Please feel free to close bug#68956.

Many thanks,

--
 Dominique Quatravaux
 dominique@quatravaux.org

[-- Attachment #2: Type: text/html, Size: 906 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#68956: M-q → Invalid predicate, see ‘treesit-thing-settings’ for valid forms for a predicate: nil
  2024-04-22 10:53       ` Dominique Quatravaux
@ 2024-04-22 10:55         ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2024-04-22 10:55 UTC (permalink / raw)
  To: Dominique Quatravaux; +Cc: casouri, 68956-done

> From: Dominique Quatravaux <dominique@quatravaux.org>
> Date: Mon, 22 Apr 2024 12:53:52 +0200
> Cc: casouri@gmail.com, 68956@debbugs.gnu.org
> 
> Le sam. 20 avr. 2024 à 09:45, Eli Zaretskii <eliz@gnu.org> a écrit :
> 
>  Ping!  Dominique, could you please answer Yuan's question below?
> 
> Dear Eli, dear Yuan, I just rebuilt my Emacs to version 4d9629b087fe6df941b553c6931b2f8996901e21 and
> indeed M-q doesn't crash anymore.
> 
> Please feel free to close bug#68956.

Thanks, closing.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-22 10:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).