From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id qNCuFDbHnGUbFwEAkFu2QA (envelope-from ) for ; Tue, 09 Jan 2024 05:10:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 4EeTDTbHnGXSqAAA62LTzQ (envelope-from ) for ; Tue, 09 Jan 2024 05:10:30 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=dfFr5LJK; 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=1704773430; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Qq+vhdC1O3e3Z7mmXKDjTME1cbdfnF/b0Vhop51e7bs=; b=WraVcZQSBEXVG6mbAiE77vqBipui1RpINsxmaasmbLOkIRhN7Ej1ZacIkEes2jKcHr5+WJ H/iUZT2B7FiBzgZQpLLJFWzR9HZk4ExA9RrUGNDBR8THrZeIvD15Yyx6vahgvjvB6Mlo+H eZQ2mOOIBCxsGkS+YBCECGF5wtaVYM3oYzF4+pr4mIgur1vBV0VJXqtIobMvGMNnQ/Juua /+rDZHFVSVHqqWCIFc123ZGspSYgg8dbYefx1yTRftldlgglLdnMtHMXVHm6SmCyQHuHAC R7C9j0uvAY6SLtR1bbSHVW4tLJ5otB1iMYQK+Qnku/dAfkloeunMqNw9TJXy2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=dfFr5LJK; 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=1704773430; a=rsa-sha256; cv=none; b=QTk5jU7owcPWv6cQRsPXHJ40f1vgxdLgAZFy02APVI5EDCCBRrhhYHrXAQpP5XRGt3mrOs RZx3BvAZ9Gr/9QDJGRwPLh7G5qdpXNZGJttUmjbpILGanOcLhow/NR4UQ4nnSEavEsXjhR rhoC3oCh1FT2t6vrG1XKvg/+nJwWfrsU7W9qcJPLTKAc5ciZaroBLC4jQvzaqgUjFOO/YJ YwBjRJG8XTEJGO9LCsDGEXk09/m8/ssENgxM70gixLlftyZn9I+zE+qdWtz1+uvvy/Qwvw XfQRbHEJIv0/waTQ09bMRL6pCz7u6v+mS2LYLPFrtIlCn9JB3OWeo3PgON4jDw== 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 E1BEF3AA4B for ; Tue, 9 Jan 2024 05:10:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rN3QY-0000nT-V1; Mon, 08 Jan 2024 23:09:22 -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 1rN3QX-0000n5-5J for emacs-orgmode@gnu.org; Mon, 08 Jan 2024 23:09:21 -0500 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rN3QV-0008Tp-8m for emacs-orgmode@gnu.org; Mon, 08 Jan 2024 23:09:20 -0500 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6dde00d8760so384875a34.2 for ; Mon, 08 Jan 2024 20:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704773357; x=1705378157; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Qq+vhdC1O3e3Z7mmXKDjTME1cbdfnF/b0Vhop51e7bs=; b=dfFr5LJKtz/sDgG6nRhYmBlLqSfXAIFj4M7cVoGv0jP29yu+owGuPlZ3HTtOAe8waH HmYP8EUMUyPfcFkW7Jzx8GTKbMkCoa5hd9fJB3cvFyGSOqwS2XecrPjdl33GQEpxMJ3A 9xWyB1dsjBOmS/Ql5g8NWWenmRdOPW3ogCXYzFAv/4yFYiurvdvZSrl7ZUN3zJSorZ+R 5vsHR7MtycfH10BhD4JkG8WUidfxCzfCQ7HEWKzYIyrSqp7QGf1Rig3ROSbB6T65TKlS fewuBC+qcY0L7XBpHBoRLz1mko137lavpaP4U/6yqjBLhCB5BOf/BhHSmKi97EXSp8u+ Dd0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704773357; x=1705378157; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qq+vhdC1O3e3Z7mmXKDjTME1cbdfnF/b0Vhop51e7bs=; b=O+50AGiztVdHi8IKK56n8bUnoKCdh+g60UxJ+C0sTrSPPfwd7Ta9TD/1aYrEGdiSiM 6NVaY1Mcm5AMLichtwWVxRntsKmDSu3FAQwHtY7p8KYJmKvWWwC7MDkP4vq7zBxZQlki X9ST9GpIZQALWCpAtJ88kJkiKD0ju5NvukJ6jEENks5wN+j5OkreRJMYjcDCh8aVBhGR i5BkDwsjGp4j1PBeNZ43FrESBAEf2JOV0jdos0T4OXLpkfkiNmHnqBZb9c7zQ/qAdjhs wndInanRMKT7R1m21623UfPgiikdtkXWEzmzi2QFdaP8VVX76y1hLgUYwS9pion/XXZy 8f5g== X-Gm-Message-State: AOJu0YwQSC2yqDA1+kY2MSPokz3pg9+SW08wM+TIuPgYrQr+o5aIr3Lg md3O29GpvqexJdEw3umqHuQLYY02qTo= X-Google-Smtp-Source: AGHT+IHyKeeKQB/JolHNwABQKcx3RhVS8lwODuIMaiO8sxuxGfpuvfPE45K2qS7qIwyld+6u8uxxFQ== X-Received: by 2002:a05:6358:2c93:b0:175:9a9c:5725 with SMTP id l19-20020a0563582c9300b001759a9c5725mr1559486rwm.55.1704773357184; Mon, 08 Jan 2024 20:09:17 -0800 (PST) Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id sr13-20020a17090b4e8d00b0028d804ef772sm1628136pjb.25.2024.01.08.20.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 20:09:16 -0800 (PST) From: Jack Kamm To: Ihor Radchenko Cc: Liu Hui , emacs-orgmode@gnu.org Subject: Re: [PATCH] Set Python shell in Org edit buffer In-Reply-To: <87zfxgxb8m.fsf@localhost> References: <87zfyosw8n.fsf@localhost> <87ttovlb1u.fsf@localhost> <878r6647vv.fsf@localhost> <87bkb2rqer.fsf@localhost> <87edfwsuvx.fsf@localhost> <87sf4bsm1w.fsf@localhost> <87mstw18r4.fsf@gmail.com> <87bkaak0ol.fsf@localhost> <87ttnyz0jv.fsf@gmail.com> <87wmsn6ghw.fsf@localhost> <87o7dxu15h.fsf@gmail.com> <87msthwbfz.fsf@localhost> <87le91t13e.fsf@gmail.com> <87zfxgxb8m.fsf@localhost> Date: Mon, 08 Jan 2024 20:09:15 -0800 Message-ID: <87r0ir2ln8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::329; envelope-from=jackkamm@gmail.com; helo=mail-ot1-x329.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, 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.56 X-Spam-Score: -4.56 X-Migadu-Queue-Id: E1BEF3AA4B X-TUID: 1+qK8AZIMf4U Ihor Radchenko writes: > Note that I proposed to remove auto-starting session completely, which > is in odds to what you propose below. Sure, I'm fine with that -- it seems like a reasonable change. > IMHO, it might be enough to adjust org-babel-R-associate-session as the > following > > (defun org-babel-R-associate-session (session) > "Associate R code buffer with an R session. > Make SESSION be the inferior ESS process associated with the > current code buffer." > (setq ess-local-process-name > (process-name (get-buffer-process session))) > (when ess-local-process-name (ess-make-buffer-current)) > (setq-local ess-gen-proc-buffer-name-function (lambda (_) session))) I think you need to check that (get-buffer-process session) is non-nil before calling process-name, otherwise you'll get (wrong-type-argument processp nil). Also it seems unnecessary to call `ess-make-buffer-current', as it's already called by `ess-force-buffer-current' (which is called by `ess-eval-region'). Though it doesn't hurt to call it, either. Otherwise, this looks good to me.