From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68956: M-q =?UTF-8?Q?=E2=86=92?= Invalid predicate, see =?UTF-8?Q?=E2=80=98treesit-thing-settings=E2=80=99?= for valid forms for a predicate: nil Date: Sat, 20 Apr 2024 10:45:19 +0300 Message-ID: <86bk64a35c.fsf@gnu.org> References: <27A9A540-66CC-4017-AC7A-5D8937A780B4@gmail.com> <83B8FE6B-7C87-4D79-AF1A-2A0D265632C5@gmail.com> <865xwpwkwa.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1805"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68956@debbugs.gnu.org, casouri@gmail.com To: dominique@quatravaux.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 20 09:46:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ry5QF-0000IR-JD for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Apr 2024 09:46:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ry5Pz-0006U6-2R; Sat, 20 Apr 2024 03:45:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ry5Pw-0006TV-FG for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 03:45:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ry5Pv-0008Dd-PE for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 03:45:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ry5QA-0005r5-B5 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 03:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Apr 2024 07:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68956 X-GNU-PR-Package: emacs Original-Received: via spool by 68956-submit@debbugs.gnu.org id=B68956.171359914822423 (code B ref 68956); Sat, 20 Apr 2024 07:46:02 +0000 Original-Received: (at 68956) by debbugs.gnu.org; 20 Apr 2024 07:45:48 +0000 Original-Received: from localhost ([127.0.0.1]:34872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry5Pv-0005pZ-8K for submit@debbugs.gnu.org; Sat, 20 Apr 2024 03:45:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry5Ps-0005oF-3y for 68956@debbugs.gnu.org; Sat, 20 Apr 2024 03:45:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ry5PY-0008AX-0k; Sat, 20 Apr 2024 03:45:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=DALcZbJ+zY0SccGlfZC4pxm+zViaU0zFB59h+V8DUlc=; b=NjPjauc3mfr6GnHhx5qS rMtIz7SjL6BTqvGmUIQy45nY4nLlF79x/cyCw0m1WmdJ/Dpwz7TwFb5+xt5O3dKPQeeM9+NUabOie oeoOotzNavZUlw3KftyfF2V0SCaSgGMISk1Niz+5tLBr/3W2Q1iOH9MFKLxQsRsgC6iTXjswPjqdm +xliCa503WIyz+LrUn3FI7/IMFju2xR7rvNoRrXBA9Rh8tpjjmFKGAxZBb+nrjZSulVvZiRblPuG9 FxFNe36hx/vbT5kpaqjFntdaxkajx8zEnCTfKuwTQpr/UTTusQPKAGN7aohQFruYUX/EI8vKU5z6O 9XneWbvTFLWQ6Q==; In-Reply-To: <865xwpwkwa.fsf@gnu.org> (message from Eli Zaretskii on Wed, 10 Apr 2024 13:51:33 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283717 Archived-At: 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 > > > From: Yuan Fu > > 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 wrote: > > > > > > > > > Eli Zaretskii writes: > > > > > >>> Cc: 68956@debbugs.gnu.org > > >>> Date: Sat, 10 Feb 2024 10:44:01 +0200 > > >>> From: Eli Zaretskii > > >>> > > >>>> From: Dominique Quatravaux > > >>>> 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 > > > > > > > >