Variable: python-ts-mode-abbrev-table

python-ts-mode-abbrev-table is a variable defined in python.el.gz.

Value

#<obarray n=1>

Documentation

Abbrev table for python-ts-mode.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
;;;###autoload
(define-derived-mode python-ts-mode python-base-mode "Python"
  "Major mode for editing Python files, using tree-sitter library.

\\{python-ts-mode-map}"
  :syntax-table python-mode-syntax-table
  (when (if (fboundp 'treesit-ensure-installed) ; Emacs 31
            (treesit-ensure-installed 'python)
          (treesit-ready-p 'python))
    (setq treesit-primary-parser (treesit-parser-create 'python))
    (setq-local treesit-font-lock-feature-list
                '(( comment definition)
                  ( keyword string type)
                  ( assignment builtin constant decorator
                    escape-sequence number string-interpolation )
                  ( bracket delimiter function operator variable property)))
    (setq-local treesit-font-lock-settings python--treesit-settings)
    (setq-local imenu-create-index-function
                #'python-imenu-treesit-create-index)
    (setq-local treesit-defun-name-function
                #'python--treesit-defun-name)

    (setq-local treesit-thing-settings python--thing-settings)
    (treesit-major-mode-setup)
    ;; Enable the `sexp' navigation by default
    (setq-local forward-sexp-function #'treesit-forward-sexp
                treesit-sexp-thing 'sexp)

    (when (>= emacs-major-version 31)
      (setq-local hs-treesit-things '(or defun sexp))
      (setq-local hs-adjust-block-end-function #'python-ts-hs-adjust-block-end-fn))

    (setq-local syntax-propertize-function #'python--treesit-syntax-propertize)

    (python-skeleton-add-menu-items)

    (when python-indent-guess-indent-offset
      (python-indent-guess-indent-offset))

    (unless (boundp 'treesit-major-mode-remap-alist) ; Emacs 31.1
      (add-to-list 'auto-mode-alist (cons python--auto-mode-alist-regexp 'python-ts-mode))
      (add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode)))))