forked from museoa/bqn-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bqn-mode.el
45 lines (38 loc) · 1.19 KB
/
bqn-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
44
45
;;; bqn-mode --- Emacs mode for BQN -*- lexical-binding: t -*-
;;;
;;; Commentary:
;;;
;;; Emacs mode for BQN: currently keymap only
;;;
;;; There are two ways to access the BQN keymap:
;;; - When editing a BQN file, use keys with the super (s-) modifier.
;;; - Enable backslash prefixes by entering C-\ (‘toggle-input-method’)
;;; then BQN-Z. Then enter backslash \ before a key.
;;;
;;; Code:
(require 'bqn-input)
(require 'bqn-backslash)
(require 'bqn-syntax)
(require 'bqn-comint)
(require 'bqn-help)
;;;###autoload
(defgroup bqn nil
"Major mode for interacting with the BQN interpreter."
:prefix 'bqn
:group 'languages)
;;;###autoload
(define-derived-mode bqn-mode prog-mode "BQN"
"Major mode for editing BQN files."
:syntax-table bqn--syntax-table
:group 'bqn
(use-local-map bqn--mode-map)
(setq-local font-lock-defaults bqn--token-syntax-types)
(setq-local eldoc-documentation-function 'bqn-help--eldoc)
(setq-local comment-start "# "))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.bqn\\'" . bqn-mode))
;;;###autoload
(add-to-list 'interpreter-mode-alist '("bqn" . bqn-mode))
(with-eval-after-load 'speedbar
(speedbar-add-supported-extension ".bqn"))
(provide 'bqn-mode)