unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
@ 2023-11-30 22:28 Spencer Pavkovic via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-09  8:26 ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Spencer Pavkovic via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-30 22:28 UTC (permalink / raw)
  To: 67556

If you are in java-ts-mode, attempting to put an opening curly bracket
'{' on it's own line will not indent the bracket at all.

While I expect it to place the bracket on the same indent level as the
block (like regular java-mode), it is always far left with 0 tabs.

I did run with emacs -Q and the same thing happened.

// EXPECTED
public class Thing
{
      public Thing()
      {
          try
          {
              // stuff
          } catch (Exception e)
          {
              // stuff
          }
      }
}

// ACTUAL
public class Thing
{
      public Thing()
{
          try
{
              // stuff
          } catch (Exception e)
{
              // other stuff
          }
     }
}
In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.17.8) of 2023-11-15 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101009
System Description: Gentoo Linux

Configured using:
'configure --prefix=/usr --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --datarootdir=/usr/share
--disable-silent-rules --docdir=/usr/share/doc/emacs-29.1-r5
--htmldir=/usr/share/doc/emacs-29.1-r5/html --libdir=/usr/lib64
--program-suffix=-emacs-29 --includedir=/usr/include/emacs-29
--infodir=/usr/share/info/emacs-29 --localstatedir=/var
--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
--without-compress-install --without-hesiod --without-pop
--with-file-notification=inotify --with-pdumper --enable-acl
--without-dbus --with-modules --without-gameuser --with-libgmp
--without-gpm --with-native-compilation=aot --with-json
--without-kerberos --without-kerberos5 --without-lcms2 --with-xml2
--without-mailutils --without-selinux --without-small-ja-dic
--without-sqlite3 --with-gnutls --without-libsystemd --with-threads
--with-tree-sitter --without-wide-int --with-sound=no --with-zlib
--with-x --without-pgtk --without-ns --without-gconf
--without-gsettings --without-toolkit-scroll-bars --with-xpm --with-xft
--with-cairo --with-harfbuzz --without-libotf --without-m17n-flt
--with-x-toolkit=lucid --with-xaw3d --with-gif --with-jpeg --with-png
--with-rsvg --without-tiff --without-webp --with-imagemagick
--with-dumping=pdumper 'CFLAGS=-O2 -march=native -pipe'
'LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed''

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ IMAGEMAGICK JPEG JSON
LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
THREADS TREE_SITTER X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB

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

Major mode: Outline

Minor modes in effect:
goto-address-mode: t
flyspell-mode: t
shell-dirtrack-mode: t
server-mode: t
rainbow-mode: t
yas-global-mode: t
yas-minor-mode: t
global-ligature-mode: t
ligature-mode: t
marginalia-mode: t
vertico-mode: t
which-key-mode: t
delete-selection-mode: t
recentf-mode: t
global-paren-face-mode: t
global-hungry-delete-mode: t
hungry-delete-mode: t
minibuffer-depth-indicate-mode: t
electric-pair-mode: t
global-hl-line-mode: t
whitespace-mode: t
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
global-prettify-symbols-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
buffer-read-only: t
column-number-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
view-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug goto-addr flyspell ispell noutline
outline view jka-compr find-func shortdoc cc-langs cl-print ibuffer
ibuffer-loaddefs help-fns radix-tree java-ts-mode cc-mode-expansions
cc-mode cc-fonts cc-guess cc-menus cc-cmds expand-region
text-mode-expansions er-basic-expansions expand-region-core
expand-region-custom sh-script smie executable files-x compile misearch
multi-isearch smart-tabs-mode advice display-line-numbers elpaca-log
elpaca-ui macros mule-util c-ts-mode c-ts-common treesit edmacro kmacro
eat term ehelp shell pcomplete comint ansi-osc dired-aux vc-git
diff-mode vc-dispatcher parse-time iso8601 server company-oddmuse
company-keywords company-etags etags fileloop xref project ring
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb company rainbow-mode ansi-color color
disp-table pcase yasnippet ligature marginalia vertico which-key
elfeed-show elfeed-search message sendmail yank-media rfc822 mml mml-sec
epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr mailabbrev mail-utils gmm-utils mailheader shr pixel-fill
kinsoku puny svg dom elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db
elfeed-lib time-date avl-tree generator url-queue url-file browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap xml-query xml
yasnippet-autoloads company-autoloads tuareg-autoloads caml-autoloads
geiser-chicken-autoloads geiser-autoloads haskell-mode-autoloads
ligature-autoloads smart-tabs-mode-autoloads consult-autoloads
marginalia-autoloads vertico-autoloads which-key-autoloads
elfeed-autoloads diminish bookmark text-property-search pp time delsel
dashboard dashboard-widgets recentf tree-widget wid-edit ffap thingatpt
url-parse auth-source eieio eieio-core password-cache json map byte-opt
url-vars paren-face compat hungry-delete dashboard-autoloads
paren-face-autoloads rainbow-mode-autoloads expand-region-autoloads
magit-section-autoloads git-commit-autoloads with-editor-autoloads
magit-autoloads dash-autoloads hungry-delete-autoloads eat-autoloads
compat-autoloads ef-cherie-theme ef-themes diminish-autoloads
ef-themes-autoloads mb-depth elec-pair cc-styles cc-align cc-engine
cc-vars cc-defs hl-line comp comp-cstr warnings icons subr-x rx cl-extra
help-mode bytecomp byte-compile whitespace dired dired-loaddefs bind-key
easy-mmode cl-seq cl-macs gv elpaca elpaca-process cl-loaddefs cl-lib
elpaca-autoloads site-gentoo 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 inotify dynamic-setting
font-render-setting cairo x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 696666 66035)
(symbols 48 30314 3)
(strings 32 243685 4935)
(string-bytes 1 6134869)
(vectors 16 59205)
(vector-slots 8 1611748 182263)
(floats 8 2492 2500)
(intervals 56 18212 16)
(buffers 984 30))





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-11-30 22:28 bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly Spencer Pavkovic via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-09  8:26 ` Eli Zaretskii
  2023-12-09 16:40   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2023-12-09  8:26 UTC (permalink / raw)
  To: Spencer Pavkovic, Yuan Fu, Theodor Thornhill; +Cc: 67556

> Date: Thu, 30 Nov 2023 16:28:11 -0600
> From:  Spencer Pavkovic via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> If you are in java-ts-mode, attempting to put an opening curly bracket
> '{' on it's own line will not indent the bracket at all.
> 
> While I expect it to place the bracket on the same indent level as the
> block (like regular java-mode), it is always far left with 0 tabs.
> 
> I did run with emacs -Q and the same thing happened.
> 
> // EXPECTED
> public class Thing
> {
>       public Thing()
>       {
>           try
>           {
>               // stuff
>           } catch (Exception e)
>           {
>               // stuff
>           }
>       }
> }
> 
> // ACTUAL
> public class Thing
> {
>       public Thing()
> {
>           try
> {
>               // stuff
>           } catch (Exception e)
> {
>               // other stuff
>           }
>      }
> }

Yuan and Theo, any comments?





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-09  8:26 ` Eli Zaretskii
@ 2023-12-09 16:40   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-09 17:08     ` Eli Zaretskii
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-09 16:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Spencer Pavkovic, 67556, Yuan Fu

[-- Attachment #1: Type: text/html, Size: 2710 bytes --]

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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-09 16:40   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-09 17:08     ` Eli Zaretskii
  2023-12-10  9:56     ` Yuan Fu
  2024-02-11 22:44     ` Dmitry Gutov
  2 siblings, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2023-12-09 17:08 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: spavkov, 67556, casouri

> Date: Sat, 09 Dec 2023 17:40:12 +0100
> From: Theodor Thornhill <theo@thornhill.no>
> Cc: Spencer Pavkovic <spavkov@ilstu.edu>, Yuan Fu <casouri@gmail.com>,
>  67556@debbugs.gnu.org
> 
>  Yuan and Theo, any comments? 
> 
> This can be supported, but no Java code is indented like this, though. But it could make sense to
> support at least _some_ indentation here. I can take a look at this tonight!

Thanks, please do.





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-09 16:40   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-09 17:08     ` Eli Zaretskii
@ 2023-12-10  9:56     ` Yuan Fu
  2023-12-16 11:56       ` Eli Zaretskii
  2024-02-11 22:44     ` Dmitry Gutov
  2 siblings, 1 reply; 18+ messages in thread
