From: Olav Fosse <post@olavfosse.no>
To: 63600@debbugs.gnu.org
Subject: bug#63600: Prevent python-inferior-mode from using $PAGER
Date: Fri, 19 May 2023 22:29:37 +0200 [thread overview]
Message-ID: <A793DA6E-32BF-4ABB-9064-E1CC9C68F32A@olavfosse.no> (raw)
[-- Attachment #1: Type: text/plain, Size: 187 bytes --]
This patch prevents python-inferior-mode from using $PAGER.
$PAGER is typically set to an interactive program, such as
less(1) which causes problems when ran inside of a comint
buffer.
[-- Attachment #2: 0001-Prevent-python-inferior-mode-from-using-PAGER.patch --]
[-- Type: application/octet-stream, Size: 1280 bytes --]
From d58c04d661ca415da41bc09c52bbce2bdae93cc1 Mon Sep 17 00:00:00 2001
From: Olav Fosse <post@olavfosse.no>
Date: Fri, 19 May 2023 20:33:28 +0200
Subject: [PATCH] Prevent python-inferior-mode from using $PAGER
---
lisp/progmodes/python.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 4f57eda3cfc..9304479094e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2563,8 +2563,15 @@ python-shell-internal-buffer-name
:type 'string
:safe 'stringp)
-(defcustom python-shell-interpreter-args "-i"
- "Default arguments for the Python interpreter."
+(defcustom python-shell-interpreter-args "-i -c \"import pydoc;pydoc.pager = pydoc.plainpager;del pydoc\""
+ "Default arguments for the Python interpreter.
+
+-c \"import pydoc;pydoc.pager = pydoc.plainpager;del pydoc\"
+makes it so that Python will print large messages directly to the
+buffer, as opposed to using $PAGER. This is useful because $PAGER
+is typically set to an interative program, such as less(1), which
+will not work properly when ran inside `inferior-python-mode'.
+"
:type 'string)
(defcustom python-shell-interpreter-interactive-arg "-i"
--
2.39.2
next reply other threads:[~2023-05-19 20:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-19 20:29 Olav Fosse [this message]
2023-05-20 11:00 ` bug#63600: Olav Fosse
2023-05-26 11:25 ` bug#63600: Eli Zaretskii
2023-05-31 13:19 ` bug#63600: Eli Zaretskii
2023-05-31 14:31 ` bug#63600: 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=A793DA6E-32BF-4ABB-9064-E1CC9C68F32A@olavfosse.no \
--to=post@olavfosse.no \
--cc=63600@debbugs.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.
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).