From f84d2d765fad6016cbaeade5c3746c33e05fd454 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 15 Feb 2016 18:57:57 +0900 Subject: [PATCH] WIP implement editorconfig-conf-mode --- .editorconfig | 4 ++-- emacs.el | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 5506e69..7ad1d81 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,9 +9,9 @@ end_of_line = lf #charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true +insert_final_newline = true#3ab max_line_length = 80 - +;abc [*.c] indent_size = 4 diff --git a/emacs.el b/emacs.el index e5f0864..db35fc4 100644 --- a/emacs.el +++ b/emacs.el @@ -1895,4 +1895,24 @@ This mode is a simplified version of `adoc-mode'." :global nil :lighter "ATranslate")) +(define-derived-mode editorconfig-conf-mode conf-unix-mode "EditorConfig" + "Major mode for editing .editorconfig files." + (conf-mode-initialize ;;"^#\\|^;\\| #\\| ;" + "" + `("indent_size" + "charset" + "indent_style" + "tab_width" + "trim_trailing_whitespace" + "insert_final_newline" + "max_line_length" + "end_of_line" + "root" + ,@conf-font-lock-keywords)) + (set (make-local-variable 'comment-start-skip) + "^#.*\\|^;.*\\| #.*\\| ;.*")) + +'(add-to-list 'auto-mode-alist + '("/\\.editorconfig\\'" . editorconfig-conf-mode)) + ;;; emacs.el ends here