From: Yuan Fu @ 2023-12-10  9:56 UTC (permalink / raw)
  To: Theodor Thornhill, Eli Zaretskii; +Cc: Spencer Pavkovic, 67556



On 12/9/23 8:40 AM, Theodor Thornhill wrote:
>
>
> On Dec 9, 2023 09:26, Eli Zaretskii <eliz@gnu.org> wrote:
>
>     > Date: Thu, 30 Nov 2023 16:28:11 -0600
>     > From:  Spencer Pavkovic via "Bug reports for GNU Emacs,
>     >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>     >
>     > If you are in java-ts-mode, attempting to put an opening curly
>     bracket
>     > '{' on it's own line will not indent the bracket at all.
>     >
>     > While I expect it to place the bracket on the same indent level
>     as the
>     > block (like regular java-mode), it is always far left with 0 tabs.
>     >
>     > I did run with emacs -Q and the same thing happened.
>     >
>     > // EXPECTED
>     > public class Thing
>     > {
>     >       public Thing()
>     >       {
>     >           try
>     >           {
>     >               // stuff
>     >           } catch (Exception e)
>     >           {
>     >               // stuff
>     >           }
>     >       }
>     > }
>     >
>     > // ACTUAL
>     > public class Thing
>     > {
>     >       public Thing()
>     > {
>     >           try
>     > {
>     >               // stuff
>     >           } catch (Exception e)
>     > {
>     >               // other stuff
>     >           }
>     >      }
>     > }
>
>     Yuan and Theo, any comments?
>
> This can be supported, but no Java code is indented like this, though. 
> But it could make sense to support at least _some_ indentation here. I 
> can take a look at this tonight!
>
> Thanks for the ping :)
> Theo

Thank you Theo. I'll leave this to you.

Yuan





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-10  9:56     ` Yuan Fu
@ 2023-12-16 11:56       ` Eli Zaretskii
  2023-12-23  9:04         ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2023-12-16 11:56 UTC (permalink / raw)
  To: theo, Yuan Fu; +Cc: spavkov, 67556

Theo, any progress?  This bug is one of those which I'd like to
resolve before releasing Emacs 29.2.  Could you please look into this?

Thanks.

> Date: Sun, 10 Dec 2023 01:56:55 -0800
> Cc: Spencer Pavkovic <spavkov@ilstu.edu>, 67556@debbugs.gnu.org
> From: Yuan Fu <casouri@gmail.com>
> 
> 
> 
> On 12/9/23 8:40 AM, Theodor Thornhill wrote:
> >
> >
> > On Dec 9, 2023 09:26, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> >     > Date: Thu, 30 Nov 2023 16:28:11 -0600
> >     > From:  Spencer Pavkovic via "Bug reports for GNU Emacs,
> >     >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >     >
> >     > If you are in java-ts-mode, attempting to put an opening curly
> >     bracket
> >     > '{' on it's own line will not indent the bracket at all.
> >     >
> >     > While I expect it to place the bracket on the same indent level
> >     as the
> >     > block (like regular java-mode), it is always far left with 0 tabs.
> >     >
> >     > I did run with emacs -Q and the same thing happened.
> >     >
> >     > // EXPECTED
> >     > public class Thing
> >     > {
> >     >       public Thing()
> >     >       {
> >     >           try
> >     >           {
> >     >               // stuff
> >     >           } catch (Exception e)
> >     >           {
> >     >               // stuff
> >     >           }
> >     >       }
> >     > }
> >     >
> >     > // ACTUAL
> >     > public class Thing
> >     > {
> >     >       public Thing()
> >     > {
> >     >           try
> >     > {
> >     >               // stuff
> >     >           } catch (Exception e)
> >     > {
> >     >               // other stuff
> >     >           }
> >     >      }
> >     > }
> >
> >     Yuan and Theo, any comments?
> >
> > This can be supported, but no Java code is indented like this, though. 
> > But it could make sense to support at least _some_ indentation here. I 
> > can take a look at this tonight!
> >
> > Thanks for the ping :)
> > Theo
> 
> Thank you Theo. I'll leave this to you.
> 
> Yuan
> 





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-16 11:56       ` Eli Zaretskii
@ 2023-12-23  9:04         ` Eli Zaretskii
  2023-12-28  8:01           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2023-12-23  9:04 UTC (permalink / raw)
  To: theo; +Cc: spavkov, 67556, casouri

Ping! Ping!  Theo, please chime in.

> Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org
> Date: Sat, 16 Dec 2023 13:56:59 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> Theo, any progress?  This bug is one of those which I'd like to
> resolve before releasing Emacs 29.2.  Could you please look into this?
> 
> Thanks.
> 
> > Date: Sun, 10 Dec 2023 01:56:55 -0800
> > Cc: Spencer Pavkovic <spavkov@ilstu.edu>, 67556@debbugs.gnu.org
> > From: Yuan Fu <casouri@gmail.com>
> > 
> > 
> > 
> > On 12/9/23 8:40 AM, Theodor Thornhill wrote:
> > >
> > >
> > > On Dec 9, 2023 09:26, Eli Zaretskii <eliz@gnu.org> wrote:
> > >
> > >     > Date: Thu, 30 Nov 2023 16:28:11 -0600
> > >     > From:  Spencer Pavkovic via "Bug reports for GNU Emacs,
> > >     >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> > >     >
> > >     > If you are in java-ts-mode, attempting to put an opening curly
> > >     bracket
> > >     > '{' on it's own line will not indent the bracket at all.
> > >     >
> > >     > While I expect it to place the bracket on the same indent level
> > >     as the
> > >     > block (like regular java-mode), it is always far left with 0 tabs.
> > >     >
> > >     > I did run with emacs -Q and the same thing happened.
> > >     >
> > >     > // EXPECTED
> > >     > public class Thing
> > >     > {
> > >     >       public Thing()
> > >     >       {
> > >     >           try
> > >     >           {
> > >     >               // stuff
> > >     >           } catch (Exception e)
> > >     >           {
> > >     >               // stuff
> > >     >           }
> > >     >       }
> > >     > }
> > >     >
> > >     > // ACTUAL
> > >     > public class Thing
> > >     > {
> > >     >       public Thing()
> > >     > {
> > >     >           try
> > >     > {
> > >     >               // stuff
> > >     >           } catch (Exception e)
> > >     > {
> > >     >               // other stuff
> > >     >           }
> > >     >      }
> > >     > }
> > >
> > >     Yuan and Theo, any comments?
> > >
> > > This can be supported, but no Java code is indented like this, though. 
> > > But it could make sense to support at least _some_ indentation here. I 
> > > can take a look at this tonight!
> > >
> > > Thanks for the ping :)
> > > Theo
> > 
> > Thank you Theo. I'll leave this to you.
> > 
> > Yuan
> > 
> 
> 
> 
> 





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-23  9:04         ` Eli Zaretskii
@ 2023-12-28  8:01           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-28  8:05             ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-28  8:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: spavkov, 67556, casouri

Eli Zaretskii <eliz@gnu.org> writes:

> Ping! Ping!  Theo, please chime in.
>

Hi, sorry - holidays came crashing in, halting everything but family for
a while.

I had a quick glance when the bug was reported, but the fix wasn't super
simple. I'm looking at it now :)

Sorry for the delay, and thanks for the ping!

Should this go on master or emacs-29?

Theo

>> 





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-28  8:01           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-28  8:05             ` Eli Zaretskii
  2024-01-09 20:00               ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2023-12-28  8:05 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: spavkov, 67556, casouri

> From: Theodor Thornhill <theo@thornhill.no>
> Cc: casouri@gmail.com, spavkov@ilstu.edu, 67556@debbugs.gnu.org
> Date: Thu, 28 Dec 2023 09:01:24 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Ping! Ping!  Theo, please chime in.
> >
> 
> Hi, sorry - holidays came crashing in, halting everything but family for
> a while.
> 
> I had a quick glance when the bug was reported, but the fix wasn't super
> simple. I'm looking at it now :)

Thanks!

> Should this go on master or emacs-29?

Preferably to emacs-29, unless you conclude that a fix is too risky
for the release branch.





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-28  8:05             ` Eli Zaretskii
@ 2024-01-09 20:00               ` Eli Zaretskii
  2024-01-20  9:06                 ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2024-01-09 20:00 UTC (permalink / raw)
  To: theo; +Cc: spavkov, 67556, casouri

> Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org, casouri@gmail.com
> Date: Thu, 28 Dec 2023 10:05:56 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Theodor Thornhill <theo@thornhill.no>
> > Cc: casouri@gmail.com, spavkov@ilstu.edu, 67556@debbugs.gnu.org
> > Date: Thu, 28 Dec 2023 09:01:24 +0100
> > 
> > Eli Zaretskii <eliz@gnu.org> writes:
> > 
> > > Ping! Ping!  Theo, please chime in.
> > >
> > 
> > Hi, sorry - holidays came crashing in, halting everything but family for
> > a while.
> > 
> > I had a quick glance when the bug was reported, but the fix wasn't super
> > simple. I'm looking at it now :)
> 
> Thanks!
> 
> > Should this go on master or emacs-29?
> 
> Preferably to emacs-29, unless you conclude that a fix is too risky
> for the release branch.

Ping!  Any progress here?





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2024-01-09 20:00               ` Eli Zaretskii
@ 2024-01-20  9:06                 ` Eli Zaretskii
  2024-02-11  8:43                   ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2024-01-20  9:06 UTC (permalink / raw)
  To: theo, casouri; +Cc: spavkov, 67556

Ping! Ping! Can we please make some progress here?

> Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org, casouri@gmail.com
> Date: Tue, 09 Jan 2024 22:00:48 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org, casouri@gmail.com
> > Date: Thu, 28 Dec 2023 10:05:56 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > 
> > > From: Theodor Thornhill <theo@thornhill.no>
> > > Cc: casouri@gmail.com, spavkov@ilstu.edu, 67556@debbugs.gnu.org
> > > Date: Thu, 28 Dec 2023 09:01:24 +0100
> > > 
> > > Eli Zaretskii <eliz@gnu.org> writes:
> > > 
> > > > Ping! Ping!  Theo, please chime in.
> > > >
> > > 
> > > Hi, sorry - holidays came crashing in, halting everything but family for
> > > a while.
> > > 
> > > I had a quick glance when the bug was reported, but the fix wasn't super
> > > simple. I'm looking at it now :)
> > 
> > Thanks!
> > 
> > > Should this go on master or emacs-29?
> > 
> > Preferably to emacs-29, unless you conclude that a fix is too risky
> > for the release branch.
> 
> Ping!  Any progress here?
> 
> 
> 
> 





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2024-01-20  9:06                 ` Eli Zaretskii
@ 2024-02-11  8:43                   ` Eli Zaretskii
  2024-02-11 22:42                     ` Dmitry Gutov
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2024-02-11  8:43 UTC (permalink / raw)
  To: theo, casouri; +Cc: spavkov, 67556

Ping! Ping! Ping! Yuan and Theo, could you please chime in?

> Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org
> Date: Sat, 20 Jan 2024 11:06:45 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> Ping! Ping! Can we please make some progress here?
> 
> > Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org, casouri@gmail.com
> > Date: Tue, 09 Jan 2024 22:00:48 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > 
> > > Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org, casouri@gmail.com
> > > Date: Thu, 28 Dec 2023 10:05:56 +0200
> > > From: Eli Zaretskii <eliz@gnu.org>
> > > 
> > > > From: Theodor Thornhill <theo@thornhill.no>
> > > > Cc: casouri@gmail.com, spavkov@ilstu.edu, 67556@debbugs.gnu.org
> > > > Date: Thu, 28 Dec 2023 09:01:24 +0100
> > > > 
> > > > Eli Zaretskii <eliz@gnu.org> writes:
> > > > 
> > > > > Ping! Ping!  Theo, please chime in.
> > > > >
> > > > 
> > > > Hi, sorry - holidays came crashing in, halting everything but family for
> > > > a while.
> > > > 
> > > > I had a quick glance when the bug was reported, but the fix wasn't super
> > > > simple. I'm looking at it now :)
> > > 
> > > Thanks!
> > > 
> > > > Should this go on master or emacs-29?
> > > 
> > > Preferably to emacs-29, unless you conclude that a fix is too risky
> > > for the release branch.
> > 
> > Ping!  Any progress here?
> > 
> > 
> > 
> > 
> 
> 
> 
> 





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2024-02-11  8:43                   ` Eli Zaretskii
@ 2024-02-11 22:42                     ` Dmitry Gutov
  2024-02-17  8:35                       ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Dmitry Gutov @ 2024-02-11 22:42 UTC (permalink / raw)
  To: Eli Zaretskii, theo, casouri; +Cc: spavkov, 67556

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

On 11/02/2024 10:43, Eli Zaretskii wrote:
> Ping! Ping! Ping! Yuan and Theo, could you please chime in?

Here's a minimal patch, consisting of a new rule and a couple of 
replacements where the new standalone-parent anchor is used instead of 
the helper c-ts-common-statement-offset.

Because the latter behaves differently when the opening curly is on a 
separate line, and we don't really want that.

A more finished change will likely either switch over to 
standalone-parent completely, or go back and revamp 
c-ts-common-statement-offset to avoid this distinction (despite the 
name, it only remains in use in java-ts-mode these days).

The former has been a simpler route so far, so I suggest we at least 
commit the attached.

[-- Attachment #2: java-ts-mode-indent.diff --]
[-- Type: text/x-patch, Size: 1789 bytes --]

diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index 0b1ac49b99f..580c979b94f 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -74,7 +74,9 @@ java-ts-mode--indent-rules
      ((parent-is "program") column-0 0)
      ((match "}" "element_value_array_initializer")
       parent-bol 0)
-     ((node-is "}") column-0 c-ts-common-statement-offset)
+     ((match "\\`\\(?:constructor_body\\|class_body\\|interface_body\\|block\\)\\'")
+      parent-bol 0)
+     ((node-is "}") standalone-parent 0)
      ((node-is ")") parent-bol 0)
      ((node-is "else") parent-bol 0)
      ((node-is "]") parent-bol 0)
