branch: scratch/editorconfig-cc
commit d776cdc5eeedcac6a58fa50ea685275d6fec40e6
Author: Hong Xu <h...@topbug.net>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    Support max_line_length.
---
 .editorconfig   | 1 +
 editorconfig.el | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/.editorconfig b/.editorconfig
index 770c115deb..9d29006ba1 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -3,3 +3,4 @@ root = true
 
 [*.el]
 indent_style = space
+max_line_length = 80
diff --git a/editorconfig.el b/editorconfig.el
index a8d458a827..c58c639826 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -1,6 +1,6 @@
 ;;; editorconfig.el --- EditorConfig Emacs extension
 
-;; Copyright (C) 2011-2013 EditorConfig Team
+;; Copyright (C) 2011-2014 EditorConfig Team
 
 ;; Author: EditorConfig Team <editorcon...@googlegroups.com>
 ;; Version: 0.2
@@ -65,10 +65,17 @@
 (defun edconf-set-line-ending (end-of-line)
   )
 
+(defun edconf-set-line-length (length)
+  "set the max line length (fill-column)"
+  (set-fill-column (string-to-number length)))
+
 (defun edconf-get-properties ()
   )
 
 (defun edconf-parse-properties (props-string)
   )
 
+(defun edconf-find-file-hook ()
+      (edconf-set-line-length (gethash 'max_line_length props)))
+
 (provide 'editorconfig)

Reply via email to