From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id SNFtAFP5bmU+PgAA9RJhRA:P1 (envelope-from ) for ; Tue, 05 Dec 2023 11:20:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SNFtAFP5bmU+PgAA9RJhRA (envelope-from ) for ; Tue, 05 Dec 2023 11:20:03 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BABC21773A for ; Tue, 5 Dec 2023 11:20:02 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BRkDnbI5; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701771602; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+MJTExovui4b82/0vL7tEzfJVPg6aDMfLaPW/Ev3fmU=; b=Q3YgXaIs7XkddVqqlNIekpmmpGCimszeH3zEHhOZBF70hqmsklYgY0Psk6cukKkmjWdVgX ONu9chUatkMlOWiIhTtp9gfda+nNONf17Chf+DsGIXhtBRhzDrZZTwa35BY8tBcJw2DxDM zpk2+degtxX7veyoKIWnGNQA82Y/bKyD4nRPgbFLdedz2KdW4ugk9m9g2UGsTqyoa1k5OE NINeS2kniNZJNlTXDXhPTKHLtgKk0d649og5EbZqsEEuHMWq3meEtQMsfIXH5sLeKr6tzT 26CjRLMldDecuuOa0zk0BhjR4Q2BlKlSTPIPwIQFFKwFo0qIkiWiOGYZrrq9Kw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BRkDnbI5; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701771602; a=rsa-sha256; cv=none; b=YWplY4ri4V1+Z2tZtrodu0Jvq11A5LMVSnofbcNQe+PYaULbBVaH3s/XDz96kOmd7rphji z+lZgE72c7vxSoSkmVX9wS8NSzL7PfpVNiFKPDj4N8G8cwNCczzeHGjEtDGuJdmiv45sg7 r3rBvOk0OvO/X4SgMvEqSLWQWHtANkEOoUkdMH1tzQP0zKl9LiQUo2h32IDo0vQ6Pezi2j sHqw7rP7vzySD3fjP4OaA+egr+yEt6E98sCyHNOi+GSw4u0KBBqiSIujeUHjQX4IvZvT4Z M4jj3EnzmDeIbw5nsVYcCS5Fr2r6A7Pljz38Q4l2oat4rIsjep92VoaktrfzXw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rASWL-00089s-Ou; Tue, 05 Dec 2023 05:19:18 -0500 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 1rASWH-00089R-KU for emacs-orgmode@gnu.org; Tue, 05 Dec 2023 05:19:16 -0500 Received: from mail-vs1-xe33.google.com ([2607:f8b0:4864:20::e33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rASWF-0004xP-WD for emacs-orgmode@gnu.org; Tue, 05 Dec 2023 05:19:13 -0500 Received: by mail-vs1-xe33.google.com with SMTP id ada2fe7eead31-4649f003bcdso385480137.1 for ; Tue, 05 Dec 2023 02:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701771550; x=1702376350; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=+MJTExovui4b82/0vL7tEzfJVPg6aDMfLaPW/Ev3fmU=; b=BRkDnbI5UfiLTK80mhRkmzlR9cnn6xdNmKgEO4SgXBy2F7aS2+ed4+4sPRjBH9I161 dI0+qr0EPGYz74GP/Mxxks/poDpOHyY8eZfgXCb/3Rart52XSVVITBQHN9sIJ0bKVoIn cvh5VFCqU+ZAT2gNeGnEv9+LVitHgoAFFeHzD11Tg3TE+foBSss0BOPIvsANVi6FQKIx opc4mcv4LyraWqwkD0hjFptVf5qobkAePHatCdFyol6cTknILn9B4ztfaCnSGqRt97E9 ThGhPrcEadaTmo7sEuBtpMF92sqk44sndsDYJVZ6nIR0iyelJMx8EmMIAGS6Vrb83Ivm MatA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701771550; x=1702376350; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+MJTExovui4b82/0vL7tEzfJVPg6aDMfLaPW/Ev3fmU=; b=w0DFGQmz+/UymuF/wtVSGvZaF5UWN5txq0iCWEBNrBAHiW1bd8xjerelyS/LP7baHx Ptk9D961GPqiZuJrezMuezM2NBUQSJJx8iLvddn0o+g7vfSNJX1awEFtgWYVY/g1PxYV U48mS5g/hVSyWK9b0KB4KeRMKo6C0rcHpPaJEow8bN+SO8zMDC608r2Tav1qsczC2qNf 8zVx8BNzbuvjWT2Baus/xvtz0RE9tx+VRIougAwD7tj+iyiJk12vf6WRDCDmRXUeju25 W/IZyrJHzIz4Cod9Xj81V2D98KrMoB0CkaQ6iQ4RTpX2IuC7gyegCAeaT6raAI5E8mBI x1KA== X-Gm-Message-State: AOJu0YzJ0j+6v42+EtK0knilXnqCvfRsAgUvEpWp4XMcxDfakzcH3Wrt w3yi2MeTD4l/8KmInU8AgZh2twy/S5hQUDt4YSgA3iJOuLLK8g== X-Google-Smtp-Source: AGHT+IH1pYeysPLV9MLTh2/wwlT/y4OIAAk1gtGzFyEdBOqVhS/8Yuy6f6gDDvIWdlwxTMzTI/uXDle/Ze7Z//Ln314= X-Received: by 2002:a67:fdd9:0:b0:464:8cc1:7aa1 with SMTP id l25-20020a67fdd9000000b004648cc17aa1mr2521002vsq.13.1701771550342; Tue, 05 Dec 2023 02:19:10 -0800 (PST) MIME-Version: 1.0 From: Liu Hui Date: Tue, 5 Dec 2023 18:18:59 +0800 Message-ID: Subject: [PATCH] Set Python shell in Org edit buffer To: emacs-orgmode@gnu.org Content-Type: multipart/mixed; boundary="000000000000c04c75060bc09014" Received-SPF: pass client-ip=2607:f8b0:4864:20::e33; envelope-from=liuhui1610@gmail.com; helo=mail-vs1-xe33.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=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-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: BABC21773A X-Spam-Score: -8.26 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -8.26 X-TUID: 2LXxf5WIdPuf --000000000000c04c75060bc09014 Content-Type: text/plain; charset="UTF-8" Hi, When editing python src block using C-c ', the python shell is not set in Org edit buffer according to the :session header argument of the block. Consequently, commands such as python-shell-send-region cannot send python code to the correct python process. To address this, the attached patch defines org-babel-edit-prep:python in ob-python.el. In addition, I tried to use org-src-associate-babel-session at first, but found it doesn't work because it is called when enabling org-src-mode, where org-src--babel-info is still nil. It seems it has stopped working since 203bf5870, and I think it is safe to remove it and related stuffs to avoid confusion. Best, Liu Hui --000000000000c04c75060bc09014 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Set-Python-shell-in-Org-edit-buffer.patch" Content-Disposition: attachment; filename="0001-Set-Python-shell-in-Org-edit-buffer.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lps6qwdb0 RnJvbSBjOGI5YzE3NGNmNjQzYmQ2MjVjZWRjMzExZDI2MDRlNmZjM2JiODNhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSHVpIDxsaXVodWkxNjEwQGdtYWlsLmNvbT4KRGF0ZTog VHVlLCA1IERlYyAyMDIzIDExOjQwOjM4ICswODAwClN1YmplY3Q6IFtQQVRDSF0gU2V0IFB5dGhv biBzaGVsbCBpbiBPcmcgZWRpdCBidWZmZXIKCiogbGlzcC9vYi1weXRob24uZWwgKG9yZy1iYWJl bC1lZGl0LXByZXA6cHl0aG9uKTogTmV3IGZ1bmN0aW9uLgotLS0KIGxpc3Avb2ItcHl0aG9uLmVs IHwgNyArKysrKysrCiAxIGZpbGUgY2hhbmdlZCwgNyBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0 IGEvbGlzcC9vYi1weXRob24uZWwgYi9saXNwL29iLXB5dGhvbi5lbAppbmRleCA2YzU2OGEzNmQu LjhmZjJjN2ExZCAxMDA2NDQKLS0tIGEvbGlzcC9vYi1weXRob24uZWwKKysrIGIvbGlzcC9vYi1w eXRob24uZWwKQEAgLTY3LDYgKzY3LDEzIEBAIChkZWZjdXN0b20gb3JnLWJhYmVsLXB5dGhvbi1O b25lLXRvICdobGluZQogICA6cGFja2FnZS12ZXJzaW9uICcoT3JnIC4gIjguMCIpCiAgIDp0eXBl ICdzeW1ib2wpCiAKKyhkZWZ1biBvcmctYmFiZWwtZWRpdC1wcmVwOnB5dGhvbiAoaW5mbykKKyAg IlNldCBQeXRob24gc2hlbGwgaW4gT3JnIGVkaXQgYnVmZmVyIGFjY29yZGluZyB0byBJTkZPLiIK KyAgKGxldCAoKHNlc3Npb24gKGNkciAoYXNzcSA6c2Vzc2lvbiAobnRoIDIgaW5mbykpKSkpCisg ICAgKHdoZW4gKGFuZCBzZXNzaW9uIChub3QgKHN0cmluZz0gc2Vzc2lvbiAibm9uZSIpKSkKKyAg ICAgIChzZXRxLWxvY2FsIHB5dGhvbi1zaGVsbC1idWZmZXItbmFtZQorICAgICAgICAgICAgICAg ICAgKG9yZy1iYWJlbC1weXRob24td2l0aG91dC1lYXJtdWZmcyBzZXNzaW9uKSkpKSkKKwogKGRl ZnVuIG9yZy1iYWJlbC1leGVjdXRlOnB5dGhvbiAoYm9keSBwYXJhbXMpCiAgICJFeGVjdXRlIFB5 dGhvbiBCT0RZIGFjY29yZGluZyB0byBQQVJBTVMuCiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBi eSBgb3JnLWJhYmVsLWV4ZWN1dGUtc3JjLWJsb2NrJy4iCi0tIAoyLjI1LjEKCg== --000000000000c04c75060bc09014 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Remove-org-src-babel-configure-edit-buffer-and-relat.patch" Content-Disposition: attachment; filename="0001-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