@@ -86,7 +88,7 @@ java-ts-mode--indent-rules
      ((parent-is "array_initializer") parent-bol java-ts-mode-indent-offset)
      ((parent-is "annotation_type_body") column-0 c-ts-common-statement-offset)
      ((parent-is "interface_body") column-0 c-ts-common-statement-offset)
-     ((parent-is "constructor_body") column-0 c-ts-common-statement-offset)
+     ((parent-is "constructor_body") standalone-parent java-ts-mode-indent-offset)
      ((parent-is "enum_body_declarations") parent-bol 0)
      ((parent-is "enum_body") column-0 c-ts-common-statement-offset)
      ((parent-is "switch_block") column-0 c-ts-common-statement-offset)
@@ -125,7 +127,7 @@ java-ts-mode--indent-rules
      ((parent-is "case_statement") parent-bol java-ts-mode-indent-offset)
      ((parent-is "labeled_statement") parent-bol java-ts-mode-indent-offset)
      ((parent-is "do_statement") parent-bol java-ts-mode-indent-offset)
-     ((parent-is "block") column-0 c-ts-common-statement-offset)))
+     ((parent-is "block") standalone-parent java-ts-mode-indent-offset)))
   "Tree-sitter indent rules.")
 
 (defvar java-ts-mode--keywords

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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2023-12-09 16:40   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-09 17:08     ` Eli Zaretskii
  2023-12-10  9:56     ` Yuan Fu
@ 2024-02-11 22:44     ` Dmitry Gutov
  2 siblings, 0 replies; 18+ messages in thread
From: Dmitry Gutov @ 2024-02-11 22:44 UTC (permalink / raw)
  To: Theodor Thornhill, Eli Zaretskii; +Cc: Spencer Pavkovic, 67556, Yuan Fu

On 09/12/2023 18:40, Theodor Thornhill via Bug reports for GNU Emacs, 
the Swiss army knife of text editors wrote:
> This can be supported, but no Java code is indented like this, though.

At the very least, this style has been somewhat popular a decade ago 
when I last did Java.

Note that our Android port uses a somewhat similar style, though that 
one is more likely because the author likes the GNU C indentation.





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2024-02-11 22:42                     ` Dmitry Gutov
@ 2024-02-17  8:35                       ` Eli Zaretskii
  2024-02-17 13:31                         ` Dmitry Gutov
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2024-02-17  8:35 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: spavkov, 67556, casouri, theo

> Date: Mon, 12 Feb 2024 00:42:50 +0200
> Cc: spavkov@ilstu.edu, 67556@debbugs.gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
> 
> On 11/02/2024 10:43, Eli Zaretskii wrote:
> > Ping! Ping! Ping! Yuan and Theo, could you please chime in?
> 
> Here's a minimal patch, consisting of a new rule and a couple of 
> replacements where the new standalone-parent anchor is used instead of 
> the helper c-ts-common-statement-offset.
> 
> Because the latter behaves differently when the opening curly is on a 
> separate line, and we don't really want that.
> 
> A more finished change will likely either switch over to 
> standalone-parent completely, or go back and revamp 
> c-ts-common-statement-offset to avoid this distinction (despite the 
> name, it only remains in use in java-ts-mode these days).
> 
> The former has been a simpler route so far, so I suggest we at least 
> commit the attached.

No further comments, so I suggest that you install this on master.

Thanks.





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2024-02-17  8:35                       ` Eli Zaretskii
@ 2024-02-17 13:31                         ` Dmitry Gutov
  2024-02-17 13:56                           ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Dmitry Gutov @ 2024-02-17 13:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: spavkov, 67556, casouri, theo

On 17/02/2024 10:35, Eli Zaretskii wrote:
> No further comments, so I suggest that you install this on master.

Not emacs-29? It seems like we fix a serious omission here.





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2024-02-17 13:31                         ` Dmitry Gutov
@ 2024-02-17 13:56                           ` Eli Zaretskii
  2024-02-17 20:36                             ` Dmitry Gutov
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2024-02-17 13:56 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: spavkov, 67556, casouri, theo

> Date: Sat, 17 Feb 2024 15:31:19 +0200
> Cc: theo@thornhill.no, casouri@gmail.com, spavkov@ilstu.edu,
>  67556@debbugs.gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
> 
> On 17/02/2024 10:35, Eli Zaretskii wrote:
> > No further comments, so I suggest that you install this on master.
> 
> Not emacs-29? It seems like we fix a serious omission here.

I didn't realize this is a bug in Emacs 29.  Then emacs-29 is fine,
thanks.





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

* bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly
  2024-02-17 13:56                           ` Eli Zaretskii
@ 2024-02-17 20:36                             ` Dmitry Gutov
  0 siblings, 0 replies; 18+ messages in thread
From: Dmitry Gutov @ 2024-02-17 20:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: spavkov, 67556-done, casouri, theo

On 17/02/2024 15:56, Eli Zaretskii wrote:
>> Date: Sat, 17 Feb 2024 15:31:19 +0200
>> Cc: theo@thornhill.no, casouri@gmail.com, spavkov@ilstu.edu,
>>   67556@debbugs.gnu.org
>> From: Dmitry Gutov <dmitry@gutov.dev>
>>
>> On 17/02/2024 10:35, Eli Zaretskii wrote:
>>> No further comments, so I suggest that you install this on master.
>>
>> Not emacs-29? It seems like we fix a serious omission here.
> 
> I didn't realize this is a bug in Emacs 29.  Then emacs-29 is fine,
> thanks.

Thanks. Now installed, with a couple more tweaks and a new indentation test.





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

end of thread, other threads:[~2024-02-17 20:36 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30 22:28 bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly Spencer Pavkovic via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-09  8:26 ` Eli Zaretskii
2023-12-09 16:40   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-09 17:08     ` Eli Zaretskii
2023-12-10  9:56     ` Yuan Fu
2023-12-16 11:56       ` Eli Zaretskii
2023-12-23  9:04         ` Eli Zaretskii
2023-12-28  8:01           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-28  8:05             ` Eli Zaretskii
2024-01-09 20:00               ` Eli Zaretskii
2024-01-20  9:06                 ` Eli Zaretskii
2024-02-11  8:43                   ` Eli Zaretskii
2024-02-11 22:42                     ` Dmitry Gutov
2024-02-17  8:35                       ` Eli Zaretskii
2024-02-17 13:31                         ` Dmitry Gutov
2024-02-17 13:56                           ` Eli Zaretskii
2024-02-17 20:36                             ` Dmitry Gutov
2024-02-11 22:44     ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).