branch: scratch/editorconfig-cc commit 527ff0b2105e66bf85b72f742877c227bce356e5 Author: 10sr <8slashes+...@gmail.com> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Fix some warnings reported by flycheck Mainly docstring fix --- editorconfig.el | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/editorconfig.el b/editorconfig.el index 840708fcc4..9f9c672e05 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -45,7 +45,9 @@ (defcustom editorconfig-exec-path "editorconfig" - "EditorConfig command" + "EditorConfig executable name. + +This executable is invoked by `editorconfig-call-editorconfig-exec'." :type 'string :group 'editorconfig) (define-obsolete-variable-alias @@ -68,23 +70,21 @@ property values as values." "0.5") (defcustom editorconfig-custom-hooks () - "A list of custom hooks after loading common EditorConfig settings + "A list of custom hooks after loading common EditorConfig settings. -Each element in this list is a hook function. This hook function takes one -parameter, which is a property hash table. The value of properties can be +Each element in this list is a hook function. This hook function takes one +parameter, which is a property hash table. The value of properties can be obtained through gethash function. The hook does not have to be coding style related; you can add whatever -functionality you want. For example, the following is an example to add a new +functionality you want. For example, the following is an example to add a new property emacs_linum to decide whether to show line numbers on the left -(add-to-list 'editorconfig-custom-hooks - '(lambda (props) - (let ((show-line-num (gethash 'emacs_linum props))) - (cond ((equal show-line-num \"true\") (linum-mode 1)) - ((equal show-line-num \"false\") (linum-mode 0)))))) - -" + (add-to-list 'editorconfig-custom-hooks + '(lambda (props) + (let ((show-line-num (gethash 'emacs_linum props))) + (cond ((equal show-line-num \"true\") (linum-mode 1)) + ((equal show-line-num \"false\") (linum-mode 0))))))" :type '(lambda (properties) (body)) :group 'editorconfig) (define-obsolete-variable-alias @@ -173,22 +173,32 @@ NOTE: Only the **buffer local** value of VARIABLE will be set." "0.5") (defun editorconfig-string-integer-p (string) - "Whether a string representing integer" + "Return non-nil if STRING represents integer." (if (stringp string) (string-match-p "\\`[0-9]+\\'" string) nil)) +(defun editorconfig-set-indentation/python-mode (size) + "Set `python-mode' indent size to SIZE." + ) + +(defun editorconfig-set-indentation/latex-mode (size) + "Set `latex-mode' indent size to SIZE." + ) + (defun editorconfig-set-indentation (style &optional size tab_width) + "Set indentation type from STYLE, SIZE and TAB_WIDTH." (if (editorconfig-string-integer-p size) (setq size (string-to-number size)) (when (not (equal size "tab")) (setq size nil))) ) (defun editorconfig-set-line-ending (end-of-line) + "Set line ending style to CR, LF, or CRLF by END-OF-LINE." ) (defun editorconfig-set-line-length (length) - "set the max line length (fill-column)" + "Set the max line length (fill-column) to LENGTH." (when (editorconfig-string-integer-p length) (set-fill-column (string-to-number length)))) @@ -217,6 +227,7 @@ It calls `editorconfig-get-properties-from-exec' if (editorconfig-core-get-properties-hash))) (defun editorconfig-apply () + "Apply EditorConfig properties for current buffer." (when buffer-file-name (let ((props (and (functionp editorconfig-get-properties-function) (funcall editorconfig-get-properties-function))))