diff --git a/lisp/treesit.el b/lisp/treesit.el index 04d460fdea4..41ebc62fca6 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2459,7 +2459,8 @@ in `treesit-parser-list'." 'bold nil)) name (if (treesit-node-check node 'named) ")" "\"")))) - (setq treesit--inspect-name name) + ;; Escape the percent character for mode-line. (Bug#65540) + (setq treesit--inspect-name (string-replace "%" "%%" name)) (force-mode-line-update) (when arg (if node-list