-
Notifications
You must be signed in to change notification settings - Fork 0
/
m68k-mode.el
43 lines (30 loc) · 1.28 KB
/
m68k-mode.el
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
;;; m68k-mode.el --- Major mode and utilities for M68k assembly programming
;; URL: https://github.com/themkat/emacs-m68k
;; Package-Requires: ((emacs "25.1") (lsp-mode "8.0.0") (dap-mode "0.7") (tree-sitter "0.12.0"))
;; Version: 0.0.1
;;; Commentary:
;; Various utilities for programming M68k assembly. This includes lsp, debugging and more.
;;; Code:
(define-derived-mode m68k-mode
asm-mode "m68k-mode"
"Mode for programming Motorola 68k processors with automatic lsp activation")
;; tree sitter for better syntax highlight
;; requires https://github.com/grahambates/tree-sitter-m68k
;; TODO: setup method for tree-sitter-m68k?
;; TODO: any way we can make this optional if grammar not installed?
;;(add-to-list 'tree-sitter-major-mode-language-alist '(m68k-mode . m68k))
(defcustom m68k-tree-sitter-enabled nil
"Turns on tree-sitter mode for better syntax highlighting. Requires you to set up tree-sitter-m68k and tree-sitter mode."
:type 'string
:group 'm68k-mode)
;; TODO: other utilities?
(defun m68k-setup-tree-sitter ()
"Tree sitter setup."
(when m68k-tree-sitter-enabled
(require 'tree-sitter)
(tree-sitter-hl-mode 1)))
(add-to-list 'm68k-mode-hook #'m68k-setup-tree-sitter)
(require 'm68k-lsp)
;;(require 'dap-m68k)
(provide 'm68k-mode)
;;; m68k-mode.el ends here