Function: markdown-ts-mode--initialize

markdown-ts-mode--initialize is a byte-compiled function defined in markdown-ts-mode.el.gz.

Signature

(markdown-ts-mode--initialize)

Documentation

Invoke this from major mode definitions after local variable set up.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode.el.gz
(defun markdown-ts-mode--initialize ()
  "Invoke this from major mode definitions after local variable set up."
  (treesit-ensure-installed 'markdown)
  (treesit-ensure-installed 'markdown-inline)
  ;; Bypass `treesit-max-buffer-size' so the mode activates in large
  ;; buffers instead of refusing.  `treesit-ready-p' would otherwise
  ;; refuse and emit a misleading "parsers not found" message even when
  ;; they are installed.  Revisit if `treesit-parser-create' gains its
  ;; own buffer-size guard (see bug#80909).
  (let ((treesit-max-buffer-size most-positive-fixnum))
    (cond ((treesit-ready-p '(markdown markdown-inline) t)
           (markdown-ts--set-up))
          (t
           (warn "markdown-ts-mode cannot be set up; using text-mode.
%s."
                 (if (treesit-available-p)
                     "The tree-sitter parsers `markdown' and `markdown-inline' were not found.
Use the command `markdown-ts-mode-install-parsers' to install them.
With a prefix argument, it can also install optional parsers"
                   "Emacs was built without Tree-sitter support, or could not load Tree-sitter"))
           (text-mode)))))