From: Anders Munch <ajm@flonidan.dk>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Cc: "edgar@openmail.cc" <edgar@openmail.cc>
Subject: Re: How to use a new buffer as Python shell?
Date: Fri, 19 Aug 2022 09:48:20 +0000 [thread overview]
Message-ID: <HE1PR0502MB300470737B86C9FD22C0C563B46C9@HE1PR0502MB3004.eurprd05.prod.outlook.com> (raw)
edgar@openmail.cc wrote:
> What I would like is to have something like C-u C-c C-z or M-x run-new-python (bogus function name) and get a prompt with the name of the new buffer, where another interpreter is running, and which I can use to send lines of code from the buffer with python-mode (the one from which the command run-new-python was issued).
You are using python.el. You may have more luck with python-mode.el.
C-u M-x py-shell RET
starts a new dedicated interpreter subshell. I'm not sure exactly what that means, but it looks like it does much of what you want. You use C-u once, and on subsequent subshell actions python-mode knows to use the same one from the same .py buffer.
One caveat, it looks like you can't rename the buffer to something with the name of the originating buffer, because then you break the connection between the .py buffer and the subshell.
Some lisp hacking may be required to teach python-mode to prompt for a better subshell buffer name.
regards, Anders
next reply other threads:[~2022-08-19 9:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 9:48 Anders Munch [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-19 20:12 How to use a new buffer as Python shell? edgar
2022-08-18 15:40 edgar
2022-08-18 15:55 ` Emanuel Berg
2022-08-20 8:38 ` James Thomas
2022-08-20 13:50 ` edgar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=HE1PR0502MB300470737B86C9FD22C0C563B46C9@HE1PR0502MB3004.eurprd05.prod.outlook.com \
--to=ajm@flonidan.dk \
--cc=edgar@openmail.cc \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).