Skip to content

Commit

Permalink
Better fix for emacs<25
Browse files Browse the repository at this point in the history
  • Loading branch information
galaunay committed Nov 10, 2019
1 parent bf2694a commit 603f01b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions elpy.el
Original file line number Diff line number Diff line change
Expand Up @@ -3508,16 +3508,11 @@ which we're looking."

;; first-prompt-hook has been added in emacs 25.
;; for earlier versions, make sure Elpy's setup code is
;; send to the python shell
;; (it is sent just after the shell creation, which
;; is not ideal as we don't know if the shell is ready,
;; but that should work for non-exotic interpreters).
;; still send to the python shell.
(unless (boundp 'python-shell-first-prompt-hook)
(setq python-shell--first-prompt-received t)
(defvar python-shell-first-prompt-hook '())
(add-hook 'inferior-python-mode-hook
(lambda ()
(run-hooks 'python-shell-first-prompt-hook))))
(advice-add 'elpy-shell-get-or-create-process
:after
'elpy-shell--send-setup-code))

;; Added in Emacs 25
(unless (fboundp 'python-shell-comint-end-of-output-p)
Expand Down

0 comments on commit 603f01b

Please sign in to comment.