From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: chiel Newsgroups: gmane.emacs.devel Subject: Python mode, suggestion for command Date: Sun, 30 Jul 2023 00:08:50 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001ead280601a7721a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26334"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 30 06:45:46 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qPyJO-0006f9-0K for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Jul 2023 06:45:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPyDA-0003QA-Rk; Sun, 30 Jul 2023 00:39:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPs7Z-0005Mu-Ay for emacs-devel@gnu.org; Sat, 29 Jul 2023 18:09:09 -0400 Original-Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qPs7X-0006Cq-Na for emacs-devel@gnu.org; Sat, 29 Jul 2023 18:09:09 -0400 Original-Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-584243f84eeso37060267b3.0 for ; Sat, 29 Jul 2023 15:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690668546; x=1691273346; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=1Z+YyVZDuPldQeQLJdxff3LVUV1pCDnxBJtESIRo7EM=; b=I8AyOD/YgYfXvorB2L2rJJzO+61MqEUf0xdNITEv8hDFICbCAFkXRTHQzeplk3e9In HaVClBPUjawNz0505KRBtsfpLiD5DsSRv86x/3KURJXdh6JsWQTIR5ovhisRPvaIG/op IxVlTAedos8zLKu/FVbv/WBk0wf9s0GgKNo5xPkFDqXDCjnrM3ONYt4myMZPMxxCgo/G xzamNNw+SszfE9tmDyLiqcI8eQRPvhJLYEMWzfzsq9k3QRDFKzOZwvWymGiat8uOPTZN jMxoWF/h5Zmimu0elTrHW5c8HTShkEwsUa4sMyvtQOWuu9MtAO6wog0vcsCXPPKXJvg9 esqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690668546; x=1691273346; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1Z+YyVZDuPldQeQLJdxff3LVUV1pCDnxBJtESIRo7EM=; b=gvelhxcur6dMw1dx24x4TzYDSIgWihOZl/KicwFiEPUUh+snn2bOse/ap2fz0BtuQB s8OTIgjJgReoqalRZSFgYCEkYPs6lBhPndChcsCDRCiD+SmjV7yKtgzEANz4xeaGA56m +3cqz3V+gxuZlkEVsANy1axmA+v40Y4eufM1wsW3yHSK+3p6BEKnRbUzoYtiWjpGnxKo yyls9pR/FDQkgKJ/zct1E+tAqqjSCoo9SVDHlrILMONx/MHu7ZpwKRE9E5Hbz1OpF0V7 R6CXdo/UKB6WtIH+5ELYu36Le4ZL4iw0Q9brsNjHx+BpLmNfKDtHmrwYPbttvTnSLggt uJ3A== X-Gm-Message-State: ABy/qLYOLQO6v+ZjA6Cd0miGRIG22b6dyZdBvtHGoVuSiBbrhIbIPmRq WlVjMnluUbvheuRDLohMfNytpOFE5I0+o7TL6OpvHl6jRSvbgQ== X-Google-Smtp-Source: APBJJlEsWqig0me5rgkNUYlYptf31si40anvCQBJ4QPiviUWN4ROmCSOi3j2bisxA4fqGFhHX/F57KjBQLvO6IT5lvs= X-Received: by 2002:a81:6041:0:b0:586:fa6:c5b7 with SMTP id u62-20020a816041000000b005860fa6c5b7mr699804ywb.15.1690668546041; Sat, 29 Jul 2023 15:09:06 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::1132; envelope-from=machiel.kroon@gmail.com; helo=mail-yw1-x1132.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 30 Jul 2023 00:39:09 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308202 Archived-At: --0000000000001ead280601a7721a Content-Type: text/plain; charset="UTF-8" Dear python-mode maintainers, I'd like to suggest adding the following command to python.el, and binding it to C- 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 --0000000000001ead280601a7721a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear python-mode maintainers,

I'd like to suggest adding the following command to python.el,=C2=A0<= /div>
and binding it to C-<return> by default. I'd love to he= ar your thoughts.

(defun python-shell-send-par= agraph (&optional send-main msg)
=C2=A0 "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"
=C2=A0 (intera= ctive "Pi")
=C2=A0 (python-shell-send-region
=C2=A0 =C2=A0(= or (save-excursion (re-search-backward "^[:blank:]*$" nil t)) (po= int-min))
=C2=A0 =C2=A0(or (save-excursion (re-search-forward =C2=A0&quo= t;^[:blank:]*$" nil t)) (point-max))
=C2=A0 =C2=A0send-main (not ms= g) t))

With kind regards.
Machiel Kroon<= br>
--0000000000001ead280601a7721a--