Function: editorconfig-major-mode-hook

editorconfig-major-mode-hook is a byte-compiled function defined in editorconfig.el.gz.

Signature

(editorconfig-major-mode-hook)

Documentation

Function to run when major-mode has been changed.

This functions does not reload .editorconfig file, just sets local variables again. Changing major mode can reset these variables.

This function also executes editorconfig-after-apply-functions functions.

Source Code

;; Defined in /usr/src/emacs/lisp/editorconfig.el.gz
(defun editorconfig-major-mode-hook ()
  "Function to run when `major-mode' has been changed.

This functions does not reload .editorconfig file, just sets local variables
again.  Changing major mode can reset these variables.

This function also executes `editorconfig-after-apply-functions' functions."
  (display-warning '(editorconfig editorconfig-major-mode-hook)
                   (format "editorconfig-major-mode-hook: editorconfig-mode: %S, major-mode: %S, -properties-hash: %S"
                           (and (boundp 'editorconfig-mode)
                                editorconfig-mode)
                           major-mode
                           editorconfig-properties-hash)
                   :debug)
  (when (and (bound-and-true-p editorconfig-mode)
             editorconfig-properties-hash)
    (editorconfig-set-local-variables editorconfig-properties-hash)
    (condition-case err
        (run-hook-with-args 'editorconfig-after-apply-functions editorconfig-properties-hash)
      (error
       (display-warning '(editorconfig editorconfig-major-mode-hook)
                        (format "Error while running `editorconfig-after-apply-functions': %S"
                                err))))))