emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python mode, suggestion for command


From: chiel
Subject: Python mode, suggestion for command
Date: Sun, 30 Jul 2023 00:08:50 +0200

Dear python-mode maintainers,

I'd like to suggest adding the following command to python.el, 
and binding it to C-<return> by default. I'd love to hear your thoughts.

(defun python-shell-send-paragraph (&optional send-main msg)
  "Send all lines of code between two white lines to inferior
Python process. SEND-MAIN defaults to nil and MSG to t.
See `python-shell-send-region for more information.
Interactively, SEND-MAIN is the prefix argument"
  (interactive "Pi")
  (python-shell-send-region
   (or (save-excursion (re-search-backward "^[:blank:]*$" nil t)) (point-min))
   (or (save-excursion (re-search-forward  "^[:blank:]*$" nil t)) (point-max))
   send-main (not msg) t))

With kind regards.
Machiel Kroon

reply via email to

[Prev in Thread] Current Thread [Next in Thread]