Function: markdown--lang-mode-predicate

markdown--lang-mode-predicate is a byte-compiled function defined in markdown-mode.el.

Signature

(markdown--lang-mode-predicate MODE)

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown--lang-mode-predicate (mode)
  (and mode
       (fboundp mode)
       (or
        (not (string-match-p "ts-mode\\'" (symbol-name mode)))
        ;; Don't load tree-sitter mode if the mode is in neither auto-mode-alist nor major-mode-remap-alist
        ;; Because some ts-mode overwrites auto-mode-alist and it might break user configurations

        ;; https://github.com/jrblevin/markdown-mode/issues/787
        ;; major-mode-remap-alist was introduced at Emacs 29.1
        (cl-loop for pair in (bound-and-true-p major-mode-remap-alist)
                 for func = (cdr pair)
                 thereis (and (atom func) (eq mode func)))
        ;; https://github.com/jrblevin/markdown-mode/issues/761
        (cl-loop for pair in auto-mode-alist
                 for func = (cdr pair)
                 thereis (and (atom func) (eq mode func))))))