Variable: python-mode-hook

python-mode-hook is a variable defined in python.el.gz.

Value

nil

Documentation

Hook run after entering python-mode.

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

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

\\{python-mode-map}"
  (setq-local font-lock-defaults
              `(,python-font-lock-keywords
                nil nil nil nil
                (font-lock-syntactic-face-function
                 . python-font-lock-syntactic-face-function)))
  (setq-local syntax-propertize-function
              python-syntax-propertize-function)
  (setq-local imenu-create-index-function
              #'python-imenu-create-index)

  (add-hook 'which-func-functions #'python-info-current-defun nil t)

  (python-skeleton-add-menu-items)

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