From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Python mode, suggestion for command Date: Sun, 30 Jul 2023 08:26:14 +0300 Message-ID: <83tttmkm15.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28453"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: chiel , kobarity , Augusto Stoffel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 30 07:28:28 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 1qPyyi-0007IZ-5G for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Jul 2023 07:28:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPywa-0006N4-TT; Sun, 30 Jul 2023 01:26:16 -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 1qPywZ-0006Jn-8N for emacs-devel@gnu.org; Sun, 30 Jul 2023 01:26:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPywY-0002Lz-W2; Sun, 30 Jul 2023 01:26:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=bU05tyLBt7FP00eZQasOjgbo6eE5n6aEcUiBux1PPG4=; b=MpqhNoTarK7P epoDLNphvkhomfHyXf7AfpICNQsPz3RcdIjhLLtygb/cLeON2PnxuF8IpAsXtYCiPWfYb6WXwK1Zf YbmvJZjJY7RKQDGXoZz9LGrR37TlrtQ+9LWdlrepdHO+wruoCBchrWg1ZY0qytZvFNTRkc3I0m3+F WKmBbRIgBc4DCeVePt+BMeiflaPtpHinjdrAHVtHJUB7kBWifsm8vMXswc5brkArfogJE2aHprf7d qA+K/ngoZWLQ+IMwr2Bd2aR+K/9xuTR/3uVlljklUJO/T2zY8TjfSTJiiXTtmDYk6PbkXvbYcILi5 88AOaBSm3cDPUomEP3UjdQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPywY-0003pM-6O; Sun, 30 Jul 2023 01:26:14 -0400 In-Reply-To: (message from chiel on Sun, 30 Jul 2023 00:08:50 +0200) 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:308203 Archived-At: > From: chiel > 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- 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)) Thanks. Adding the relevant developers to the discussion.