unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Python mode, suggestion for command
@ 2023-07-29 22:08 chiel
  2023-07-30  5:26 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: chiel @ 2023-07-29 22:08 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 946 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-31 17:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-29 22:08 Python mode, suggestion for command chiel
2023-07-30  5:26 ` Eli Zaretskii
2023-07-30  6:29   ` Eshel Yaron
2023-07-30  6:35     ` chiel
2023-07-30 12:45       ` chiel
2023-07-31 15:52         ` kobarity
2023-07-31 17:08           ` Matthias Meulien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).