From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71440: Re: bug#71440: Python Inferior Mode =?UTF-8?Q?Can=E2=80=99t?= Recognize My Prompt Date: Sun, 09 Jun 2024 13:25:43 +0300 Message-ID: <8634pmbefs.fsf@gnu.org> References: <86sexnbckv.fsf@gnu.org> <86r0d7bawc.fsf@gnu.org> <86ikyjb7ky.fsf@gnu.org> <86h6e2buul.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37427"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71440@debbugs.gnu.org To: "shynur ." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 09 12:26:54 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sGFlG-0009Xn-Bl for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Jun 2024 12:26:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGFl9-00043I-9x; Sun, 09 Jun 2024 06:26:47 -0400 Original-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 1sGFl8-00042r-C6 for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 06:26:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGFl8-00074s-42 for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 06:26:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sGFlO-0007gk-Cg for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 06:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Jun 2024 10:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71440 X-GNU-PR-Package: emacs Original-Received: via spool by 71440-submit@debbugs.gnu.org id=B71440.171792877329359 (code B ref 71440); Sun, 09 Jun 2024 10:27:02 +0000 Original-Received: (at 71440) by debbugs.gnu.org; 9 Jun 2024 10:26:13 +0000 Original-Received: from localhost ([127.0.0.1]:57826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGFka-0007dO-KS for submit@debbugs.gnu.org; Sun, 09 Jun 2024 06:26:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGFkY-0007cv-I9 for 71440@debbugs.gnu.org; Sun, 09 Jun 2024 06:26:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGFkB-00070Q-VU; Sun, 09 Jun 2024 06:25:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=dfQwyzf611CVqYkSLPX2JnKSywwsJ2E7rrxu79BjsDA=; b=Qx5eDb+5XlRYI/pHzn2E 6R4m/Mr7Qa7lIflftfBjY6m8/S/L9YQmy7tNle1EmQe3bdE5CVxEtvW4fF0GPHpFTR3zDhbeY8fse 4iCySgidsEM8IVgTPaQMrAfmmZcNbVXe7mDmVTed3q6ALX/ylpg1QBRm5BnmBZV6yxyTroXI6smYH //y92Zh9DrrJFcWMs8KrwlRQz6Tr/6gOo048BRtKl+AeWqHDLfMlTiJdEt9O2ETdYySPG0Iw02oKC 1byK3sWqOSghGINRPx0h46t/805odvHWJV7nhcPqVQZdMFhASZbF9V0bkyGm4hkEnzb+xaCE4+o2i 5p+6yENyxygtgg==; In-Reply-To: (one.last.kiss@outlook.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286925 Archived-At: > From: "shynur ." > 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: > . 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.