|
1 | | -;;; Major mode for editing Python programs, version 1.09 |
| 1 | +;;; Major mode for editing Python programs, version 1.10 |
2 | 2 | ;; by: Tim Peters <[email protected]> |
3 | 3 | ;; after an original idea by: Michael A. Guravage |
4 | 4 | ;; |
@@ -128,6 +128,12 @@ Currently-active file is at the head of the list.") |
128 | 128 | (setq py-inherited-kill-emacs-hook kill-emacs-hook) |
129 | 129 | (setq kill-emacs-hook 'py-kill-emacs-hook))) |
130 | 130 |
|
| 131 | +(defvar python-mode-hook nil |
| 132 | + "*Hook called by `python-mode'.") |
| 133 | + |
| 134 | +(and (fboundp 'make-obsolete-variable) |
| 135 | + (make-obsolete-variable 'py-mode-hook 'python-mode-hook)) |
| 136 | + |
131 | 137 | (defvar py-beep-if-tab-change t |
132 | 138 | "*Ring the bell if tab-width is changed. |
133 | 139 | If a comment of the form |
@@ -273,7 +279,9 @@ py-beep-if-tab-change\tring the bell if tab-width is changed" |
273 | 279 | (if py-beep-if-tab-change (beep))))) |
274 | 280 | (goto-char start)) |
275 | 281 |
|
276 | | - (run-hooks 'py-mode-hook)) |
| 282 | + (if python-mode-hook |
| 283 | + (run-hooks 'python-mode-hook) |
| 284 | + (run-hooks 'py-mode-hook))) |
277 | 285 |
|
278 | 286 | ;;; Functions that execute Python commands in a subprocess |
279 | 287 |
|
@@ -1409,8 +1417,9 @@ CONTROL), press and release `n' (while still holding down CONTROL), & |
1409 | 1417 | then release CONTROL. |
1410 | 1418 |
|
1411 | 1419 | Entering Python mode calls with no arguments the value of the variable |
1412 | | -`py-mode-hook', if that value exists and is not nil; see the `Hooks' |
1413 | | -section of the Elisp manual for details. |
| 1420 | +`python-mode-hook', if that value exists and is not nil; for backward |
| 1421 | +compatibility it also tries `py-mode-hook'; see the `Hooks' section of |
| 1422 | +the Elisp manual for details. |
1414 | 1423 |
|
1415 | 1424 | Obscure: When python-mode is first loaded, it looks for all bindings |
1416 | 1425 | to newline-and-indent in the global keymap, and shadows them with |
|
0 commit comments