branch: scratch/editorconfig-cc commit 849229726d7edfffd2ed901dfa6f1c9f458571cb Author: Hong Xu <h...@topbug.net> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Massive reformatting of docstrings. --- editorconfig.el | 64 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/editorconfig.el b/editorconfig.el index 92477b05c8..3291a9b923 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -48,8 +48,8 @@ (defgroup editorconfig nil "EditorConfig Emacs Plugin. -EditorConfig Helps developers define and maintain consistent coding styles -between different editors and IDEs" +EditorConfig helps developers define and maintain consistent +coding styles between different editors and IDEs." :tag "EditorConfig" :prefix "editorconfig-" :group 'tools) @@ -68,11 +68,12 @@ This executable is invoked by `editorconfig-call-editorconfig-exec'." (defcustom editorconfig-get-properties-function 'editorconfig-get-properties - "Function to get EditorConofig properties for current buffer. -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." + "A function which gets EditorConofig properties for current buffer. + +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." :type 'function :group 'editorconfig) (define-obsolete-variable-alias @@ -83,13 +84,14 @@ property values as values." (defcustom editorconfig-custom-hooks () "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 -obtained through gethash function. +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 -property emacs_linum to decide whether to show line numbers on the left +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 property emacs_linum to decide whether to +show line numbers on the left: (add-hook 'editorconfig-custom-hooks '(lambda (props) @@ -156,8 +158,8 @@ property emacs_linum to decide whether to show line numbers on the left Each element looks like (MODE . FUNCTION) or (MODE . INDENT-SPEC-LIST). -If FUNCTION is provided, it will be called when setting the indentation. The -indent size will be passed. +If FUNCTION is provided, it will be called when setting the +indentation. The indent size will be passed. If INDENT-SPEC-LIST is provided, each element of it must have one of the following forms: @@ -199,14 +201,15 @@ NOTE: Only the **buffer local** value of VARIABLE will be set." (defcustom editorconfig-exclude-regexps (list (eval-when-compile (rx string-start (or "http" "https" "ftp" "sftp" "rsync") ":"))) - "List of buffer filename prefix regexp patterns not to apply properties." + "List of buffer filename prefix regexp patterns not to apply +properties." :type '(repeat string) :group 'editorconfig) (defvar editorconfig-properties-hash nil "Hash object of EditorConfig properties for current buffer. -Set by `editorconfig-apply' and nil if that is not invoked in current buffer -yet.") +Set by `editorconfig-apply' and nil if that is not invoked in +current buffer yet.") (make-variable-buffer-local 'editorconfig-properties-hash) @@ -253,7 +256,7 @@ yet.") (defun editorconfig-set-line-length (length) - "Set the max line length (fill-column) to LENGTH." + "Set the max line length (`fill-column') to LENGTH." (when (and (editorconfig-string-integer-p length) (> (string-to-number length) 0)) (set-fill-column (string-to-number length)))) @@ -265,7 +268,8 @@ yet.") ) (defun editorconfig-get-properties-from-exec () - "Get EditorConfig properties of current buffer by calling `editorconfig-exec-path'." + "Get EditorConfig properties of current buffer by calling +`editorconfig-exec-path'." (if (executable-find editorconfig-exec-path) (editorconfig-parse-properties (editorconfig-call-editorconfig-exec)) (error "Unable to find editorconfig executable"))) @@ -302,8 +306,8 @@ It calls `editorconfig-get-properties-from-exec' if ;;;###autoload (defun editorconfig-apply () "Apply EditorConfig properties for current buffer. -This function ignores `editorconfig-exclude-modes' and always applies available -properties." +This function ignores `editorconfig-exclude-modes' and always +applies available properties." (interactive) (when buffer-file-name (condition-case err @@ -326,8 +330,8 @@ properties." (defun editorconfig-mode-apply () "Apply EditorConfig properties for current buffer. -This function do the job only when the major mode is not listed in -`editorconfig-exclude-modes'." +This function does the job only when the major mode is not listed +in `editorconfig-exclude-modes'." (when (and major-mode (not (memq major-mode editorconfig-exclude-modes)) @@ -341,9 +345,9 @@ This function do the job only when the major mode is not listed in ;;;###autoload (define-minor-mode editorconfig-mode "Toggle EditorConfig feature. -When enabled EditorConfig properties will be applied to buffers when first -visiting files or changing major modes if the major mode is not listed in -`editorconfig-exclude-modes'." +When enabled EditorConfig properties will be applied to buffers +when first visiting files or changing major modes if the major +mode is not listed in `editorconfig-exclude-modes'." :global t :lighter " EditorConfig" (dolist (hook '(after-change-major-mode-hook)) @@ -352,3 +356,9 @@ visiting files or changing major modes if the major mode is not listed in (remove-hook hook 'editorconfig-mode-apply)))) (provide 'editorconfig) + +;;; editorconfig.el ends here + +;; Local Variables: +;; sentence-end-double-space: t +;; End: