all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#63600: Prevent python-inferior-mode from using $PAGER
@ 2023-05-19 20:29 Olav Fosse
  2023-05-20 11:00 ` bug#63600: Olav Fosse
  0 siblings, 1 reply; 5+ messages in thread
From: Olav Fosse @ 2023-05-19 20:29 UTC (permalink / raw)
  To: 63600

[-- 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-31 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-19 20:29 bug#63600: Prevent python-inferior-mode from using $PAGER Olav Fosse
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.