GNU bug report logs - #65098
29.1.50; treesit-query-capture in an interactive function has no effect?

Previous Next

Package: emacs;

Reported by: 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>

Date: Sat, 5 Aug 2023 13:49:01 UTC

Severity: normal

Tags: notabug

Found in version 29.1.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65098 in the body.
You can then email your comments to 65098 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#65098; Package emacs. (Sat, 05 Aug 2023 13:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 05 Aug 2023 13:49:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 29.1.50; treesit-query-capture in an interactive function has no
 effect?
Date: Sat, 5 Aug 2023 13:43:31 +0000
[Message part 1 (text/plain, inline)]
--text follows this line--

I have a test function as following:

(defun treesit-context-test-query ()
  (interactive)
  (treesit-query-capture (treesit-buffer-root-node) '((if_statement consequence: (_) @context.end) @context)))


I expected this function would return all =if statement= in a java buffer.

But if I invoke it from M-x, it doesn't print anything in *Message* buffer.

If I call it from M-:(aka. eval-expression), it does print something.


Is there a bug here? If not, how should I use it correctly? Thanks.


How to reproduce:

0. install java tree-sitter parser

1. emacs -Q

2. open a java file

3. enable java-ts-mode

4. call the function interactively from M-x




In GNU Emacs 29.1.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d
 scroll bars) of 2023-08-04 built on tux
Repository revision: 8cbd4a02a2b9823a6aa7e722af6e3d204f881aed
Repository branch: makepkg
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Manjaro Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-modules --without-libotf --without-m17n-flt --without-gconf
 --with-native-compilation=no --with-xinput2 --with-x-toolkit=lucid
 --with-xft --with-xaw3d --without-cairo --with-sound=no
 --with-tree-sitter --without-gpm --without-compress-install
 '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
ACL DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2
LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE
XFT XIM XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LC_MONETARY: zh_CN.UTF-8
  value of $LC_NUMERIC: zh_CN.UTF-8
  value of $LC_TIME: zh_CN.UTF-8
  value of $LANG: zh_CN.UTF-8
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: Java

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
java-ts-mode c-ts-common treesit cl-seq vc-git diff-mode easy-mmode
vc-dispatcher cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib china-util rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting x-toolkit xinput2 x multi-tty make-network-process
emacs)

Memory information:
((conses 16 70348 9640)
 (symbols 48 7693 0)
 (strings 32 23042 2533)
 (string-bytes 1 809783)
 (vectors 16 14358)
 (vector-slots 8 248208 8162)
 (floats 8 28 23)
 (intervals 56 1870 0)
 (buffers 984 14))


[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65098; Package emacs. (Sat, 05 Aug 2023 15:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 65098 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 赵 纪阳<zjyzhaojiyang <at> hotmail.com>
Cc: 65098 <at> debbugs.gnu.org
Subject: Re: bug#65098: 29.1.50;
 treesit-query-capture in an interactive function has no effect?
Date: Sat, 05 Aug 2023 18:31:01 +0300
tags 65098 notabug
thanks

> From: 赵 纪阳
>  <zjyzhaojiyang <at> hotmail.com>
> Date: Sat, 5 Aug 2023 13:43:31 +0000
> 
> I have a test function as following:
> 
> (defun treesit-context-test-query ()
>   (interactive)
>   (treesit-query-capture (treesit-buffer-root-node) '((if_statement consequence: (_) @context.end)
> @context)))
> 
> I expected this function would return all =if statement= in a java buffer. 
> 
> But if I invoke it from M-x, it doesn't print anything in *Message* buffer.
> 
> If I call it from M-:(aka. eval-expression), it does print something. 
> 
> Is there a bug here? If not, how should I use it correctly? Thanks.

You need to display the value the function returns, e.g., with
'message'.

There's no bug here.




Added tag(s) notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 05 Aug 2023 15:31:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65098; Package emacs. (Sun, 06 Aug 2023 01:21:01 GMT) Full text and rfc822 format available.

Message #13 received at 65098 <at> debbugs.gnu.org (full text, mbox):

From: 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "65098 <at> debbugs.gnu.org" <65098 <at> debbugs.gnu.org>
Subject: 回复: bug#65098: 29.1.50; treesit-query-capture in an interactive function has no effect?
Date: Sun, 6 Aug 2023 01:20:15 +0000
[Message part 1 (text/plain, inline)]
Got it. Thanks.
Sorry for the noise, I should've tested more to make sure it's a real bug.
________________________________
发件人: Eli Zaretskii <eliz <at> gnu.org>
发送时间: 2023年8月5日 23:30
收件人: 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>
抄送: 65098 <at> debbugs.gnu.org <65098 <at> debbugs.gnu.org>
主题: Re: bug#65098: 29.1.50; treesit-query-capture in an interactive function has no effect?

tags 65098 notabug
thanks

> From: 赵 纪阳
>  <zjyzhaojiyang <at> hotmail.com>
> Date: Sat, 5 Aug 2023 13:43:31 +0000
>
> I have a test function as following:
>
> (defun treesit-context-test-query ()
>   (interactive)
>   (treesit-query-capture (treesit-buffer-root-node) '((if_statement consequence: (_) @context.end)
> @context)))
>
> I expected this function would return all =if statement= in a java buffer.
>
> But if I invoke it from M-x, it doesn't print anything in *Message* buffer.
>
> If I call it from M-:(aka. eval-expression), it does print something.
>
> Is there a bug here? If not, how should I use it correctly? Thanks.

You need to display the value the function returns, e.g., with
'message'.

There's no bug here.
[Message part 2 (text/html, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 06 Aug 2023 05:05:02 GMT) Full text and rfc822 format available.

Notification sent to 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>:
bug acknowledged by developer. (Sun, 06 Aug 2023 05:05:02 GMT) Full text and rfc822 format available.

Message #18 received at 65098-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>
Cc: 65098-done <at> debbugs.gnu.org
Subject: Re: 
 回复: bug#65098: 29.1.50; treesit-query-capture in an
 interactive function has no effect?
Date: Sun, 06 Aug 2023 08:05:01 +0300
> From: 赵 纪阳 <zjyzhaojiyang <at> hotmail.com>
> CC: "65098 <at> debbugs.gnu.org" <65098 <at> debbugs.gnu.org>
> Date: Sun, 6 Aug 2023 01:20:15 +0000
> 
> 
> Got it. Thanks. 
> Sorry for the noise, I should've tested more to make sure it's a real bug. 

Thanks, closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Sep 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.