Function: editorconfig-apply
editorconfig-apply is an autoloaded, interactive and byte-compiled
function defined in editorconfig-tools.el.gz.
Signature
(editorconfig-apply)
Documentation
Get and apply EditorConfig properties to current buffer.
This function does not respect the values of editorconfig-exclude-modes and
editorconfig-exclude-regexps and always applies available properties.
Use editorconfig-mode-apply instead to make use of these variables.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/editorconfig-tools.el.gz
;;;###autoload
(defun editorconfig-apply ()
"Get and apply EditorConfig properties to current buffer.
This function does not respect the values of `editorconfig-exclude-modes' and
`editorconfig-exclude-regexps' and always applies available properties.
Use `editorconfig-mode-apply' instead to make use of these variables."
(interactive)
(when buffer-file-name
(condition-case err
(progn
(let ((props (editorconfig-call-get-properties-function buffer-file-name)))
(condition-case err
(run-hook-with-args 'editorconfig-hack-properties-functions props)
(error
(display-warning '(editorconfig editorconfig-hack-properties-functions)
(format "Error while running editorconfig-hack-properties-functions, abort running hook: %S"
err)
:warning)))
(setq editorconfig-properties-hash props)
(editorconfig-set-local-variables props)
(editorconfig-set-coding-system-revert
(gethash 'end_of_line props)
(gethash 'charset props))
(condition-case err
(run-hook-with-args 'editorconfig-after-apply-functions props)
(error
(display-warning '(editorconfig editorconfig-after-apply-functions)
(format "Error while running editorconfig-after-apply-functions, abort running hook: %S"
err)
:warning)))))
(error
(display-warning '(editorconfig editorconfig-apply)
(format "Error in editorconfig-apply, styles will not be applied: %S" err)
:error)))))