This is editorconfig.info, produced by makeinfo version 6.8 from
editorconfig.texi.

INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* EditorConfig: (editorconfig). EditorConfig Emacs Plugin.
END-INFO-DIR-ENTRY


File: editorconfig.info,  Node: Top,  Next: Getting Started,  Up: (dir)

1 EditorConfig Emacs Plugin
***************************

This is an EditorConfig (https://editorconfig.org) plugin for Emacs
(https://www.gnu.org/software/emacs/).

* Menu:

* Getting Started::
* Supported properties::
* Customize::
* Troubleshooting::
* Submitting Bugs and Feature Requests::
* License::


File: editorconfig.info,  Node: Getting Started,  Next: Supported properties,  Prev: Top,  Up: Top

1.1 Getting Started
===================

* Menu:

* packageel::
* use-package::
* Manual installation::


File: editorconfig.info,  Node: packageel,  Next: use-package,  Up: Getting Started

1.1.1 package.el
----------------

This package is available from MELPA (https://melpa.org/#/editorconfig),
MELPA Stable (https://stable.melpa.org/#/editorconfig) and NonGNU ELPA
(http://elpa.nongnu.org/nongnu/editorconfig.html).  Install from these
repositories and enable global minor-mode 'editorconfig-mode':

(editorconfig-mode 1)

   Normally, enabling 'editorconfig-mode' should be enough for this
plugin to work: all other configurations are optional.  This mode sets
up hooks so that EditorConfig properties will be loaded and applied to
the new buffers automatically when visiting files.


File: editorconfig.info,  Node: use-package,  Next: Manual installation,  Prev: packageel,  Up: Getting Started

1.1.2 use-package
-----------------

If you use *use-package* (https://www.emacswiki.org/emacs/UsePackage),
add the following to your 'init.el' file:

(use-package editorconfig
  :ensure t
  :config
  (editorconfig-mode 1))


File: editorconfig.info,  Node: Manual installation,  Prev: use-package,  Up: Getting Started

1.1.3 Manual installation
-------------------------

Copy all '.el' files in this repository to '~/.emacs.d/lisp' and add the
following:

(add-to-list 'load-path "~/.emacs.d/lisp")
(require 'editorconfig)
(editorconfig-mode 1)


File: editorconfig.info,  Node: Supported properties,  Next: Customize,  Prev: Getting Started,  Up: Top

1.2 Supported properties
========================

Current Emacs plugin coverage for EditorConfig's properties
(https://editorconfig.org/#supported-properties):

   * 'indent_style'
   * 'indent_size'
   * 'tab_width'
   * 'end_of_line'
   * 'charset'
   * 'trim_trailing_whitespace'
   * 'insert_final_newline = true' is supported
   * 'insert_final_newline = false' is not enforced (as in trailing
     newlines actually being removed automagically), we just
     buffer-locally override any preferences that would auto-add them to
     files '.editorconfig' marks as trailing-newline-free
   * 'max_line_length'
   * 'file_type_ext' (Experimental) (See below)
   * 'file_type_emacs' (Experimental) (See below)
   * 'root' (only used by EditorConfig core)

   Not yet covered properties marked with over-strike - pull requests
implementing missing features warmly welcomed!  Typically, you will want
to tie these to native functionality, or the configuration of existing
packages handling the feature.

   As several packages have their own handling of, say, indentation, we
might not yet cover some mode you use, but we try to add the ones that
show up on our radar.

* Menu:

* File Type file_type_ext file_type_emacs::


File: editorconfig.info,  Node: File Type file_type_ext file_type_emacs,  Up: Supported properties

1.2.1 File Type (file_type_ext, file_type_emacs)
------------------------------------------------

File-type feature is currently disabled, because this package is now
undergoing big internal refactoring.  For those who want this
functionality, please consider using editorconfig-custom-majormode
(https://github.com/10sr/editorconfig-custom-majormode-el).


File: editorconfig.info,  Node: Customize,  Next: Troubleshooting,  Prev: Supported properties,  Up: Top

1.3 Customize
=============

'editorconfig-emacs' provides some customize variables.

   Here are some of these variables: for the full list of available
variables, type M-x customize-group [RET] editorconfig [RET].

* Menu:

* editorconfig-trim-whitespaces-mode::
* editorconfig-after-apply-functions::
* editorconfig-hack-properties-functions::


File: editorconfig.info,  Node: editorconfig-trim-whitespaces-mode,  Next: editorconfig-after-apply-functions,  Up: Customize

1.3.1 'editorconfig-trim-whitespaces-mode'
------------------------------------------

Buffer local minor-mode to use to trim trailing whitespaces.

   If set, editorconfig will enable/disable this mode in accord with
'trim_trailing_whitespace' property in '.editorconfig'.  Otherwise, use
Emacs built-in 'delete-trailing-whitespace' function.

   One possible value is 'ws-butler-mode'
(https://github.com/lewang/ws-butler), with which only lines touched get
trimmed.  To use it, add following to your init.el:

(setq editorconfig-trim-whitespaces-mode
      'ws-butler-mode)


File: editorconfig.info,  Node: editorconfig-after-apply-functions,  Next: editorconfig-hack-properties-functions,  Prev: editorconfig-trim-whitespaces-mode,  Up: Customize

1.3.2 'editorconfig-after-apply-functions'
------------------------------------------

(Formerly 'editorconfig-custom-hooks')

   A list of functions which will be called after loading common
EditorConfig settings, when you can set some custom variables.

   For example, 'web-mode' has several variables for indentation offset
size and EditorConfig sets them at once by 'indent_size'.  You can stop
indenting only blocks of 'web-mode' by adding following to your init.el:

(add-hook 'editorconfig-after-apply-functions
  (lambda (props) (setq web-mode-block-padding 0)))


File: editorconfig.info,  Node: editorconfig-hack-properties-functions,  Prev: editorconfig-after-apply-functions,  Up: Customize

1.3.3 'editorconfig-hack-properties-functions'
----------------------------------------------

A list of functions to alter property values before applying them.

   These functions will be run after loading ".editorconfig" files and
before applying them to current buffer, so that you can alter some
properties from ".editorconfig" before they take effect.

   For example, Makefile files always use tab characters for
indentation: you can overwrite "indent_style" property when current
'major-mode' is 'makefile-mode':

(add-hook 'editorconfig-hack-properties-functions
          '(lambda (props)
             (when (derived-mode-p 'makefile-mode)
               (puthash 'indent_style "tab" props))))


File: editorconfig.info,  Node: Troubleshooting,  Next: Submitting Bugs and Feature Requests,  Prev: Customize,  Up: Top

1.4 Troubleshooting
===================

Enabling 'editorconfig-mode' should be enough for normal cases.

   When EditorConfig properties are not effective for unknown reason, we
recommend first trying 'M-x editorconfig-display-current-properties'.

   This command will open a new buffer and display the EditorConfig
properties loaded for current buffer.  You can check if EditorConfig
properties were not read for buffers at all, or they were loaded but did
not take effect for some other reasons.

* Menu:

* Indentation for new major-modes::
* Not work at all for FOO-mode!::


File: editorconfig.info,  Node: Indentation for new major-modes,  Next: Not work at all for FOO-mode!,  Up: Troubleshooting

1.4.1 Indentation for new major-modes
-------------------------------------

Because most Emacs major-modes have their own indentation settings, this
plugin requires explicit support for each major-mode for 'indent_size'
property.

   By default this plugin ships with settings for many major-modes, but,
sorry to say, it cannot be perfect.  Especially it is difficult to
support brand-new major-modes.  Please feel free to submit issue or
pull-request for such major-mode!

   Supported major-modes and their indentation configs are defined in
the variable 'editorconfig-indentation-alist'.


File: editorconfig.info,  Node: Not work at all for FOO-mode!,  Prev: Indentation for new major-modes,  Up: Troubleshooting

1.4.2 Not work at all for FOO-mode!
-----------------------------------

Most cases properties are loaded just after visiting files when
'editorconfig-mode' is enabled.  But it is known that there are
major-modes that this mechanism does not work for and require explicit
call of 'editorconfig-apply'.

   Typically it will occur when the major-mode is not defined using
'define-derived-mode' ('rpm-spec-mode' is an example for this).  Please
feel free to submit issues if you find such modes!


File: editorconfig.info,  Node: Submitting Bugs and Feature Requests,  Next: License,  Prev: Troubleshooting,  Up: Top

1.5 Submitting Bugs and Feature Requests
========================================

Bugs, feature requests, and other issues should be submitted to the
issue tracker: https://github.com/editorconfig/editorconfig-emacs/issues

* Menu:

* Development::


File: editorconfig.info,  Node: Development,  Up: Submitting Bugs and Feature Requests

1.5.1 Development
-----------------

Make and CMake (https://cmake.org) must be installed to run the tests
locally:

$ make check

   To start a new Emacs process with current '*.el' and without loading
user init file, run:

$ make sandbox


File: editorconfig.info,  Node: License,  Prev: Submitting Bugs and Feature Requests,  Up: Top

1.6 License
===========

EditorConfig Emacs Plugin is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.

   You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.



Tag Table:
Node: Top208
Ref: #editorconfig-emacs-plugin340
Node: Getting Started590
Ref: #getting-started733
Node: packageel797
Ref: #package.el919
Node: use-package1483
Ref: #use-package1635
Node: Manual installation1823
Ref: #manual-installation1973
Node: Supported properties2148
Ref: #supported-properties2307
Node: File Type file_type_ext file_type_emacs3481
Ref: #file-type-file_type_ext-file_type_emacs3682
Node: Customize3941
Ref: #customize4078
Node: editorconfig-trim-whitespaces-mode4397
Ref: #editorconfig-trim-whitespaces-mode4613
Node: editorconfig-after-apply-functions5104
Ref: #editorconfig-after-apply-functions5367
Node: editorconfig-hack-properties-functions5853
Ref: #editorconfig-hack-properties-functions6081
Node: Troubleshooting6691
Ref: #troubleshooting6856
Node: Indentation for new major-modes7396
Ref: #indentation-for-new-major-modes7600
Node: Not work at all for FOO-mode!8116
Ref: #not-work-at-all-for-foo-mode8316
Node: Submitting Bugs and Feature Requests8738
Ref: #submitting-bugs-and-feature-requests8943
Node: Development9111
Ref: #development9238
Node: License9442
Ref: #license9565

End Tag Table


Local Variables:
coding: utf-8
End:
