-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scratch/editorconfig #346
Merged
Merged
Scratch/editorconfig #346
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This follows the convention used in Emacs's own test suite and works around annoying circular `require`s when `ert-tests` happens to be in `load-path`. Also adjust the Makefile not to get confused by generated files. * Makefile (SRCS): Filter out ELPA-generated files.
Instead of treating `lisp-indent-offset` specially in `editorconfig--should-set` (to obey `editorconfig-lisp-use-default-indent`), use a new function `editorconfig-set-indentation-lisp-mode` for Lisp modes. * lisp/editorconfig.el (editorconfig--should-set): Remove `size` argument. (editorconfig-set-indentation): Adjust calls accordingly. (editorconfig-set-indentation-lisp-mode): New function. (editorconfig-indentation-alist): Use it.
Mostly fix compiler warnings and prefer #' to quote function names. * editorconfig.el: Remove dependency on `nadvice` since we require Emacs-26 which includes `nadvice` already. Remove redundant `require`s. Remove redundant `:group` arguments. Move `defvar`s outside of `eval-when-compile`. Remove "post-end trailer". * .dir-locals.el: New file, to replace the "post-end trailer". * ert-tests/editorconfig-core-handle-tests.el (editorconfig--fixtures): Rename from `fixtures`. Change all uses. * ert-tests/editorconfig-tests.el (test-editorconfig) (test-local-variables, test-hack-properties-functions): Use `bound-and-true-p` when it's not guaranteed that the var will be defined.
Don't re-set variables just because `read-only-mode` is (de)activated, and with Emacs-30's hooks it would be even less natural to do. Also `buffer-read-only` can change without calling `read-only-mode`, so better test it dynamically when we try to trim whitespace. * lisp/editorconfig.el (editorconfig--delete-trailing-whitespace): New function. (editorconfig-set-trailing-ws): Use it. Use `pcase`. Also prefer `before-save-hook` and use `add/remove-hook` to manipulate hooks, like god intended. Don't test `buffer-read-only` any more. (editorconfig-mode): Don't hook into `read-only-mode-hook` any more. * ert-tests/editorconfig-tests.el (test-trim-trailing-ws): Adjust the test accordingly.
Match relative file names against the glob pattern instead of trying to construct a glob pattern that matches the absolute file name (where the code failed to escape the possible special chars). * lisp/editorconfig-core-handle.el (editorconfig-core-handle-section-get-properties): Delete `dir` arg. (editorconfig-core-handle-get-properties-hash) (editorconfig-core-handle-get-properties): Adjust call accordingly. Use `declare` to mark it obsolete. (editorconfig-core-handle--fnmatch-p): Delete `dir` arg.
27386ec
to
4f54355
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #345