diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-01-12 18:02:48 +0000 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-02-19 01:32:17 +0530 |
commit | 7bc653553dac495109cd64b5d89fb8da016e6103 (patch) | |
tree | d9e6854cb9b16be8492ee20bfb16ccc1b57706b1 | |
parent | 2518704a7008886b917e894957abb90610c941c3 (diff) | |
download | meson-7bc653553dac495109cd64b5d89fb8da016e6103.zip meson-7bc653553dac495109cd64b5d89fb8da016e6103.tar.gz meson-7bc653553dac495109cd64b5d89fb8da016e6103.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]
-rw-r--r-- | data/syntax-highlighting/emacs/meson.el | 11 |
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)) |