Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e664896

Browse files
committed
(py-shell): Remove support for Emacs 18, implicitly add support for
Emacs 20, and bind TAB key to self-insert-command in *Python* process.
1 parent d247812 commit e664896

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

Misc/python-mode.el

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -867,21 +867,13 @@ filter."
867867
;; BAW - should undo be disabled in the python process buffer, if
868868
;; this bug still exists?
869869
(interactive)
870-
(if py-this-is-emacs-19-p
871-
(progn
872-
(require 'comint)
873-
(switch-to-buffer-other-window
874-
(make-comint "Python" py-python-command)))
875-
(progn
876-
(require 'shell)
877-
(switch-to-buffer-other-window
878-
(apply (if (fboundp 'make-shell) 'make-shell 'make-comint)
879-
"Python" py-python-command nil))))
880-
(make-local-variable 'shell-prompt-pattern)
881-
(setq shell-prompt-pattern "^>>> \\|^\\.\\.\\. ")
882-
(set-process-filter (get-buffer-process (current-buffer))
883-
'py-process-filter)
884-
(set-syntax-table py-mode-syntax-table))
870+
(require 'comint)
871+
(switch-to-buffer-other-window (make-comint "Python" py-python-command))
872+
(make-local-variable 'comint-prompt-regexp)
873+
(setq comint-prompt-regexp "^>>> \\|^[.][.][.] ")
874+
(set-process-filter (get-buffer-process (current-buffer)) 'py-process-filter)
875+
(set-syntax-table py-mode-syntax-table)
876+
(local-set-key [tab] 'self-insert-command))
885877

886878
(defun py-execute-region (start end)
887879
"Send the region between START and END to a Python interpreter.

0 commit comments

Comments
 (0)