Shadow python-mode-hook during python-send-shell-*
This commit is contained in:
parent
76ba46893b
commit
d25b329c17
|
@ -1902,6 +1902,7 @@ Other:
|
||||||
- Added diminish for importmagic (thanks to Loys Ollivier)
|
- Added diminish for importmagic (thanks to Loys Ollivier)
|
||||||
- Added debugger integration via =dap= layer
|
- Added debugger integration via =dap= layer
|
||||||
- Added documentation on installing importmagic and epc (thanks to Trapez Breen)
|
- Added documentation on installing importmagic and epc (thanks to Trapez Breen)
|
||||||
|
- Made python-send-shell-* functions faster (thanks to Trapez Breen)
|
||||||
**** Racket
|
**** Racket
|
||||||
- Restore smart closing paren behavior in racket-mode (thanks to Don March)
|
- Restore smart closing paren behavior in racket-mode (thanks to Don March)
|
||||||
**** Ranger
|
**** Ranger
|
||||||
|
|
|
@ -361,23 +361,44 @@ to be called for each testrunner. "
|
||||||
(defun spacemacs/python-shell-send-buffer-switch ()
|
(defun spacemacs/python-shell-send-buffer-switch ()
|
||||||
"Send buffer content to shell and switch to it in insert mode."
|
"Send buffer content to shell and switch to it in insert mode."
|
||||||
(interactive)
|
(interactive)
|
||||||
(python-shell-send-buffer)
|
(let ((python-mode-hook nil))
|
||||||
(python-shell-switch-to-shell)
|
(python-shell-send-buffer)
|
||||||
(evil-insert-state))
|
(python-shell-switch-to-shell)
|
||||||
|
(evil-insert-state)))
|
||||||
|
|
||||||
|
(defun spacemacs/python-shell-send-buffer ()
|
||||||
|
"Send buffer content to shell and switch to it in insert mode."
|
||||||
|
(interactive)
|
||||||
|
(let ((python-mode-hook nil))
|
||||||
|
(python-shell-send-buffer)))
|
||||||
|
|
||||||
(defun spacemacs/python-shell-send-defun-switch ()
|
(defun spacemacs/python-shell-send-defun-switch ()
|
||||||
"Send function content to shell and switch to it in insert mode."
|
"Send function content to shell and switch to it in insert mode."
|
||||||
(interactive)
|
(interactive)
|
||||||
(python-shell-send-defun nil)
|
(let ((python-mode-hook nil))
|
||||||
(python-shell-switch-to-shell)
|
(python-shell-send-defun nil)
|
||||||
(evil-insert-state))
|
(python-shell-switch-to-shell)
|
||||||
|
(evil-insert-state)))
|
||||||
|
|
||||||
|
(defun spacemacs/python-shell-send-defun ()
|
||||||
|
"Send function content to shell and switch to it in insert mode."
|
||||||
|
(interactive)
|
||||||
|
(let ((python-mode-hook nil))
|
||||||
|
(python-shell-send-defun nil)))
|
||||||
|
|
||||||
(defun spacemacs/python-shell-send-region-switch (start end)
|
(defun spacemacs/python-shell-send-region-switch (start end)
|
||||||
"Send region content to shell and switch to it in insert mode."
|
"Send region content to shell and switch to it in insert mode."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(python-shell-send-region start end)
|
(let ((python-mode-hook nil))
|
||||||
(python-shell-switch-to-shell)
|
(python-shell-send-region start end)
|
||||||
(evil-insert-state))
|
(python-shell-switch-to-shell)
|
||||||
|
(evil-insert-state)))
|
||||||
|
|
||||||
|
(defun spacemacs/python-shell-send-region (start end)
|
||||||
|
"Send region content to shell and switch to it in insert mode."
|
||||||
|
(interactive "r")
|
||||||
|
(let ((python-mode-hook nil))
|
||||||
|
(python-shell-send-region start end)))
|
||||||
|
|
||||||
(defun spacemacs/python-start-or-switch-repl ()
|
(defun spacemacs/python-start-or-switch-repl ()
|
||||||
"Start and/or switch to the REPL."
|
"Start and/or switch to the REPL."
|
||||||
|
|
|
@ -324,12 +324,12 @@
|
||||||
"db" 'spacemacs/python-toggle-breakpoint
|
"db" 'spacemacs/python-toggle-breakpoint
|
||||||
"ri" 'spacemacs/python-remove-unused-imports
|
"ri" 'spacemacs/python-remove-unused-imports
|
||||||
"sB" 'spacemacs/python-shell-send-buffer-switch
|
"sB" 'spacemacs/python-shell-send-buffer-switch
|
||||||
"sb" 'python-shell-send-buffer
|
"sb" 'spacemacs/python-shell-send-buffer
|
||||||
"sF" 'spacemacs/python-shell-send-defun-switch
|
"sF" 'spacemacs/python-shell-send-defun-switch
|
||||||
"sf" 'python-shell-send-defun
|
"sf" 'spacemacs/python-shell-send-defun
|
||||||
"si" 'spacemacs/python-start-or-switch-repl
|
"si" 'spacemacs/python-start-or-switch-repl
|
||||||
"sR" 'spacemacs/python-shell-send-region-switch
|
"sR" 'spacemacs/python-shell-send-region-switch
|
||||||
"sr" 'python-shell-send-region)
|
"sr" 'spacemacs/python-shell-send-region)
|
||||||
|
|
||||||
;; Set `python-indent-guess-indent-offset' to `nil' to prevent guessing `python-indent-offset
|
;; Set `python-indent-guess-indent-offset' to `nil' to prevent guessing `python-indent-offset
|
||||||
;; (we call python-indent-guess-indent-offset manually so python-mode does not need to do it)
|
;; (we call python-indent-guess-indent-offset manually so python-mode does not need to do it)
|
||||||
|
|
Loading…
Reference in a new issue