aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-01-12 18:02:48 +0000
committerJussi Pakkanen <jpakkane@gmail.com>2018-01-16 22:18:04 +0200
commit7eb6a2918080fce37df7e6d25194d46ed98f0f35 (patch)
treee1a1bd8a7b939c2f0c0ea6f7edbb71897c3c9294 /data
parentfc8912384c31b0ee247e342a7423156b7e56203e (diff)
downloadmeson-7eb6a2918080fce37df7e6d25194d46ed98f0f35.zip
meson-7eb6a2918080fce37df7e6d25194d46ed98f0f35.tar.gz
meson-7eb6a2918080fce37df7e6d25194d46ed98f0f35.tar.bz2
A few small improvements to meson.el
Add some missing statements to list of keywords Derive from prog-mode, so any prog-mode hooks are run Automatically use this mode for meson.build files [ci skip]
Diffstat (limited to 'data')
-rw-r--r--data/syntax-highlighting/emacs/meson.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/data/syntax-highlighting/emacs/meson.el b/data/syntax-highlighting/emacs/meson.el
index 36f7eb9..45c6983 100644
--- a/data/syntax-highlighting/emacs/meson.el
+++ b/data/syntax-highlighting/emacs/meson.el
@@ -9,12 +9,10 @@ For detail, see `comment-dwim'."
)
(comment-dwim arg)))
-;;(setq mymeson-keywords-regex (regex-opt '("if", "endif", "foreach", "endforeach")))
-
;; keywords for syntax coloring
(setq meson-keywords
`(
- ( ,(regexp-opt '("if" "endif" "for" "foreach") 'word) . font-lock-keyword-face)
+ ( ,(regexp-opt '("elif" "if" "else" "endif" "foreach" "endforeach") 'word) . font-lock-keyword-face)
)
)
@@ -23,17 +21,17 @@ For detail, see `comment-dwim'."
(setq meson-syntax-table
(let ((synTable (make-syntax-table)))
- ;; bash style comment: “# …”
+ ;; bash style comment: “# …”
(modify-syntax-entry ?# "< b" synTable)
(modify-syntax-entry ?\n "> b" synTable)
synTable))
;; define the major mode.
-(define-derived-mode meson-mode fundamental-mode
+(define-derived-mode meson-mode prog-mode
"meson-mode is a major mode for editing Meson build definition files."
:syntax-table meson-syntax-table
-
+
(setq font-lock-defaults '(meson-keywords))
(setq mode-name "meson")
@@ -41,3 +39,4 @@ For detail, see `comment-dwim'."
(define-key meson-mode-map [remap comment-dwim] 'meson-comment-dwim)
)
+(add-to-list 'auto-mode-alist '("meson.build" . meson-mode))