diff options
author | Guido van Rossum <guido@python.org> | 1994-11-10 23:01:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-11-10 23:01:59 (GMT) |
commit | a67bb7ea98119d023b067564f387fdf755b5a263 (patch) | |
tree | 4ff602f5badf8784a977ac987bdfb63e92fbb233 | |
parent | f34cadda28d6ac41942dd87acc3cc4821506a052 (diff) | |
download | cpython-a67bb7ea98119d023b067564f387fdf755b5a263.zip cpython-a67bb7ea98119d023b067564f387fdf755b5a263.tar.gz cpython-a67bb7ea98119d023b067564f387fdf755b5a263.tar.bz2 |
python-mode-hook instead of py-mode-hook
-rw-r--r-- | Misc/python-mode-old.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Misc/python-mode-old.el b/Misc/python-mode-old.el index 58b9303..de5a8cb 100644 --- a/Misc/python-mode-old.el +++ b/Misc/python-mode-old.el @@ -1,4 +1,4 @@ -;;; Major mode for editing Python programs, version 1.09 +;;; Major mode for editing Python programs, version 1.10 ;; by: Tim Peters <tim@ksr.com> ;; after an original idea by: Michael A. Guravage ;; @@ -128,6 +128,12 @@ Currently-active file is at the head of the list.") (setq py-inherited-kill-emacs-hook kill-emacs-hook) (setq kill-emacs-hook 'py-kill-emacs-hook))) +(defvar python-mode-hook nil + "*Hook called by `python-mode'.") + +(and (fboundp 'make-obsolete-variable) + (make-obsolete-variable 'py-mode-hook 'python-mode-hook)) + (defvar py-beep-if-tab-change t "*Ring the bell if tab-width is changed. If a comment of the form @@ -273,7 +279,9 @@ py-beep-if-tab-change\tring the bell if tab-width is changed" (if py-beep-if-tab-change (beep))))) (goto-char start)) - (run-hooks 'py-mode-hook)) + (if python-mode-hook + (run-hooks 'python-mode-hook) + (run-hooks 'py-mode-hook))) ;;; Functions that execute Python commands in a subprocess @@ -1409,8 +1417,9 @@ CONTROL), press and release `n' (while still holding down CONTROL), & then release CONTROL. Entering Python mode calls with no arguments the value of the variable -`py-mode-hook', if that value exists and is not nil; see the `Hooks' -section of the Elisp manual for details. +`python-mode-hook', if that value exists and is not nil; for backward +compatibility it also tries `py-mode-hook'; see the `Hooks' section of +the Elisp manual for details. Obscure: When python-mode is first loaded, it looks for all bindings to newline-and-indent in the global keymap, and shadows them with |