Function: markdown-ts--configure-current-buffer
markdown-ts--configure-current-buffer is a byte-compiled function
defined in markdown-ts-mode.el.gz.
Signature
(markdown-ts--configure-current-buffer CONFIGURATION)
Documentation
Add CONFIGURATION to the current buffer.
CONFIGURATION includes font-lock and indent rules. For font-lock rules, use the same features enabled in MODE.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode.el.gz
(defun markdown-ts--configure-current-buffer (configuration)
"Add CONFIGURATION to the current buffer.
CONFIGURATION includes font-lock and indent rules. For font-lock rules,
use the same features enabled in MODE."
(setq treesit-font-lock-settings
(append treesit-font-lock-settings
;; Get all the font-lock settings, including ones that
;; don't pertain to MODE. This way, we get jsdoc
;; from js-ts-mode, for example.
(plist-get configuration :font-lock)))
(setq treesit-simple-indent-rules
(append treesit-simple-indent-rules
;; Similarly, get all indent rules.
(plist-get configuration :simple-indent)))
(setq treesit-range-settings
(append treesit-range-settings
;; Filter out function queries, because they are
;; usually some hack and might escape the code block.
;; Case in point: c-ts-mode's range setting.
(seq-filter (lambda (setting)
(not (functionp (car setting))))
(plist-get configuration :range))))
(setq-local indent-line-function #'treesit-indent)
(setq-local indent-region-function #'treesit-indent-region))