unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "shynur ." <one.last.kiss@outlook.com>
Cc: 71440@debbugs.gnu.org
Subject: bug#71440: Re: bug#71440: Python Inferior Mode Can’t Recognize My Prompt
Date: Sun, 09 Jun 2024 13:25:43 +0300	[thread overview]
Message-ID: <8634pmbefs.fsf@gnu.org> (raw)
In-Reply-To: <PH0PR11MB747012F7EFCF189E4D7FECFED7C52@PH0PR11MB7470.namprd11.prod.outlook.com> (one.last.kiss@outlook.com)

> From: "shynur ." <one.last.kiss@outlook.com>
> CC: "71440@debbugs.gnu.org" <71440@debbugs.gnu.org>
> Date: Sun, 9 Jun 2024 10:11:29 +0000
> msip_labels:
> 
> The problem occurs when I call ‘python-shell-send-buffer’
> from a Python buffer, as mentioned in my original post:
> <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71440#5>.

I know almost nothing about Python, but I wonder how PS1 and PS2 are
at all relevant when using python-shell-send-buffer?  That function
sends the buffer text to Python, so where do PS1 and PS2 come into
play, and why does Python say "__PYTHON_EL_eval is not defined" just
because you have PS1 and PS2 customized?

If someone helps me understand that, maybe I will have further ideas.

> > I suggest to define PS1 and PS2 specially for the inferior Python.
> 
> I have to say that this is hard to implement cleanly.
> 
> I’ve tried:
> 
>     (setopt python-shell-interpreter-args "-i -c sys.ps1,sys.ps2='►▻'")
> 
> but it turned out that the ‘PYTHONSTARTUP’ file is loaded 
> after the statement following ‘-c’ is executed.

How about defining PYTHONSTARTUP to point to a different file?

> I think this can be a feature request: provide an option 
> to ignore any setting-color character sequence (eg `\033[32m`)
> in XXYYZZ Inferior Mode, because there’re so many REPL
> apps using a colored prompt and Emacs may not handle them
> properly.

I'm not sure I even understand how the color settings are relevant to
python-shell-send-buffer.





  reply	other threads:[~2024-06-09 10:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-08 16:29 bug#71440: Python Inferior Mode Can’t Recognize My Prompt shynur .
2024-06-08 16:53 ` Eli Zaretskii
2024-06-08 17:06   ` shynur .
2024-06-08 17:29     ` bug#71440: " Eli Zaretskii
2024-06-08 17:46       ` shynur .
2024-06-08 18:41         ` bug#71440: " Eli Zaretskii
2024-06-08 19:50           ` shynur .
2024-06-09  4:31             ` bug#71440: " Eli Zaretskii
2024-06-09 10:11               ` shynur .
2024-06-09 10:25                 ` Eli Zaretskii [this message]
2024-06-09 10:49                   ` shynur .
2024-06-09 11:02                     ` bug#71440: " Eli Zaretskii
2024-06-09 15:26                       ` kobarity
2024-06-09 15:40                         ` bug#71440: Python Inferior Mode Canʼt " shynur .
2024-06-11 16:24                         ` bug#71440: Python Inferior Mode Can’t " kobarity
2024-06-12  8:12                           ` Eli Zaretskii
2024-06-12 13:09                             ` kobarity
2024-06-12 16:57                           ` shynur .
2024-06-13 14:24                             ` kobarity
2024-06-15 10:45                               ` Eli Zaretskii

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=8634pmbefs.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71440@debbugs.gnu.org \
    --cc=one.last.kiss@outlook.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).