Merge pull request #209 from editorconfig/defaultcore
Use elisp core by default
* Add empty CHANGELOG.md
* Generate CHANGELOG template
```python
#!/usr/bin/env python3
import subprocess
def _get_tag_date(tag):
git_show = subprocess.run(["git", "show", tag, "--format=%cd", "--date=short", "-s"], capture_output=True)
return git_show.stdout.decode("utf-8").strip()
def main():
git_tag = subprocess.run(["git", "tag"], capture_output=True)
versions = list(reversed([e[1:] for e in git_tag.stdout.decode("utf-8").split("\n") if e]))
for version in versions:
print(f"## [{version}] - {_get_tag_date('v' + version)}")
print()
print()
print(f"[Unreleased]: https://github.com/editorconfig/editorconfig-emacs/compare/v{versions[0]}...HEAD")
for version, version_prev in zip(versions, versions[1:]):
print(f"[{version}]: https://github.com/editorconfig/editorconfig-emacs/compare/v{version_prev}...v{version}")
print(f"[{versions[-1]}]: https://github.com/editorconfig/editorconfig-emacs/releases/tag/v{versions[-1]}")
return
main()
```
* Paste release notes from github releases
* Add release note for unreleased
* Fix lineUse uniform equality in properties hash tables
Previously, `editorconfig-get-properties` could return either an equal-based hash table (if the `editorconfig-exec-path` executable was run) or an eql-based hash table (if the internal elisp implementation was used). Since the former is keyed on symbols anyway, it makes sense to make them both use eql for consistency.
Always handle "unset" values as non-present
According to [the editorconfig specification][1], > For any pair, a value of `unset` removes the effect of that pair, even if it > has been set before. For example, add `indent_size = unset` to undefine the > `indent_size` pair (and use editor defaults). Yet, the test suite for editorconfig *cores* [indicates][2] that an editorconfig shouldn't ignore values of "unset", and should return them as-is. Therefore it's up to editorconfig *plugins* to discard values of "unset" at the point of use. Before this commit, the only place in the code where the value "unset" was checked for was in `editorconfig-set-major-mode-from-ext`, whereas in other places, such as `editorconfig-set-indentation`, it was not checked. After this commit, values of "unset" are immediately removed from the properties hashtable before it is used to do anything in `editorconfig-apply`. This ensures that properties with value "unset" will be treated indistinguishably from unspecified properties. This fixes the behavior shown in this gist: https://gist.github.com/kini/560673dbff4b8e42bb40a82a8ca6e5b1 [1]: https://editorconfig-specification.readthedocs.io/en/latest/#supported-pairs [2]: editorconfig/editorconfig-core-test#12
Don't make unchanged vars buffer-local
Note that `indent-tabs-mode` and `tab-width` are both "buffer-local whenever set" variables so there's no need to run `make-local-variable` on them, as I understand it.
Merge pull request #222 from kini/unset-handling
Always handle "unset" values as non-present
Update README to help bootstrap users (#219)
* Update README to help bootstrap users * Update doc * Fix doc * Update * Updat
Fix references in CHANGELOG (#226)
* Fix issue references in CHANGELOG * Fix commit reference link
Add Emacs 27.1 to test target (#228)
* Add Emacs 27.1 to travis test target * Add GitHub Actions build.yaml * Fix evm 27.1 version * Remove github actions build.yaml
editorconfig-exclude-modes should start with "/"
TRAMP paths looks like `/method:user@host:/path/to/file`, per https://www.gnu.org/software/tramp/#Quick-Start-Guide .
editorconfig via Tramp over SSH causes find-file to lag, as it traverses up the remote file hierarchy, each step incurring a network roundtrip. Co-authored-by: Hong Xu <hong@topbug.net>
Merge pull request #231 from editorconfig/githubactions
Add Github Actions CI
* Update README 2 * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md
Use revert-buffer-with-coding-system to set coding system (#236)
* Use revert-buffer-with-coding-system to set coding system * Avoid infinite call * Do not ask user for revert when buffer is not modified * Refactor -set-coding-system * Do not use revert when the file does not exist yet * Refactor -set-coding-system
editorconfig.el: skip special-mode buffers when applying (#246) (#247)
Some buffers get confused if you keep setting their mode, one example is git-rebase-mode. This is an example buffer of a class of special-mode buffers which are usually (but not always) non-file buffers. Either way these buffers are usually special purpose interactive buffers that will only get confused if editorconfig tries to mess around with them.
Stop excluding remote files by default (#245)
To exclude remote files again, add following to the init.el:
(add-to-list 'editorconfig-exclude-regexps
(eval-when-compile
(rx string-start "/" (or "http" "https" "ftp" "sftp" "rsync" "ssh") ":")))Refactoring & add editorconfig-2-mode for beta test (#248)
* Remove file type experimental feature temporarily * Do some refactors * Ignore failures of tests for file type feature * Make editorconfig-get-properties-function accept one argument * Implement editorconfig--advice-find-file-noselect * Define editorconfig-error * Implement advices * Update adviced function body * Update function name * Refactor exclude functions * Add more error handlings * Refactor editorconfig--advice-find-file-noselect * Add editorconfig-2-mode * Add nadvice to dependency list * Use display-warning instead of message for debug log * Update README * Fix editorconfig-2-mode for read-only-mode * Add test for editorconfig-2-mode