diff options
author | Barry Warsaw <barry@python.org> | 1998-08-20 21:51:27 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1998-08-20 21:51:27 (GMT) |
commit | 6dfbe5dcec1de7c23bcb483652549e80032e1ebc (patch) | |
tree | 99db1742fea648dd48f5debb0524310392a11499 /Misc/python-mode.el | |
parent | a81fb33c6bbf89aecfaebe97d85500ffa0802a50 (diff) | |
download | cpython-6dfbe5dcec1de7c23bcb483652549e80032e1ebc.zip cpython-6dfbe5dcec1de7c23bcb483652549e80032e1ebc.tar.gz cpython-6dfbe5dcec1de7c23bcb483652549e80032e1ebc.tar.bz2 |
(py-shell-map): New variable contains the keymap used in *Python*
shell buffers.
(py-shell): Moved the require of comint to the top level. Also
use-local-map py-shell-map instead of hacking on the comint-mode-map.
This eliminates breakage of other comint-mode buffers (e.g. shell).
Diffstat (limited to 'Misc/python-mode.el')
-rw-r--r-- | Misc/python-mode.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el index c8e78a7..088b0bb 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -105,6 +105,7 @@ ;;; Code: +(require 'comint) (require 'custom) (eval-when-compile (require 'cl) @@ -632,6 +633,16 @@ Optional LIM is ignored." (where-is-internal 'self-insert-command)) ) +(defvar py-shell-map nil + "Keymap used in *Python* shell buffers.") +(if py-shell-map + nil + (setq py-shell-map (copy-keymap comint-mode-map)) + (define-key py-shell-map [tab] 'tab-to-tab-stop) + (define-key py-shell-map "\C-c-" 'py-up-exception) + (define-key py-shell-map "\C-c=" 'py-down-exception) + ) + (defvar py-mode-syntax-table nil "Syntax table used in `python-mode' buffers.") (if py-mode-syntax-table @@ -1193,17 +1204,13 @@ filter." ;; BAW - should undo be disabled in the python process buffer, if ;; this bug still exists? (interactive) - (require 'comint) (switch-to-buffer-other-window (apply 'make-comint py-which-bufname py-which-shell nil py-which-args)) (make-local-variable 'comint-prompt-regexp) (setq comint-prompt-regexp "^>>> \\|^[.][.][.] \\|^(pdb) ") (add-hook 'comint-output-filter-functions 'py-comint-output-filter-function) (set-syntax-table py-mode-syntax-table) - ;; set up keybindings for this subshell - (local-set-key [tab] 'self-insert-command) - (local-set-key "\C-c-" 'py-up-exception) - (local-set-key "\C-c=" 'py-down-exception) + (use-local-map py-shell-map) ) (defun py-clear-queue () |