Function: apheleia-mhtml-mode-predicate

apheleia-mhtml-mode-predicate is a natively compiled function defined in apheleia-formatters.el.

Signature

(apheleia-mhtml-mode-predicate)

Documentation

Return mhtml-mode if the user is in that mode.

This checks text properties because mhtml-mode sets major-mode to different values depending on where the user is in the buffer.

Source Code

;; Defined in /nix/store/lwcwryzabcmvjcwwzzs65jrwf7p7d7cs-emacs-packages-deps/share/emacs/site-lisp/elpa/apheleia-20260915.1628/apheleia-formatters.el
(defun apheleia-mhtml-mode-predicate ()
  "Return `mhtml-mode' if the user is in that mode.
This checks text properties because `mhtml-mode' sets
`major-mode' to different values depending on where the user is
in the buffer."
  (when (get-text-property
         (if (and (eobp) (not (bobp)))
             (1- (point))
           (point))
         'mhtml-submode)
    #'mhtml-mode))