From: Lars Ingebrigtsen <larsi@gnus.org>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: 49822@debbugs.gnu.org
Subject: bug#49822: [RFC PATCH] python-shell-send functions show no output
Date: Sat, 28 Aug 2021 17:41:20 +0200 [thread overview]
Message-ID: <87o89hinkv.fsf@gnus.org> (raw)
In-Reply-To: <87sfytex5b.fsf_-_@gmail.com> (Augusto Stoffel's message of "Sat, 28 Aug 2021 11:28:16 +0200")
Augusto Stoffel <arstoffel@gmail.com> writes:
> The main user-visible change is that now a result is printed in the
> shell in all possible cases, i.e.:
>
> 1. If the string being evaluated is a one-line expression.
> 2. If the string being evaluated is a multiline expression such as
> "(1+\n1)".
> 3. The string being evaluated is contains multiple statements, the last
> of which is an expression. E.g., "x=1\nx".
>
> Currently, only case 1 prints a result (this is the actual topic of this
> bug).
Sounds like a definite improvement. :-)
> This is a reasonably sensitive change and it would be good to collect
> feedback from others before merging it (a properly formatted patch will
> then follow). In particular, since I'm not an expert in Python's
> internals, there might be some possible refinements to the
> __PYTHON_EL_eval function. Is this perhaps a better topic for the
> emacs-devel list?
Yes, it might be a good idea to raise this topic on emacs-devel and see
if there's any feedback.
Some minor comments on the patch:
> +(defvar python-shell-eval-setup-code
> + "\
> +def __PYTHON_EL_eval(source, filename):
> + import ast, sys
> + if sys.version_info[0] == 2:
> + from __builtin__ import compile, eval, globals
I think it might be a better long-term maintenance solution to put the
Python code here (and from `python-shell-completion-native-setup') into
a .py file under etc (for instance in a new "python-mode"
sub-directory), and then read it in run-time (accessed via
`data-directory', which points to etc), and cache it in an internal
variable.
Editing Python that's inside a Lisp string is awkward.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2021-08-28 15:41 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210903122828.16890.65271@vcs0.savannah.gnu.org>
[not found] ` <20210903122829.EAAC220B71@vcs0.savannah.gnu.org>
[not found] ` <jwvv93hl0ux.fsf-monnier+emacs@gnu.org>
2021-09-04 9:49 ` bug#49822: master e32c7d2: Change Python eval to send directly instead of using temporary files Augusto Stoffel
2021-09-04 13:52 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-05 6:13 ` Barton, Mark
2021-09-05 7:41 ` bug#32042: " Lars Ingebrigtsen
2021-09-05 7:41 ` Lars Ingebrigtsen
[not found] ` <44E9472D-65D9-48DA-AF20-C0A82818C5CA@disney.com>
2021-09-05 7:46 ` Augusto Stoffel
2021-09-05 8:10 ` Augusto Stoffel
[not found] ` <87ilzfcuj2.fsf@gmail.com>
2021-09-05 17:18 ` Mark Barton
2021-09-05 17:33 ` Mark Barton
2021-09-05 17:46 ` Augusto Stoffel
2021-09-05 16:36 ` Andreas Schwab
2021-09-05 18:40 ` Augusto Stoffel
2021-09-06 7:43 ` Michael Albinus
[not found] ` <878s0a409g.fsf@gmx.de>
2021-09-06 8:40 ` Andreas Schwab
[not found] ` <87ilzef65i.fsf@igel.home>
2021-09-06 11:23 ` Michael Albinus
[not found] ` <878s0aeyna.fsf@gmx.de>
2021-09-06 11:53 ` Andreas Schwab
2021-08-02 14:32 ` bug#49822: 28.0.50; python-shell-send functions show no output dalanicolai
2021-08-02 15:11 ` bug#49822: forgot link (and mentioned wrong user) dalanicolai
2021-08-02 15:17 ` bug#49822: 28.0.50; python-shell-send functions show no output Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-04 7:18 ` Lars Ingebrigtsen
2021-08-05 10:03 ` dalanicolai
2021-08-12 14:57 ` Augusto Stoffel
2021-08-13 11:10 ` Lars Ingebrigtsen
2021-08-13 16:44 ` Andreas Röhler
2021-08-14 9:29 ` Augusto Stoffel
2021-08-15 6:41 ` Andreas Röhler
2021-08-26 8:27 ` Augusto Stoffel
2021-08-26 14:09 ` Lars Ingebrigtsen
2021-08-28 9:28 ` bug#49822: [RFC PATCH] " Augusto Stoffel
2021-08-28 15:41 ` Lars Ingebrigtsen [this message]
2021-09-03 8:02 ` bug#49822: [PATCH] " Augusto Stoffel
2021-09-03 12:28 ` Lars Ingebrigtsen
2021-09-06 22:15 ` bug#49822: master e32c7d2: Change Python eval to send directly instead of using temporary files Andy Moreton
2021-09-07 7:18 ` Andreas Schwab
2021-09-06 12:00 ` Michael Albinus
2021-09-06 16:08 ` Augusto Stoffel
2021-09-07 17:37 ` Augusto Stoffel
2021-09-07 17:48 ` Eli Zaretskii
[not found] ` <83y288nuoq.fsf@gnu.org>
2021-09-07 17:59 ` Augusto Stoffel
2021-09-07 18:13 ` Augusto Stoffel
[not found] ` <87sfygl11x.fsf@gmail.com>
2021-09-07 18:19 ` Eli Zaretskii
[not found] ` <87o894l0dr.fsf@gmail.com>
2021-09-07 18:31 ` Eli Zaretskii
[not found] ` <83tuiwnspl.fsf@gnu.org>
2021-09-07 19:00 ` Augusto Stoffel
2021-09-07 19:16 ` Eli Zaretskii
[not found] ` <83pmtknqlq.fsf@gnu.org>
2021-09-08 7:02 ` Michael Albinus
2021-09-08 3:17 ` Barton, Mark
2021-09-08 5:09 ` Augusto Stoffel
2021-09-08 7:50 ` Lars Ingebrigtsen
[not found] ` <877dfr5ww1.fsf@gnus.org>
2021-09-08 14:05 ` Augusto Stoffel
[not found] ` <87zgsnp3hk.fsf@gmail.com>
2021-09-09 13:48 ` Lars Ingebrigtsen
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=87o89hinkv.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=49822@debbugs.gnu.org \
--cc=arstoffel@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).