branch: scratch/editorconfig-wip commit ed46b545960f70a8d29f0e2ef53a6a192836da3f Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Cosmetic changes for compilation purposes * editorconfig.el: Remove redundant `:group`: arguments. Prefer #' to quote function names. ert-tests/: Tweak `require` statements to try and avoid recursively loading the tests. --- editorconfig.el | 37 ++++++++++++----------------------- ert-tests/editorconfig-core-handle.el | 2 +- ert-tests/editorconfig-core.el | 2 +- ert-tests/editorconfig-fnmatch.el | 2 +- ert-tests/editorconfig.el | 2 +- 5 files changed, 17 insertions(+), 28 deletions(-) diff --git a/editorconfig.el b/editorconfig.el index cb21cad977..88494cecf4 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -78,15 +78,14 @@ coding styles between different editors and IDEs." "Path to EditorConfig executable. Used by `editorconfig--execute-editorconfig-exec'." - :type 'string - :group 'editorconfig) + :type 'string) (define-obsolete-variable-alias 'edconf-get-properties-function 'editorconfig-get-properties-function "0.5") (defcustom editorconfig-get-properties-function - 'editorconfig-core-get-properties-hash + #'editorconfig-core-get-properties-hash "A function which gets EditorConfig properties for specified file. This function will be called with one argument, full path of the target file, @@ -112,13 +111,11 @@ Possible known values are: use `editorconfig-core-get-properties-hash' * `editorconfig-get-properties-from-exec' * Get properties by executing EditorConfig executable" - :type 'function - :group 'editorconfig) + :type 'function) (defcustom editorconfig-mode-lighter " EditorConfig" "Command `editorconfig-mode' lighter string." - :type 'string - :group 'editorconfig) + :type 'string) (define-obsolete-variable-alias 'edconf-custom-hooks @@ -148,8 +145,7 @@ show line numbers on the left: This hook will be run even when there are no matching sections in \".editorconfig\", or no \".editorconfig\" file was found at all." - :type 'hook - :group 'editorconfig) + :type 'hook) (defcustom editorconfig-hack-properties-functions () "A list of function to alter property values before applying them. @@ -171,8 +167,7 @@ overwrite \"indent_style\" property when current `major-mode' is a This hook will be run even when there are no matching sections in \".editorconfig\", or no \".editorconfig\" file was found at all." - :type 'hook - :group 'editorconfig) + :type 'hook) (make-obsolete-variable 'editorconfig-hack-properties-functions "Using `editorconfig-after-apply-functions' instead is recommended, because since 2021/08/30 (v0.9.0) this variable cannot support all properties: @@ -355,21 +350,18 @@ following forms: NOTE: Only the **buffer local** value of VARIABLE will be set." :type '(alist :key-type symbol :value-type sexp) - :risky t - :group 'editorconfig) + :risky t) (defcustom editorconfig-exclude-modes () "Modes in which `editorconfig-mode-apply' will not run." - :type '(repeat (symbol :tag "Major Mode")) - :group 'editorconfig) + :type '(repeat (symbol :tag "Major Mode"))) (defcustom editorconfig-exclude-regexps () "List of regexp for buffer filenames `editorconfig-mode-apply' will not run. When variable `buffer-file-name' matches any of the regexps, then `editorconfig-mode-apply' will not do its work." - :type '(repeat string) - :group 'editorconfig) + :type '(repeat string)) (with-eval-after-load 'recentf (add-to-list 'editorconfig-exclude-regexps (rx-to-string '(seq string-start @@ -381,8 +373,7 @@ When variable `buffer-file-name' matches any of the regexps, then If set, enable that mode when `trim_trailing_whitespace` is set to true. Otherwise, use `delete-trailing-whitespace'." - :type 'symbol - :group 'editorconfig) + :type 'symbol) (defvar editorconfig-properties-hash nil "Hash object of EditorConfig properties that was enabled for current buffer. @@ -406,13 +397,11 @@ number - `lisp-indent-offset' is not set only if indent_size is (defcustom editorconfig-override-file-local-variables t "Non-nil means editorconfig will override file local variable values." - :type 'boolean - :group 'editorconfig) + :type 'boolean) (defcustom editorconfig-override-dir-local-variables t "Non-nil means editorconfig will override values defined in dir-locals.el ." - :type 'boolean - :group 'editorconfig) + :type 'boolean) (define-error 'editorconfig-error "Error thrown from editorconfig lib") @@ -684,7 +673,7 @@ This function will revert buffer when the coding-system has been changed." (let ((key-val (split-string prop " *= *"))) (when (> (length key-val) 1) (let ((key (intern (car key-val))) - (val (mapconcat 'identity (cdr key-val) ""))) + (val (mapconcat #'identity (cdr key-val) ""))) (puthash key val properties))))))) (defun editorconfig-get-properties-from-exec (filename) diff --git a/ert-tests/editorconfig-core-handle.el b/ert-tests/editorconfig-core-handle.el index 2c28137394..454a1ab1be 100644 --- a/ert-tests/editorconfig-core-handle.el +++ b/ert-tests/editorconfig-core-handle.el @@ -23,7 +23,7 @@ ;;; Code: -(require 'editorconfig-core-handle) +(require 'editorconfig-core-handle "../editorconfig-core-handle") (defconst fixtures (concat (file-name-directory load-file-name) "fixtures/") "Path to fixtures.") diff --git a/ert-tests/editorconfig-core.el b/ert-tests/editorconfig-core.el index 126ee1f514..8d7998b4b3 100644 --- a/ert-tests/editorconfig-core.el +++ b/ert-tests/editorconfig-core.el @@ -23,7 +23,7 @@ ;;; Code: -(require 'editorconfig-core) +(require 'editorconfig-core "../editorconfig-core") (set-variable 'vc-handled-backends nil) diff --git a/ert-tests/editorconfig-fnmatch.el b/ert-tests/editorconfig-fnmatch.el index 6f2bd71786..c7307003c4 100644 --- a/ert-tests/editorconfig-fnmatch.el +++ b/ert-tests/editorconfig-fnmatch.el @@ -23,7 +23,7 @@ ;;; Code: -(require 'editorconfig-fnmatch) +(require 'editorconfig-fnmatch "../editorconfig-fnmatch") (set-variable 'vc-handled-backends nil) diff --git a/ert-tests/editorconfig.el b/ert-tests/editorconfig.el index 4fcfe13f4e..4dae1fa5eb 100644 --- a/ert-tests/editorconfig.el +++ b/ert-tests/editorconfig.el @@ -23,7 +23,7 @@ ;;; Code: -(require 'editorconfig) +(require 'editorconfig "../editorconfig") (set-variable 'vc-handled-backends nil)