-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjj-mode.el
More file actions
54 lines (41 loc) · 1.59 KB
/
objj-mode.el
File metadata and controls
54 lines (41 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
;;; objj-mode --- An Objective-J mode for Emacs.
;; Package-Version: 1.0
;;; Commentary:
;;; Code:
(require 'cc-mode)
(require 'compile)
(defconst cappuccino-objj-style
'((c-basic-offset . 4)
(tab-width . 8)
(indent-tabs-mode . nil)
(c-offsets-alist
(substatement-open . 0))))
(define-derived-mode objj-mode objc-mode
"Objective-J"
"Major mode for editing Objective-J files.")
(add-to-list 'auto-mode-alist '("\\.j\\'" . objj-mode))
(add-hook 'c-mode-common-hook
(lambda ()
(c-add-style "cappuccino" cappuccino-objj-style t)))
(add-hook 'objj-mode-hook
(lambda ()
(c-set-style "cappuccino")))
(add-to-list 'compilation-error-regexp-alist-alist
'(objj-acorn "^\\(WARNING\\|ERROR\\) line \\([0-9]+\\) in file:\\([^:]+\\):\\(.*\\)$" 3 2))
(add-to-list 'compilation-error-regexp-alist 'objj-acorn)
(when (require 'flycheck nil t)
(eval-after-load "flycheck.el"
(progn
(flycheck-define-checker objj-capp-lint
"A flycheck checker for Objective-J based on capp_lint."
:command
("capp_lint" source)
:error-patterns
((warning line-start line ": " (message) "." line-end))
:modes
(objj-mode))
(add-to-list 'flycheck-checkers 'objj-capp-lint)
(add-hook 'objj-mode-hook (lambda ()
(flycheck-select-checker 'objj-capp-lint))))))
(provide 'objj-mode)
;; objj-mode.el ends here