Subject: bug#67007: closed (Re: bug#67007: 29.1.90; treesit-simple-indent-presets example on match)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 09 Nov 2023 07:51:02 +0000

Your bug report

#67007: 29.1.90; treesit-simple-indent-presets example on match

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
67007: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67007
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#67007: 29.1.90; treesit-simple-indent-presets example on match
From: Yuan Fu <[email-masked]>
To: Maxim Kim <[email-masked]>
Cc: [email-masked]
Date: Wed, 8 Nov 2023 23:50:01 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

> On Nov 8, 2023, at 6:40 PM, Maxim Kim <[email-masked]> wrote:
> 
> 
> While trying to play with treesit indent rules I came across
> `treesit-simple-indent-presets' where I believe example given is wrong:
> 
> C-x o treesit-simple-indent-presets RET
> ----
> (match NODE-TYPE PARENT-TYPE NODE-FIELD NODE-INDEX-MIN NODE-INDEX-MAX)
> 
>    NODE-TYPE checks for NODE’s type, PARENT-TYPE checks for
>    PARENT’s type, NODE-FIELD checks for the field name of NODE
>    in PARENT, NODE-INDEX-MIN and NODE-INDEX-MAX check for
>    NODE’s index in PARENT.  Therefore, to match the first child
>    where PARENT is "argument_list", use
> 
>        (match nil "argument_list" nil nil 0 0).
> ----
> 
> (match NODE-TYPE PARENT-TYPE     NODE-FIELD NODE-INDEX-MIN NODE-INDEX-MAX)
> (match nil       "argument_list" nil        nil            0               0).
> 
> 5 args in signature vs 6 in example.

Good catch. I fixed it on emacs-29. Thank you!

Yuan

Subject: 29.1.90; treesit-simple-indent-presets example on match
From: Maxim Kim <[email-masked]>
To: [email-masked]
Date: Thu, 09 Nov 2023 13:40:21 +1100
List-Id: <debbugs-submit.debbugs.gnu.org>

While trying to play with treesit indent rules I came across
`treesit-simple-indent-presets' where I believe example given is wrong:

C-x o treesit-simple-indent-presets RET
----
(match NODE-TYPE PARENT-TYPE NODE-FIELD NODE-INDEX-MIN NODE-INDEX-MAX)

    NODE-TYPE checks for NODE’s type, PARENT-TYPE checks for
    PARENT’s type, NODE-FIELD checks for the field name of NODE
    in PARENT, NODE-INDEX-MIN and NODE-INDEX-MAX check for
    NODE’s index in PARENT.  Therefore, to match the first child
    where PARENT is "argument_list", use

        (match nil "argument_list" nil nil 0 0).
----

(match NODE-TYPE PARENT-TYPE     NODE-FIELD NODE-INDEX-MIN NODE-INDEX-MAX)
(match nil       "argument_list" nil        nil            0               0).

5 args in signature vs 6 in example.

In GNU Emacs 29.1.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.16.0) of 2023-10-20 built on AUWW00125
Repository revision: 62920dcb0de440aac8e7d69ee33f27d5400d405e
Repository branch: emacs-29
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --prefix=/home/habamax/.local --with-pgtk
 --with-native-compilation=aot --with-json --with-tree-sitter'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
  marginalia-mode: t
  vertico-mode: t
  winner-mode: t
  override-global-mode: t
  pixel-scroll-precision-mode: t
  savehist-mode: t
  save-place-mode: t
  delete-selection-mode: t
  electric-pair-mode: t
  repeat-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  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
  isearch-fold-quotes-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
/home/habamax/.config/emacs/elpa/transient-20231103.2312/transient hides /home/habamax/.local/share/emacs/29.1.90/lisp/transient

Features:
(shadow sort emacsbug mail-extr message sendmail yank-media dired
dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev gmm-utils mailheader pp cl-print habamax-gdscript
gdscript-mode gdscript-eglot gdscript-hydra gdscript-godot
gdscript-project gdscript-history gdscript-comint gdscript-debug bindat
gdscript-format gdscript-comint-gdformat gdscript-completion
gdscript-fill-paragraph gdscript-imenu gdscript-indent-and-nav
gdscript-rx gdscript-utils gdscript-syntax inline gdscript-keywords
gdscript-docs habamax-eww eww xdg url-queue shr pixel-fill kinsoku
url-file svg xml dom puny mm-url gnus nnheader gnus-util mail-utils
range mm-util mail-prsvr gdscript-customization gdscript-ts-mode derived
shortdoc treesit mule-util thingatpt help-fns radix-tree add-log
log-view pcvs-util compile text-property-search vc vc-git diff-mode
vc-dispatcher orderless comp comp-cstr warnings icons time term/xterm
xterm rainbow-delimiters disp-table whitespace company-oddmuse
company-keywords company-etags etags fileloop generator xref project
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb company use-package-diminish marginalia
vertico compat finder-inf diminish winner use-package-ensure edmacro
kmacro cl-extra help-mode use-package-bind-key bind-key easy-mmode
use-package-core pixel-scroll cua-base savehist saveplace delsel
elec-pair repeat tramp-cache time-stamp tramp-sh tramp tramp-loaddefs
trampver tramp-integration files-x tramp-compat rx shell pcomplete
comint ansi-osc ring parse-time iso8601 time-date format-spec ansi-color
recentf tree-widget wid-edit company-autoloads devdocs-autoloads
diminish-autoloads elfeed-autoloads embark-autoloads emms-autoloads
gdscript-mode-autoloads htmlize-autoloads iedit-autoloads
magit-autoloads pcase git-commit-autoloads magit-section-autoloads
dash-autoloads marginalia-autoloads markdown-mode-autoloads
orderless-autoloads rainbow-delimiters-autoloads rainbow-mode-autoloads
sly-autoloads tempel-autoloads transient-autoloads verb-autoloads
vertico-autoloads webpaste-autoloads request-autoloads wgrep-autoloads
with-editor-autoloads info compat-autoloads xclip-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs
cl-lib nocharm-p-theme rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/pgtk-win pgtk-win term/common-win pgtk-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
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 308567 149303)
 (symbols 48 20983 10)
 (strings 32 71158 9845)
 (string-bytes 1 2880013)
 (vectors 16 34669)
 (vector-slots 8 623575 243279)
 (floats 8 240 350)
 (intervals 56 1713 204)
 (buffers 984 16))