# HG changeset patch # User Oleksandr Gavenko # Date 1455314506 -7200 # Node ID a49cca7037ba64177b7c058ce5665094ab8823c3 # Parent a0eadfd4cff0df03ad3b130f4c8a0f3f1d4d6744 Add key binding for sending paragraph to python process. diff -r a0eadfd4cff0 -r a49cca7037ba .emacs-my --- a/.emacs-my Fri Feb 12 23:06:29 2016 +0200 +++ b/.emacs-my Sat Feb 13 00:01:46 2016 +0200 @@ -2745,6 +2745,16 @@ (setq python-indent 4) +;; For built-in python.el +(my--eval-after-load python + (defun my-python/send-paragraph () + (interactive) + (save-excursion + (mark-paragraph) + (python-shell-send-region (point) (mark)))) + (define-key python-mode-map [?\C-c ?\C-h] 'my-python/send-paragraph)) + +;; For 3rd party python-mode.el. (my--eval-after-load python-mode (when (and (boundp 'py-version) (equal py-version "5.1.0")) ;; (py-toggle-shells 'cpython)