changeset 202:84eb8c90ada9

modes: handle annotations better
author Augie Fackler <durin42@gmail.com>
date Tue, 13 Apr 2010 14:49:59 -0500
parents b80bed8c7c39
children e2579eeb06ba
files .elisp/settings/40.modes.el
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)))