[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/editorconfig-cc 876e476ded 238/351: Update README
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/editorconfig-cc 876e476ded 238/351: Update README |
Date: |
Thu, 13 Jun 2024 18:38:57 -0400 (EDT) |
branch: scratch/editorconfig-cc
commit 876e476dedcf30b263cabac3e932926bb2f0b8ce
Author: 10sr <8.slashes@gmail.com>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Update README
---
README.md | 85 +++++++++++++++++++++++++++------------------------------
editorconfig.el | 21 +++++++++++++-
2 files changed, 60 insertions(+), 46 deletions(-)
diff --git a/README.md b/README.md
index dabf1753da..dd957fa901 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,38 @@
[](http://melpa.org/#/editorconfig)
[](https://stable.melpa.org/#/editorconfig)
-This plugin also has a built-in core library implemented in Emacs-Lisp, and
-fallback to it when no core executable is found.
+## Setup
+
+This package is available on [MELPA](https://melpa.org/#/editorconfig)
+and [MELPA Stable](https://stable.melpa.org/#/editorconfig).
+Install from there and enable global minor-mode `editorconfig-mode`:
```emacs-lisp
- (require 'editorconfig)
- (editorconfig-mode 1)
+(editorconfig-mode 1)
```
-Alternatively, you can find the package available on
-[MELPA](https://melpa.org/#/editorconfig) and [MELPA
Stable](https://stable.melpa.org/#/editorconfig)
-([The Marmalade package](http://marmalade-repo.org/packages/editorconfig) is
deprecated).
+
+To install manually copy all `.el` files in this repository to
+`~/.emacs.d/lisp` and add the following to your `init.el` file:
+
+```emacs-lisp
+(add-to-list 'load-path "~/.emacs.d/lisp")
+(require 'editorconfig)
+(editorconfig-mode 1)
+```
+
+### Install a Core Program
+
+This package requires a Core program.
+The officially recommended one is [EditorConfig C Core][],
+follow the instructions in the README and INSTALL files to install it.
+
+Though using C Core is recommended, but this plugin also
+includes a core library implemented in Emacs Lisp.
+This plugin uses this as a fallback method when no core executable
+is found, so it works out-of-the-box without explicitly installing
+any other core program.
+
## Supported properties
@@ -41,6 +62,12 @@ future updates. When both are specified, `file_type_ext`
takes precedence.
## Customize
+`editorconfig-emacs` provides some customize variables.
+
+Here are some of these variables: for the full list of available variables,
+type <kbd>M-x customize-group [RET] editorconfig [RET]</kbd>.
+
+
### `editorconfig-after-apply-functions`
(Formerly `editorconfig-custom-hooks`)
@@ -59,6 +86,7 @@ only blocks of `web-mode`: it can be achieved by adding
following to your init.e
You can also define your own custom properties and enable them here.
+
### `editorconfig-hack-properties-functions`
A list of function to alter property values before applying them.
@@ -79,6 +107,7 @@ overwrite \"indent_style\" property when current
`major-mode` is a
```
+
### `editorconfig-indentation-alist`
Alist of indentaion setting mothods by modes.
@@ -92,52 +121,18 @@ add a pair of major-mode symbol and its indentation
variables:
'(c-mode c-basic-offset))
```
-You can also modify this variable with the command
-<kbd>M-x customize-variable [RET] editorconfig-indentation-alist [RET]</kbd>.
-For a bit more compilicated cases please take a look at the docstring of this
variable.
-
-### `editorconfig-exec-path`
-
-String of `editorconfig` executable name (command name or full path to
-the executable).
-
-
-### `editorconfig-get-properties-function`
-
-Function to use to get EditorConfig properties.
-
-For example, if you always want to use built-in core library instead
-of any EditorConfig executable to get properties, add following to
-your init.el:
-
-``` emacs-lisp
-(set-variable 'editorconfig-get-properties-function
- #'editorconfig-core-get-properties-hash)
-```
-
-Possible known values are:
-
-* `editorconfig-get-properties` (default)
- * Use `editorconfig-get-properties-from-exec` when
- `editorconfig-exec-path` executable is found, otherwise use
- `editorconfig-core-get-properties-hash`
-* `editorconfig-get-properties-from-exec`
- * Get properties by executing EditorConfig executable specified in
- `editorconfig-exec-path`
-* `editorconfig-core-get-properties-hash`
- * Always use built-in Emacs-Lisp implementation to get properties
-
### `editorconfig-trim-whitespaces-mode`
Buffer local minor-mode to use to trim trailing whitespaces.
-If set, enable that mode when `trim_trailing_whitespace` is set to true.
-Otherwise, use `delete-trailing-whitespace`.
+If set, enable/disable that 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 yo
+only lines touched get trimmed. To use it, add following to your
init.el:
``` emacs-lisp
diff --git a/editorconfig.el b/editorconfig.el
index 357746edc4..d4e30c48c2 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -78,7 +78,26 @@ This executable is invoked by
`editorconfig-call-editorconfig-exec'."
This function will be called with no argument and should return a
hash object containing properties, or nil if any core program is
not available. The hash object should have symbols of property
-names as keys and strings of property values as values."
+names as keys and strings of property values as values.
+
+
+For example, if you always want to use built-in core library instead
+of any EditorConfig executable to get properties, add following to
+your init.el:
+
+(set-variable 'editorconfig-get-properties-function
+ #'editorconfig-core-get-properties-hash)
+
+Possible known values are:
+
+* `editorconfig-get-properties' (default)
+ * Use `editorconfig-get-properties-from-exec' when
+ `editorconfig-exec-path' executable executable is found, otherwise
+ use `editorconfig-core-get-properties-hash'
+* `editorconfig-get-properties-from-exec'
+ * Get properties by executing EditorConfig executable
+* `editorconfig-core-get-properties-hash'
+ * Always use built-in Emacs-Lisp implementation to get properties"
:type 'function
:group 'editorconfig)
(define-obsolete-variable-alias
- [nongnu] scratch/editorconfig-cc 6929cad23b 223/351: Update get-properties-hash, (continued)
- [nongnu] scratch/editorconfig-cc 6929cad23b 223/351: Update get-properties-hash, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc cdbd60a8a6 234/351: M-x checkdoc, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0bbf63616a 231/351: Stop using cl-defclass, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 9cee9bb143 225/351: Get alist result from hash result, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 516ebfefa3 232/351: Remove useless spaces, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 50ed9cf1a7 235/351: Update year, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc ae8028cf3d 233/351: Add struct docstring, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc d5473b369e 236/351: Remove comment, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 023a221d87 239/351: Add fixes for package-lint, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 8271234c27 241/351: Use -*- lexical-binding: t -*-, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 876e476ded 238/351: Update README,
Stefan Monnier <=
- [nongnu] scratch/editorconfig-cc c6d823b8a7 242/351: Separate tool functions, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 882e7f5fa0 249/351: Use API to get version info (#193), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc ace446e357 261/351: Bump version to v0.8.1, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0644119b21 272/351: Keep a CHANGELOG (#221), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 39eca13316 279/351: Add Github Actions build.yaml, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 26c875d609 269/351: Define -mode-apply as an interactive command (#216), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 3305825fd3 298/351: Make new impl work when changing major-mode (#255), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 2e55840057 266/351: Use elisp core by default, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 8d0e609420 277/351: Add Emacs 27.1 to test target (#228), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc d11d5e0078 305/351: Prepare v0.8.2 (#262), Stefan Monnier, 2024/06/13