From: Yuan Fu Date: Mon, 21 Nov 2022 04:43:15 +0000 (-0800) Subject: Add separate keymaps for js/python/css-ts-mode X-Git-Tag: emacs-29.0.90~1627 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1e624452004e17bec2070b0c0b9f5639f66df1f8;p=emacs.git Add separate keymaps for js/python/css-ts-mode * lisp/progmodes/js.el (js-ts-mode-map) * lisp/progmodes/python.el (python-ts-mode-map) * lisp/textmodes/css-mode.el (css-ts-mode-map): New keymap. --- diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 50674a1c039..6d4f7d4f84e 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -665,6 +665,9 @@ This variable is like `sgml-attribute-offset'." :doc "Keymap for `js-mode'." "M-." #'js-find-symbol) +(defvar js-ts-mode-map (copy-keymap js-mode-map) + "Keymap used in `js-ts-mode'.") + ;;; Syntax table and parsing (defvar js-mode-syntax-table diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d38d0292775..c9a69a924e0 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -396,6 +396,9 @@ instead." map) "Keymap for `python-mode'.") +(defvar python-ts-mode-map (copy-keymap python-mode-map) + "Keymap for `(copy-keymap python-mode-map)'.") + ;;; Python specialized rx @@ -6597,7 +6600,7 @@ implementations: `python-mode' and `python-ts-mode'." (define-derived-mode python-ts-mode python-base-mode "Python" "Major mode for editing Python files, using tree-sitter library. -\\{python-mode-map}" +\\{python-ts-mode-map}" (when (treesit-ready-p 'python) (treesit-parser-create 'python) (setq-local treesit-font-lock-feature-list diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 97272cb7147..5d4dbe155ad 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1323,6 +1323,9 @@ for determining whether point is within a selector." ;;; Tree-sitter +(defvar css-ts-mode-map (copy-keymap css-mode-map) + "Keymap used in `css-ts-mode'.") + (defvar css--treesit-indent-rules '((css ((node-is "}") parent-bol 0)