emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71086: closed (30.0.50; Setting treesit-indent-function is not effec


From: GNU bug Tracking System
Subject: bug#71086: closed (30.0.50; Setting treesit-indent-function is not effective is treesit-simple-indent-rules is nil)
Date: Sun, 02 Jun 2024 16:56:02 +0000

Your message dated Sun, 02 Jun 2024 18:55:10 +0200
with message-id <87r0df709d.fsf@telefonica.net>
and subject line Re: bug#71086: 30.0.50; Setting treesit-indent-function is not 
effective is treesit-simple-indent-rules is nil
has caused the debbugs.gnu.org bug report #71086,
regarding 30.0.50; Setting treesit-indent-function is not effective is 
treesit-simple-indent-rules is nil
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
71086: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71086
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; Setting treesit-indent-function is not effective is treesit-simple-indent-rules is nil Date: Tue, 21 May 2024 03:32:05 +0200
treesit-major-mode-setup setups indentation if and only if
treesit-simple-indent-rules is non-nil. So the major mode author is
forced to set that variable even when he makes no use of the
treesit-simple-indent facilities and instead sets
treesit-indent-function to his own function.

Having to assign a dummy value to a variable that belongs to an API that
is not used is surprising. Furthermore, it is unspecified what kind of
values are acceptable on that scenario.

I would expect that treesit-major-mode-setup shall setup indentation
when treesit-indent-function is non-nil.

OTOH, the info node for "Parser-based Indentation" says:

     To enable the parser-based indentation engine, either set
  ‘treesit-simple-indent-rules’ and call ‘treesit-major-mode-setup’, or
  equivalently, set the value of ‘indent-line-function’ to
  ‘treesit-indent’.

However, treesit-major-mode-setup does more than what's described after
"equivalently":

  (when treesit-simple-indent-rules
    (setq-local treesit-simple-indent-rules
                (treesit--indent-rules-optimize
                 treesit-simple-indent-rules))
    (setq-local indent-line-function #'treesit-indent)
    (setq-local indent-region-function #'treesit-indent-region))



In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.0) of 2024-05-19 built on sky
Repository revision: 98b83bdc9f4af7798e3314ad8df6ab78efd60f8a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure --with-native-compilation --without-toolkit-scroll-bars
 --with-x-toolkit=lucid --with-modules --without-imagemagick'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBOTF
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2
XPM LUCID ZLIB

Important settings:
  value of $LANG: C
  locale-coding-system: nil



--- End Message ---
--- Begin Message --- Subject: Re: bug#71086: 30.0.50; Setting treesit-indent-function is not effective is treesit-simple-indent-rules is nil Date: Sun, 02 Jun 2024 18:55:10 +0200 User-agent: Gnus/5.13 (Gnus v5.13)
As the issues reported here are solved, I'm closing the bug.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]