all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: johol@lysator.liu.se
To: 43951@debbugs.gnu.org
Subject: bug#43951: 26.3; Java-mode annotation indentation
Date: Mon, 12 Oct 2020 12:28:24 +0000	[thread overview]
Message-ID: <20201012122824.Horde.0Wyp8FvnFDFx7ZN3n-UxQYt@webmail.lysator.liu.se> (raw)


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






             reply	other threads:[~2020-10-12 12:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 12:28 johol [this message]
2020-10-12 13:11 ` bug#43951: 26.3; Java-mode annotation indentation 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201012122824.Horde.0Wyp8FvnFDFx7ZN3n-UxQYt@webmail.lysator.liu.se \
    --to=johol@lysator.liu.se \
    --cc=43951@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.