[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#43951: 26.3; Java-mode annotation indentation
From: |
johol |
Subject: |
bug#43951: 26.3; Java-mode annotation indentation |
Date: |
Mon, 12 Oct 2020 12:28:24 +0000 |
User-agent: |
Horde Application Framework 5 |
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))
- bug#43951: 26.3; Java-mode annotation indentation,
johol <=