unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43951: 26.3; Java-mode annotation indentation
@ 2020-10-12 12:28 johol
  2020-10-12 13:11 ` Pankaj Jangid
  2021-01-27  5:34 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 10+ messages in thread
From: johol @ 2020-10-12 12:28 UTC (permalink / raw)
  To: 43951


Java source examples

Wrong indentation:
public class Foo
{
   @Foo(a=true,
        b=false)
        boolean foo = false;
}


Correct indentation with proposed fix below (as found on
https://github.com/jdee-emacs/jdee/issues/5
comment made by oldButNotWise on Dec 22, 2015)

public class Foo
{
   @Foo(a=true,
        b=false)
   boolean foo = false;
}


Proposed fix:
	 ;;CASE 5N: We are at a topmost continuation line and the only
	 ;;preceding items are annotations.
	 ((and (c-major-mode-is 'java-mode)
	       (setq placeholder (point))
	       (c-beginning-of-statement-1)
	       (progn
		 (while (and (c-forward-annotation))
		   (c-forward-syntactic-ws))
		 t)
	       (prog1
		   (>= (point) placeholder)
		 (goto-char placeholder)))
           ;; (c-add-syntax 'annotation-top-cont (c-point 'boi))
           (prog1
               (c-add-syntax 'annotation-top-cont
                             (progn (c-beginning-of-statement-1)
                                    (point)))
             (goto-char placeholder))
           )


In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
  of 2019-08-29 built on CIRROCUMULUS
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor 'Microsoft Corp.', version 10.0.17134
Recent messages:
Undo! [21 times]
Redo!
Mark saved where search started [2 times]
Mark set [3 times]
c-guess-basic-syntax
You can run the command ‘eval-last-sexp’ with C-x C-e
c-guess-basic-syntax
Making completion list...
delete-backward-char: Text is read-only
Making completion list...

Configured using:
  'configure --without-dbus --host=x86_64-w64-mingw32
  --without-compress-install 'CFLAGS=-O2 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS THREADS LCMS2

Important settings:
   value of $LANG: SVE
   locale-coding-system: cp1252

Major mode: Java//l

Minor modes in effect:
   shell-dirtrack-mode: t
   diff-auto-refine-mode: t
   show-paren-mode: t
   global-whitespace-mode: t
   global-display-line-numbers-mode: t
   display-line-numbers-mode: t
   tooltip-mode: t
   global-eldoc-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
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t
   abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mail-utils cc-langs thingatpt dired dired-loaddefs
ruler-mode hl-line hexl sh-script smie executable cl-print debug
cl-extra eieio-opt speedbar sb-image ezimage dframe find-func help-fns
radix-tree rect help-mode misearch multi-isearch face-remap python
tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell
pcomplete parse-time format-spec advice json map comint ring ansi-color
dabbrev vc-git diff-mode easy-mmode cc-mode cc-fonts cc-guess cc-menus
cc-cmds elec-pair mm-util mail-prsvr paren whitespace
display-line-numbers cus-start cus-load cc-styles cc-align cc-engine
cc-vars cc-defs edmacro kmacro finder-inf package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads w32notify w32
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 766749 159606)
  (symbols 48 32289 5)
  (miscs 40 1146 6875)
  (strings 32 65510 4209)
  (string-bytes 1 1983504)
  (vectors 16 54667)
  (vector-slots 8 1662698 151554)
  (floats 8 95 539)
  (intervals 56 88414 1458)
  (buffers 992 95))






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

* bug#43951: 26.3; Java-mode annotation indentation
  2020-10-12 12:28 bug#43951: 26.3; Java-mode annotation indentation johol
@ 2020-10-12 13:11 ` Pankaj Jangid
  2021-01-27  5:34 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 10+ messages in thread
From: Pankaj Jangid @ 2020-10-12 13:11 UTC (permalink / raw)
  To: johol; +Cc: 43951

This issues occurs in ‘master’ branch as well.





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

