From andreas.roehler at easy-emacs.de Thu Feb 20 11:26:04 2020 From: andreas.roehler at easy-emacs.de (=?UTF-8?Q?Andreas_R=c3=b6hler?=) Date: Thu, 20 Feb 2020 17:26:04 +0100 Subject: [Python-mode] [PATCH] Fix ob-python.el initiate session error with py-shell In-Reply-To: <87d0a995hp.fsf@gmail.com> References: <877e0kjbqq.fsf@gmail.com> <874kvnako5.fsf@gmail.com> <871rqrak5y.fsf@gmail.com> <87wo8ik22r.fsf@gmail.com> <87d0a995hp.fsf@gmail.com> Message-ID: <20aad61e-48e0-ba01-9255-793eacfdbc7e@easy-emacs.de> , On 20.02.20 06:45, stardiviner wrote: Hi, python-mode.el developer here. >> Since python.el is built-in to Emacs, I think that things should >> continue to work for python-mode.el users, even if we entirely switch >> over to only using python.el. Thanks supporting python-mode.el. Both python-modes should not conflict - except for the key-setting, which is taken by the last one loaded: py-mode-map didn't work for some reasons, so both provide now python-mode-map. >> >> The only thing I'm not sure about, is whether the equivalent of >> "python-shell-send-region" in python-mode.el will work with shells >> started by python.el. If not, this could probably be addressed with a >> patch to python-mode.el. It should work. Will check it. Please feel free to send a bug-report resp. feature request to https://gitlab.com/python-mode-devs/python-mode/issues in case of python-mode.el related stuff. >> You could test this by explicitly setting `org-babel-python-mode' to >> `python' (it is probably set to `python-mode' on your system, which is >> the default when python-mode.el is detected). >> >> I'll add a TODO for myself to explicitly mark python-mode-related >> variables as deprecated. I'm also planning a major update to the Worg >> documentation of ob-python when 9.4 comes out, and will mention the >> deprecation there as well. > Thanks for your work! Jack > > - -- > [ stardiviner ] BTW there are some reasons, why python-mode.el still exists: no known indentation bugs, finer navigation commands etc. Maybe have a look at open python.el bugs and check them against python-mode.el Best, Andreas From bzg at gnu.org Thu Feb 20 12:46:28 2020 From: bzg at gnu.org (Bastien) Date: Thu, 20 Feb 2020 18:46:28 +0100 Subject: [Python-mode] [PATCH] Fix ob-python.el initiate session error with py-shell References: <877e0kjbqq.fsf@gmail.com> <874kvnako5.fsf@gmail.com> <871rqrak5y.fsf@gmail.com> <87wo8ik22r.fsf@gmail.com> <87d0a995hp.fsf@gmail.com> <20aad61e-48e0-ba01-9255-793eacfdbc7e@easy-emacs.de> Message-ID: <87d0a95eyz.fsf@bzg.fr> Hi all, in future releases of Org, we will move toward stricter rules on what to accept as ob-* libraries and what modes these libraries should rely upon. This was briefly mentioned in this email: https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00714.html For example, we can have a rule that we don't include ob-* libraries for languages that are not somehow known by Emacs. It would mean that e.g. ob-clojure.el would have to live outside Org's core. Also, for included ob-*, the idea would be to use the mode that are bundled with Emacs core. For Python, it would mean that ob-python.el should support python.el, not python-mode.el. This is not to say that python.el is better than python-mode.el: I have no opinion on this and I'm confident both meet different users. But that's something to consider. We can always have another ob-python-mode.el file for users who use python-mode.el: even the names would make it clear that Org babel uses one mode and not the other. I suggest we have the discussion on such rules after Org 9.4, but in the meantime, this is something you may consider when fixing hacking on ob-python.el. Best, -- Bastien From jackkamm at gmail.com Thu Feb 20 13:51:23 2020 From: jackkamm at gmail.com (Jack Kamm) Date: Thu, 20 Feb 2020 10:51:23 -0800 Subject: [Python-mode] [PATCH] Fix ob-python.el initiate session error with py-shell In-Reply-To: <87d0a95eyz.fsf@bzg.fr> References: <877e0kjbqq.fsf@gmail.com> <874kvnako5.fsf@gmail.com> <871rqrak5y.fsf@gmail.com> <87wo8ik22r.fsf@gmail.com> <87d0a995hp.fsf@gmail.com> <20aad61e-48e0-ba01-9255-793eacfdbc7e@easy-emacs.de> <87d0a95eyz.fsf@bzg.fr> Message-ID: <87k14hjdn8.fsf@gmail.com> Hi, Bastien writes: > Also, for included ob-*, the idea would be to use the mode that are > bundled with Emacs core. For Python, it would mean that ob-python.el > should support python.el, not python-mode.el. I agree that ob-python.el should only rely on functionality from python.el, and shouldn't need to know about other packages. This will reduce the maintenance burden for ourselves. At the same time, I would like the user to use whatever Python-related modes they like when editing the org Python source buffer, such as python-mode.el, elpy, etc., without issue. That doesn't mean that we'll put workarounds and references to external packages in ob-python.el, but rather that we'd keep ob-python simple and easy for external packages to interop with. I think this is more or less the case today, and we're on the same page here. Just wanted to make this goal explicit. From bzg at gnu.org Thu Feb 20 14:08:55 2020 From: bzg at gnu.org (Bastien) Date: Thu, 20 Feb 2020 20:08:55 +0100 Subject: [Python-mode] [PATCH] Fix ob-python.el initiate session error with py-shell In-Reply-To: <87k14hjdn8.fsf@gmail.com> (Jack Kamm's message of "Thu, 20 Feb 2020 10:51:23 -0800") References: <877e0kjbqq.fsf@gmail.com> <874kvnako5.fsf@gmail.com> <871rqrak5y.fsf@gmail.com> <87wo8ik22r.fsf@gmail.com> <87d0a995hp.fsf@gmail.com> <20aad61e-48e0-ba01-9255-793eacfdbc7e@easy-emacs.de> <87d0a95eyz.fsf@bzg.fr> <87k14hjdn8.fsf@gmail.com> Message-ID: <87eeup2i0o.fsf@gnu.org> Hi Jack, Jack Kamm writes: > I think this is more or less the case today, and we're on the same page > here. Just wanted to make this goal explicit. OK, thanks for the precision! -- Bastien