Showing with 13 additions and 2 deletions.
  1. +2 −0 README.md
  2. +11 −2 editorconfig.el
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -13,6 +13,8 @@ and add the following to your `~/.emacs` file:
(add-to-list 'load-path "~/.emacs.d/")
(load "editorconfig")

Alternatively, you can find the package available on [Marmalade](http://marmalade-repo.org/packages/editorconfig).

## Supported properties

Current Emacs plugin coverage for EditorConfig's [properties][]:
Expand Down
13 changes: 11 additions & 2 deletions editorconfig.el
Expand Up @@ -3,7 +3,7 @@
;; Copyright (C) 2011-2013 EditorConfig Team

;; Author: EditorConfig Team <editorconfig@googlegroups.com>
;; Version: 0.2
;; Version: 0.3
;; URL: http://github.com/editorconfig/editorconfig-emacs#readme

;; See
Expand All @@ -12,7 +12,7 @@

;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;;
;; 1. Redistributions of source code must retain the above copyright notice,
;; this list of conditions and the following disclaimer.
;; 2. Redistributions in binary form must reproduce the above copyright notice,
Expand Down Expand Up @@ -47,6 +47,7 @@
(defvar edconf-exec-path "editorconfig")

(defun edconf-set-indentation (style &optional size tab_width)
(setq web-mode-indent-style 2)
"Set indentation type from given style and size"
(when (equal style "space")
(setq indent-tabs-mode nil
Expand All @@ -56,12 +57,19 @@
TeX-brace-indent-level size
c-basic-offset size
cperl-indent-level size
haskell-indent-offset size
shm-indent-spaces size
js-indent-level size
js2-basic-offset size
lisp-indent-offset size
perl-indent-level size
py-indent-offset size
python-indent size
ruby-indent-level size
sh-basic-offset size
web-mode-markup-indent-offset size
web-mode-css-indent-offset size
web-mode-code-indent-offset size
;(make-local-variable 'sgml-basic-offset) size
tab-stop-list (let ((stops (cons size ())))
(while (< (car stops) 120)
Expand Down Expand Up @@ -137,6 +145,7 @@
(val (mapconcat 'identity (cdr key-val) "")))
(puthash key val properties)))))))

;;;###autoload
(defun edconf-find-file-hook ()
(when (executable-find edconf-exec-path)
(let ((props (edconf-parse-properties (edconf-get-properties))))
Expand Down