[Top][All Lists]

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

Re: Python mode, suggestion for command

From: Eli Zaretskii
Subject: Re: Python mode, suggestion for command
Date: Sun, 30 Jul 2023 08:26:14 +0300

> From: chiel <machiel.kroon@gmail.com>
> 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))


Adding the relevant developers to the discussion.

reply via email to

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