# HG changeset patch # User Augie Fackler # Date 1271188199 18000 # Node ID 84eb8c90ada926865260d71fdf4976ccbf7e9b1f # Parent b80bed8c7c39a10e6eb16003ba21ffa80ca397f9 modes: handle annotations better diff --git a/.elisp/settings/40.modes.el b/.elisp/settings/40.modes.el --- a/.elisp/settings/40.modes.el +++ b/.elisp/settings/40.modes.el @@ -74,3 +74,18 @@ point." (add-hook 'compilation-mode-hook '(lambda () (local-set-key "g" 'recompile))) (column-number-mode) + + +(defun annotation-fix (unused) + "fix indentation after an annotation" + (save-excursion + (beginning-of-line) + (forward-word -1) + (if (eq (char-before) ?@) ;; There's an annotation there + 0 + (+ c-basic-offset c-basic-offset)))) + +(add-hook 'java-mode-hook + (lambda () + (c-set-offset 'topmost-intro-cont + annotation-fix)))