Function: clojure--check-wrong-major-mode

clojure--check-wrong-major-mode is a byte-compiled function defined in clojure-mode.el.

Signature

(clojure--check-wrong-major-mode)

Documentation

Check if the current major-mode matches the file extension.

If it doesn't, issue a warning if clojure-verify-major-mode is non-nil.

Source Code

;; Defined in ~/.emacs.d/elpa/clojure-mode-20260325.811/clojure-mode.el
(defun clojure--check-wrong-major-mode ()
  "Check if the current `major-mode' matches the file extension.

If it doesn't, issue a warning if `clojure-verify-major-mode' is
non-nil."
  (when (and clojure-verify-major-mode
             (stringp (buffer-file-name)))
    (let* ((case-fold-search t)
           (file (buffer-file-name))
           (expected (assoc-default file clojure--extension-mode-alist
                                    #'string-match-p))
           (problem (when (and expected (not (eq major-mode expected)))
                      expected)))
      (when problem
        (message "[WARNING] %s activated `%s' instead of `%s' in this buffer.
This could cause problems.
\(See `clojure-verify-major-mode' to disable this message.)"
                 (if (eq major-mode real-this-command)
                     "You have"
                   "Something in your configuration")
                 major-mode
                 problem)))))