all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#66400: [PATCH] Fix 'treesit-query-validate'
@ 2023-10-08  2:55 nvp
  2023-10-08 22:59 ` Yuan Fu
  0 siblings, 1 reply; 6+ messages in thread
From: nvp @ 2023-10-08  2:55 UTC (permalink / raw)
  To: 66400


[-- Attachment #1.1: Type: text/plain, Size: 945 bytes --]

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'

[-- Attachment #1.2: Type: text/html, Size: 1051 bytes --]

[-- Attachment #2: 0001-fix-dont-expand-string-query-in-treesit-query-valida.patch --]
[-- Type: text/x-patch, Size: 858 bytes --]

From 2583a37af1aa4b33649b74ce5f148cd8521de5b9 Mon Sep 17 00:00:00 2001
From: nverno <noah.v.peart@gmail.com>
Date: Sat, 7 Oct 2023 19:36:44 -0700
Subject: [PATCH] fix: dont expand string query in treesit-query-validate

---
 lisp/treesit.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 402417c6ca9..048cdd4e594 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2889,7 +2889,7 @@ treesit-query-validate
                   (start (nth 1 data))
                   (inhibit-read-only t))
              (erase-buffer)
-             (insert (treesit-query-expand query))
+             (insert (if (stringp query) query (treesit-query-expand query)))
              (goto-char start)
              (search-forward " " nil t)
              (put-text-property start (point) 'face 'error)
-- 
2.34.1


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

* bug#66400: [PATCH] Fix 'treesit-query-validate'
  2023-10-08  2:55 bug#66400: [PATCH] Fix 'treesit-query-validate' nvp
@ 2023-10-08 22:59 ` Yuan Fu
       [not found]   ` <CAPVBTSe2RuoTiCibpBPu9koqVN0GaKCJJCEF1L25qT-R5_waQQ@mail.gmail.com>
  2023-10-09  2:35   ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Yuan Fu @ 2023-10-08 22:59 UTC (permalink / raw)
  To: nvp; +Cc: 66400



> On Oct 7, 2023, at 7:55 PM, nvp <noah.v.peart@gmail.com> wrote:
> 
> 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.

Thank you very much! May I ask whether you have signed the copyright assignment? Though for this patch, the assignment isn’t needed, since it changes 2 lines, well within the 15 lines limit for the exempt.

Yuan




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

* bug#66400: [PATCH] Fix 'treesit-query-validate'
       [not found]   ` <CAPVBTSe2RuoTiCibpBPu9koqVN0GaKCJJCEF1L25qT-R5_waQQ@mail.gmail.com>
@ 2023-10-09  0:35     ` Yuan Fu
  0 siblings, 0 replies; 6+ messages in thread
From: Yuan Fu @ 2023-10-09  0:35 UTC (permalink / raw)
  To: nvp; +Cc: Eli Zaretskii, 66400

(Adding emacs-debbugs to CC)

> On Oct 8, 2023, at 5:22 PM, nvp <noah.v.peart@gmail.com> wrote:
> 
> Hi Yuan,
> I believe I have, through contributions to ESS in the past.  Is there somewhere I can check?
> Thankyou

Great! Eli can check it for you.

Yuan




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

* bug#66400: [PATCH] Fix 'treesit-query-validate'
  2023-10-08 22:59 ` Yuan Fu
       [not found]   ` <CAPVBTSe2RuoTiCibpBPu9koqVN0GaKCJJCEF1L25qT-R5_waQQ@mail.gmail.com>
@ 2023-10-09  2:35   ` Eli Zaretskii
  2023-10-09  4:24     ` nvp
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-10-09  2:35 UTC (permalink / raw)
  To: Yuan Fu; +Cc: noah.v.peart, 66400

> Cc: 66400@debbugs.gnu.org
> From: Yuan Fu <casouri@gmail.com>
> Date: Sun, 8 Oct 2023 15:59:55 -0700
> 
> > * lisp/treesit.el (treesit-query-validate): Only expand sexp queries
> > before insertion into query error buffer.
> 
> Thank you very much! May I ask whether you have signed the copyright assignment? Though for this patch, the assignment isn’t needed, since it changes 2 lines, well within the 15 lines limit for the exempt.

Noah's assignment is on file.





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

* bug#66400: [PATCH] Fix 'treesit-query-validate'
  2023-10-09  2:35   ` Eli Zaretskii
@ 2023-10-09  4:24     ` nvp
  2023-10-09  5:05       ` Yuan Fu
  0 siblings, 1 reply; 6+ messages in thread
From: nvp @ 2023-10-09  4:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Yuan Fu, 66400

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

Thankyou both!

On Sun, Oct 8, 2023 at 7:35 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > Cc: 66400@debbugs.gnu.org
> > From: Yuan Fu <casouri@gmail.com>
> > Date: Sun, 8 Oct 2023 15:59:55 -0700
> >
> > > * lisp/treesit.el (treesit-query-validate): Only expand sexp queries
> > > before insertion into query error buffer.
> >
> > Thank you very much! May I ask whether you have signed the copyright
> assignment? Though for this patch, the assignment isn’t needed, since it
> changes 2 lines, well within the 15 lines limit for the exempt.
>
> Noah's assignment is on file.
>

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

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

* bug#66400: [PATCH] Fix 'treesit-query-validate'
  2023-10-09  4:24     ` nvp
@ 2023-10-09  5:05       ` Yuan Fu
  0 siblings, 0 replies; 6+ messages in thread
From: Yuan Fu @ 2023-10-09  5:05 UTC (permalink / raw)
  To: nvp; +Cc: 66400-done, Eli Zaretskii



> On Oct 8, 2023, at 9:24 PM, nvp <noah.v.peart@gmail.com> wrote:
> 
> Thankyou both!
> 
> On Sun, Oct 8, 2023 at 7:35 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > Cc: 66400@debbugs.gnu.org
> > From: Yuan Fu <casouri@gmail.com>
> > Date: Sun, 8 Oct 2023 15:59:55 -0700
> > 
> > > * lisp/treesit.el (treesit-query-validate): Only expand sexp queries
> > > before insertion into query error buffer.
> > 
> > Thank you very much! May I ask whether you have signed the copyright assignment? Though for this patch, the assignment isn’t needed, since it changes 2 lines, well within the 15 lines limit for the exempt.
> 
> Noah's assignment is on file.

Merged, thank you!

Yuan




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

end of thread, other threads:[~2023-10-09  5:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08  2:55 bug#66400: [PATCH] Fix 'treesit-query-validate' nvp
2023-10-08 22:59 ` Yuan Fu
     [not found]   ` <CAPVBTSe2RuoTiCibpBPu9koqVN0GaKCJJCEF1L25qT-R5_waQQ@mail.gmail.com>
2023-10-09  0:35     ` Yuan Fu
2023-10-09  2:35   ` Eli Zaretskii
2023-10-09  4:24     ` nvp
2023-10-09  5:05       ` Yuan Fu

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.