From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: nvp Newsgroups: gmane.emacs.bugs Subject: bug#66400: [PATCH] Fix 'treesit-query-validate' Date: Sat, 7 Oct 2023 19:55:27 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000c3f7a206072b9b75" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11540"; mail-complaints-to="usenet@ciao.gmane.io" To: 66400@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 08 04:57:08 2023 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 1qpJyd-0002nl-J6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Oct 2023 04:57:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpJyG-00068J-Db; Sat, 07 Oct 2023 22:56:44 -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 1qpJyF-000687-2z for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 22:56:43 -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 1qpJyE-00078i-Rb for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 22:56:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpJyY-0000yj-Cp for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 22:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: nvp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Oct 2023 02:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66400 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16967337693693 (code B ref -1); Sun, 08 Oct 2023 02:57:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Oct 2023 02:56:09 +0000 Original-Received: from localhost ([127.0.0.1]:56083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpJxh-0000xT-0D for submit@debbugs.gnu.org; Sat, 07 Oct 2023 22:56:09 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:34286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpJxf-0000x5-AQ for submit@debbugs.gnu.org; Sat, 07 Oct 2023 22:56:07 -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 1qpJxG-00064a-3n for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 22:55:42 -0400 Original-Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpJxE-00072a-DP for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 22:55:41 -0400 Original-Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1e5bc692721so405594fac.0 for ; Sat, 07 Oct 2023 19:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696733738; x=1697338538; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=sermD5+O8iWwTwwQCc83vplxPSRFmTb7Y9GAnWuhYr8=; b=V7rHoM+WysZUxBHRSScztrg5Tx8JgMtzINgS21SVVzLJgvkGaBUBYAe449UjhJR5gT EVmvg0KRqHi2nzo+8Oh5QfbUMAmY1N9wicS/4WnxaFvo/+AqKVBDNagBa6YkBIRASaD2 FWTI5uAWovGvnl9p/0lkgjsdN08nb+KonTCIgXAgZLWOzfBvh7wE1r3mNjmdXlXjctIr N8DNkYXPGs1Kj/8r0ce/Unpyw2tI1hKd9A/U/qzgvodl9VFcIlHvY7OCRogYCP0EfK2i NaNDH+2RIKAau3E9Y+KYdrkbNp4uZn106dFXgYUNu5pz03sXMfAhVo5inZd9MAUhedoY s61g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696733738; x=1697338538; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sermD5+O8iWwTwwQCc83vplxPSRFmTb7Y9GAnWuhYr8=; b=JFLLZS69WeGVIVC19m+GzxebVFM87g4GOFP9f1Npmk0ElGSnQNDGTguyXYFPNwQSm+ XVyLJYWEQ9Rs2f9v6OGnay/ovYBHMs7f+QszFAYFotE+bvwtaJMJBASrdq38BxLmXUvz uXJdL/zgJYXf1WN5QH+awFkRWZhqzOznyQFqk4P390y2jGeP2L0zEy6S5x9Zd9cJwCAa rpMh1VWje9wzebu2cw1BWIfhvw9q77kv16+37QVezqKUzlu5kBkiFDY8lgTmGdY7p/CB UPwSLuqzHEPSt99+tA+Wu0v7iFQdYEq/7Msq/7afeokA3uZziiM91dOzwOahhsA7Yxjl quGg== X-Gm-Message-State: AOJu0YxC/01mOsG9YcBaGYCqxUdjf79wkKLV5RmM83nctoM2M+WRF8RB d4/A6r0BhTtLtII+O/kxd4fcOfqHJ40nXf1KqgWFOcjnOPLYTvt9 X-Google-Smtp-Source: AGHT+IGJUREgHoOt9Xy+xVcE478/yQbmZ39rAfiW3sWqzg4bOHF+jtj/GVsKe3mM6GcMhnHPrBeWJd/hcQ7NQm7YdXo= X-Received: by 2002:a05:6870:164f:b0:1ba:6180:ff47 with SMTP id c15-20020a056870164f00b001ba6180ff47mr13634836oae.21.1696733738535; Sat, 07 Oct 2023 19:55:38 -0700 (PDT) Received-SPF: pass client-ip=2001:4860:4864:20::36; envelope-from=noah.v.peart@gmail.com; helo=mail-oa1-x36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:272054 Archived-At: --000000000000c3f7a206072b9b75 Content-Type: multipart/alternative; boundary="000000000000c3f7a006072b9b73" --000000000000c3f7a006072b9b73 Content-Type: text/plain; charset="UTF-8" Tags: patch Bug: when calling `treesit-query-validate` interactively, the query is expanded with `treesit-query-expand`, despite being a string. This produces unreadable output in the error message buffer. * lisp/treesit.el (treesit-query-validate): Only expand sexp queries before insertion into query error buffer. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2023-10-05 built on noah-X580VD Repository revision: 505c80623049d9e181918acdac8229c9a2041b1e Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Ubuntu 22.04.3 LTS Configured using: 'configure --prefix=/usr/local --with-modules --with-tree-sitter --with-threads --with-x-toolkit=gtk3 --with-xwidgets --with-gnutls --with-json --with-mailutils --with-jpeg --with-png --with-rsvg --with-tiff --with-xml2 --with-xpm --with-imagemagick CC=gcc-12 CXX=gcc-12' --000000000000c3f7a006072b9b73 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Tags: patch

Bug: when calling `treesit-query-valida= te` interactively,
the query is expanded with `treesit-query-expand`, de= spite being a
string. This produces unreadable output in the error messa= ge buffer.

* lisp/treesit.el (treesit-query-validate): Only expand s= exp queries
before insertion into query error buffer.

In GNU Emac= s 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo ver= sion 1.16.0) of 2023-10-05 built on noah-X580VD
Repository revision: 505= c80623049d9e181918acdac8229c9a2041b1e
Repository branch: master
Windo= wing system distributor 'The X.Org Foundation', version 11.0.121010= 04
System Description: Ubuntu 22.04.3 LTS

Configured using:
= =C2=A0'configure --prefix=3D/usr/local --with-modules --with-tree-sitte= r
--with-threads --with-x-toolkit=3Dgtk3 --with-xwidgets --with-gnutls--with-json --with-mailutils --with-jpeg --with-png --with-rsvg
--with= -tiff --with-xml2 --with-xpm --with-imagemagick CC=3Dgcc-12
CXX=3Dgcc-12= '
--000000000000c3f7a006072b9b73-- --000000000000c3f7a206072b9b75 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-fix-dont-expand-string-query-in-treesit-query-valida.patch" Content-Disposition: attachment; filename="0001-fix-dont-expand-string-query-in-treesit-query-valida.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lngvfhl90 RnJvbSAyNTgz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