* bug#43951: 26.3; Java-mode annotation indentation
  2020-10-12 12:28 bug#43951: 26.3; Java-mode annotation indentation johol
  2020-10-12 13:11 ` Pankaj Jangid
@ 2021-01-27  5:34 ` Lars Ingebrigtsen
  2021-01-27 17:12   ` John Olsson
  1 sibling, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-27  5:34 UTC (permalink / raw)
  To: johol; +Cc: 43951

johol@lysator.liu.se writes:

> Java source examples
>
> Wrong indentation:
> public class Foo
> {
>   @Foo(a=true,
>        b=false)
>        boolean foo = false;
> }
>
> Correct indentation with proposed fix below (as found on
> https://github.com/jdee-emacs/jdee/issues/5
> comment made by oldButNotWise on Dec 22, 2015)
>
> public class Foo
> {
>   @Foo(a=true,
>        b=false)
>   boolean foo = false;
> }

I can reproduce this in Emacs 27.1, but not in Emacs 28, so I'm going to
go ahead and guess that this has been fixed recently, and I'm closing
this bug report.  If you can still see this in Emacs 28, please respond
to the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#43951: 26.3; Java-mode annotation indentation
  2021-01-27  5:34 ` Lars Ingebrigtsen
@ 2021-01-27 17:12   ` John Olsson
  2021-01-28  3:31     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: John Olsson @ 2021-01-27 17:12 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 43951

Sorry for spamming. :(

I used GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32) of 2021-01-15

> On 27 Jan 2021, at 06:35, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> johol@lysator.liu.se writes:
> 
>> Java source examples
>> 
>> Wrong indentation:
>> public class Foo
>> {
>>  @Foo(a=true,
>>       b=false)
>>       boolean foo = false;
>> }
>> 
>> Correct indentation with proposed fix below (as found on
>> https://github.com/jdee-emacs/jdee/issues/5
>> comment made by oldButNotWise on Dec 22, 2015)
>> 
>> public class Foo
>> {
>>  @Foo(a=true,
>>       b=false)
>>  boolean foo = false;
>> }
> 
> I can reproduce this in Emacs 27.1, but not in Emacs 28, so I'm going to
> go ahead and guess that this has been fixed recently, and I'm closing
> this bug report.  If you can still see this in Emacs 28, please respond
> to the debbugs address and we'll reopen.
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no






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

* bug#43951: 26.3; Java-mode annotation indentation
  2021-01-27 17:12   ` John Olsson
@ 2021-01-28  3:31     ` Lars Ingebrigtsen
  2021-01-28  5:21       ` John Olsson
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-28  3:31 UTC (permalink / raw)
  To: John Olsson; +Cc: 43951

John Olsson <johol@lysator.liu.se> writes:

> Sorry for spamming. :(
>
> I used GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32) of 2021-01-15

[...]

>> I can reproduce this in Emacs 27.1, but not in Emacs 28, so I'm going to
>> go ahead and guess that this has been fixed recently, and I'm closing
>> this bug report.  If you can still see this in Emacs 28, please respond
>> to the debbugs address and we'll reopen.

Sorry; I don't quite follow -- are you still seeing this issue, or does
the indentation in the example work as expected for you in Emacs 28?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#43951: 26.3; Java-mode annotation indentation
  2021-01-28  3:31     ` Lars Ingebrigtsen
@ 2021-01-28  5:21       ` John Olsson
  2021-01-28  5:52         ` Pankaj Jangid
  0 siblings, 1 reply; 10+ messages in thread
From: John Olsson @ 2021-01-28  5:21 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 43951

I can’t indent some lines (marked with “<=“ at the end of the line)

public class Foo
{ <=
@Foo(a=true <=
b=false)
boolean foo = false; <=
} <=

When I try I get the error message 

Wrong type argument: integer-or-marker-p, t

in the mini-buffer. It is almost the inverse problem, the line I previously got wrong indentation on indents correctly, but almost all other lines fails to indent at all...

Something fishy is going on here.

> On 28 Jan 2021, at 04:32, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> John Olsson <johol@lysator.liu.se> writes:
> 
>> Sorry for spamming. :(
>> I used GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32) of 2021-01-15
> 
> [...]
> 
>>> I can reproduce this in Emacs 27.1, but not in Emacs 28, so I'm going to
>>> go ahead and guess that this has been fixed recently, and I'm closing
>>> this bug report.  If you can still see this in Emacs 28, please respond
>>> to the debbugs address and we'll reopen.
> 
> Sorry; I don't quite follow -- are you still seeing this issue, or does
> the indentation in the example work as expected for you in Emacs 28?
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no






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

* bug#43951: 26.3; Java-mode annotation indentation
  2021-01-28  5:21       ` John Olsson
@ 2021-01-28  5:52         ` Pankaj Jangid
  2021-01-28  7:11           ` John Olsson
  0 siblings, 1 reply; 10+ messages in thread
From: Pankaj Jangid @ 2021-01-28  5:52 UTC (permalink / raw)
  To: John Olsson; +Cc: Lars Ingebrigtsen, 43951

