From dbfe526b1e96eb825084d8d4f6da31160878d97f Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 28 Jan 2015 23:54:54 -0500 Subject: Send up to line, not point, to Python shell --- lisp/init-python.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lisp/init-python.el') diff --git a/lisp/init-python.el b/lisp/init-python.el index 2003777..7961920 100644 --- a/lisp/init-python.el +++ b/lisp/init-python.el @@ -61,13 +61,10 @@ This is inspired by `ess-eval-function-or-paragraph-and-step'." (goto-char end))) (km/python-next-code-line 1)) -(defun km/python-shell-send-buffer-up-to-point () - "Send from beginning of buffer up until point to Python shell." +(defun km/python-shell-send-buffer-up-to-line () + "Send beginning of buffer to the current line to Python shell." (interactive) - (save-excursion - (setq end (point)) - (goto-char (point-min)) - (python-shell-send-region (point) end))) + (python-shell-send-region (point-min) (line-end-position))) (defun km/python-inside-defun-p () ;; I don't use `python-nav-beginning-of-defun' because it will go to @@ -107,7 +104,7 @@ This is inspired by `ess-eval-function-or-paragraph-and-step'." (key-chord-define python-mode-map ";w" 'auto-complete) (define-key python-mode-map (kbd "C-c C-.") - 'km/python-shell-send-buffer-up-to-point) + 'km/python-shell-send-buffer-up-to-line) (define-key python-mode-map (kbd "C-c C-b") 'python-shell-send-buffer) ;; Rebind `python-shell-send-buffer'. (define-key python-mode-map (kbd "C-c C-c") -- cgit v1.2.3