Mercurial > dotfiles
comparison .elisp/settings/40.modes.el @ 258:863f1503616f
emacs java: adjustments from actual java hackery
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 13 Jun 2011 11:00:02 -0500 |
parents | 31f86a5707ee |
children | 8109c1d949c8 |
comparison
equal
deleted
inserted
replaced
257:31f86a5707ee | 258:863f1503616f |
---|---|
89 (add-hook 'compilation-mode-hook '(lambda () (local-set-key "g" 'recompile))) | 89 (add-hook 'compilation-mode-hook '(lambda () (local-set-key "g" 'recompile))) |
90 | 90 |
91 (column-number-mode) | 91 (column-number-mode) |
92 | 92 |
93 | 93 |
94 (defun annotation-fix (unused) | 94 (defun af-annotation-fix (unused) |
95 "fix indentation after an annotation" | 95 "fix indentation after an annotation" |
96 (save-excursion | 96 (save-excursion |
97 (beginning-of-line) | 97 (beginning-of-line) |
98 (forward-word -1) | 98 (forward-word -1) |
99 (if (eq (char-before) ?@) ;; There's an annotation there | 99 (if (eq (char-before) ?@) ;; There's an annotation there |
100 0 | 100 0 |
101 (+ c-basic-offset c-basic-offset)))) | 101 (+ c-basic-offset c-basic-offset)))) |
102 | 102 |
103 (add-hook 'java-mode-hook | 103 (defun af-java-mode-hook () |
104 (lambda () | 104 (c-set-offset 'topmost-intro-cont 'af-annotation-fix) |
105 (c-set-offset 'topmost-intro-cont | 105 (local-set-key (kbd "RET") 'comment-indent-new-line) |
106 annotation-fix))) | 106 (af-tab-fix)) |
107 (add-hook 'java-mode-hook 'af-java-mode-hook) | |
107 | 108 |
108 ;; mq diff-mode support | 109 ;; mq diff-mode support |
109 (add-to-list 'auto-mode-alist '("\\.hg/patches/" . diff-mode)) | 110 (add-to-list 'auto-mode-alist '("\\.hg/patches/" . diff-mode)) |
110 (defun mq-patch-set-default-directory () | 111 (defun mq-patch-set-default-directory () |
111 (when (string= ".hg" (nth 2 (reverse (split-string default-directory "/")))) | 112 (when (string= ".hg" (nth 2 (reverse (split-string default-directory "/")))) |