John Olsson <johol@lysator.liu.se> writes:

> I can’t indent some lines (marked with “<=“ at the end of the line)
>
> public class Foo
> { <=
> @Foo(a=true <=
> b=false)
> boolean foo = false; <=
> } <=
>
> When I try I get the error message 
>
> Wrong type argument: integer-or-marker-p, t
>
> in the mini-buffer. It is almost the inverse problem, the line I
> previously got wrong indentation on indents correctly, but almost all
> other lines fails to indent at all...

The above snippet is perfectly indented on my latest build (today). I
suspect some customisation in your init.

Could you please try again after (setq debug-on-error t)?





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

* bug#43951: 26.3; Java-mode annotation indentation
  2021-01-28  5:52         ` Pankaj Jangid
@ 2021-01-28  7:11           ` John Olsson
  2021-01-28  7:25             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: John Olsson @ 2021-01-28  7:11 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: Lars Ingebrigtsen, 43951

I can now confirm that it was indeed my init file that caused the problems I described.

The cause of the problem was that I missed that I loaded a file (without any guard checking Emacs version!) that fixed the behavior in Emacs 26 and that fix was not compatible with Emacs 28... *sigh*

You can close this bug! :D

> On 28 Jan 2021, at 06:52, Pankaj Jangid <pankaj@codeisgreat.org> wrote:
> 
> John Olsson <johol@lysator.liu.se> writes:
> 
>> I can’t indent some lines (marked with “<=“ at the end of the line)
>> 
>> public class Foo
>> { <=
>> @Foo(a=true <=
>> b=false)
>> boolean foo = false; <=
>> } <=
>> 
>> When I try I get the error message 
>> 
>> Wrong type argument: integer-or-marker-p, t
>> 
>> in the mini-buffer. It is almost the inverse problem, the line I
>> previously got wrong indentation on indents correctly, but almost all
>> other lines fails to indent at all...
> 
> The above snippet is perfectly indented on my latest build (today). I
> suspect some customisation in your init.
> 
> Could you please try again after (setq debug-on-error t)?






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

* bug#43951: 26.3; Java-mode annotation indentation
  2021-01-28  7:11           ` John Olsson
@ 2021-01-28  7:25             ` Lars Ingebrigtsen
  2021-01-28  7:56               ` Pankaj Jangid
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-28  7:25 UTC (permalink / raw)
  To: John Olsson; +Cc: Pankaj Jangid, 43951

John Olsson <johol@lysator.liu.se> writes:

> The cause of the problem was that I missed that I loaded a file
> (without any guard checking Emacs version!) that fixed the behavior in
> Emacs 26 and that fix was not compatible with Emacs 28... *sigh*

:-)

> You can close this bug! :D

Thanks for checking; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#43951: 26.3; Java-mode annotation indentation
  2021-01-28  7:25             ` Lars Ingebrigtsen
@ 2021-01-28  7:56               ` Pankaj Jangid
  0 siblings, 0 replies; 10+ messages in thread
From: Pankaj Jangid @ 2021-01-28  7:56 UTC (permalink / raw)
  To: John Olsson; +Cc: 43951

Lars Ingebrigtsen <larsi@gnus.org> writes:

> John Olsson <johol@lysator.liu.se> writes:
>
>> The cause of the problem was that I missed that I loaded a file
>> (without any guard checking Emacs version!) that fixed the behavior in
>> Emacs 26 and that fix was not compatible with Emacs 28... *sigh*
>
> :-)
>
>> You can close this bug! :D
>
> Thanks for checking; closing.

Just for info:

John, you can also close a bug that you have created. Just by sending an
email to nnnn-done@debbugs.gnu.org, which in this case is
43951-done@debbugs.gnu.org. You can send with any subject and body.





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

end of thread, other threads:[~2021-01-28  7:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 12:28 bug#43951: 26.3; Java-mode annotation indentation johol
2020-10-12 13:11 ` Pankaj Jangid
2021-01-27  5:34 ` Lars Ingebrigtsen
2021-01-27 17:12   ` John Olsson
2021-01-28  3:31     ` Lars Ingebrigtsen
2021-01-28  5:21       ` John Olsson
2021-01-28  5:52         ` Pankaj Jangid
2021-01-28  7:11           ` John Olsson
2021-01-28  7:25             ` Lars Ingebrigtsen
2021-01-28  7:56               ` Pankaj Jangid

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).