comparison .elisp/settings/40.modes.el @ 202:84eb8c90ada9

modes: handle annotations better
author Augie Fackler <durin42@gmail.com>
date Tue, 13 Apr 2010 14:49:59 -0500
parents ccab2fe3a256
children e4842709368a
comparison
equal deleted inserted replaced
201:b80bed8c7c39 202:84eb8c90ada9
72 (add-hook 'python-mode-hook 'af-python-mode-hook) 72 (add-hook 'python-mode-hook 'af-python-mode-hook)
73 73
74 (add-hook 'compilation-mode-hook '(lambda () (local-set-key "g" 'recompile))) 74 (add-hook 'compilation-mode-hook '(lambda () (local-set-key "g" 'recompile)))
75 75
76 (column-number-mode) 76 (column-number-mode)
77
78
79 (defun annotation-fix (unused)
80 "fix indentation after an annotation"
81 (save-excursion
82 (beginning-of-line)
83 (forward-word -1)
84 (if (eq (char-before) ?@) ;; There's an annotation there
85 0
86 (+ c-basic-offset c-basic-offset))))
87
88 (add-hook 'java-mode-hook
89 (lambda ()
90 (c-set-offset 'topmost-intro-cont
91 annotation-fix)))