mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
(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).
This commit is contained in:
parent
a81fb33c6b
commit
6dfbe5dcec
1 changed files with 12 additions and 5 deletions
|
@ -105,6 +105,7 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'comint)
|
||||||
(require 'custom)
|
(require 'custom)
|
||||||
(eval-when-compile
|
(eval-when-compile
|
||||||
(require 'cl)
|
(require 'cl)
|
||||||
|
@ -632,6 +633,16 @@ Optional LIM is ignored."
|
||||||
(where-is-internal 'self-insert-command))
|
(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
|
(defvar py-mode-syntax-table nil
|
||||||
"Syntax table used in `python-mode' buffers.")
|
"Syntax table used in `python-mode' buffers.")
|
||||||
(if py-mode-syntax-table
|
(if py-mode-syntax-table
|
||||||
|
@ -1193,17 +1204,13 @@ filter."
|
||||||
;; BAW - should undo be disabled in the python process buffer, if
|
;; BAW - should undo be disabled in the python process buffer, if
|
||||||
;; this bug still exists?
|
;; this bug still exists?
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'comint)
|
|
||||||
(switch-to-buffer-other-window
|
(switch-to-buffer-other-window
|
||||||
(apply 'make-comint py-which-bufname py-which-shell nil py-which-args))
|
(apply 'make-comint py-which-bufname py-which-shell nil py-which-args))
|
||||||
(make-local-variable 'comint-prompt-regexp)
|
(make-local-variable 'comint-prompt-regexp)
|
||||||
(setq comint-prompt-regexp "^>>> \\|^[.][.][.] \\|^(pdb) ")
|
(setq comint-prompt-regexp "^>>> \\|^[.][.][.] \\|^(pdb) ")
|
||||||
(add-hook 'comint-output-filter-functions 'py-comint-output-filter-function)
|
(add-hook 'comint-output-filter-functions 'py-comint-output-filter-function)
|
||||||
(set-syntax-table py-mode-syntax-table)
|
(set-syntax-table py-mode-syntax-table)
|
||||||
;; set up keybindings for this subshell
|
(use-local-map py-shell-map)
|
||||||
(local-set-key [tab] 'self-insert-command)
|
|
||||||
(local-set-key "\C-c-" 'py-up-exception)
|
|
||||||
(local-set-key "\C-c=" 'py-down-exception)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun py-clear-queue ()
|
(defun py-clear-queue ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue