all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: 72426@debbugs.gnu.org
Subject: bug#72426: 29.2.50; comint-pager doesn't affect async-shell-command
Date: Fri, 02 Aug 2024 14:39:41 -0400	[thread overview]
Message-ID: <ierh6c2rcpe.fsf@janestreet.com> (raw)
In-Reply-To: <ierjzgyrcwi.fsf@janestreet.com> (Spencer Baugh's message of "Fri, 02 Aug 2024 14:35:25 -0400")

[-- Attachment #1: Type: text/plain, Size: 21 bytes --]


Patch fixing this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Respect-comint-pager-in-async-shell-command.patch --]
[-- Type: text/x-patch, Size: 2617 bytes --]

From 2af83cd922b34e1cde4ab4973e07fdb283acd26a Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@janestreet.com>
Date: Fri, 2 Aug 2024 14:39:08 -0400
Subject: [PATCH] Respect comint-pager in async-shell-command

comint-pager now also affects async-shell-command.

As a side benefit, this also allows it to be configured with
connection-local variables.

* lisp/comint.el (comint-exec-1): Remove check on comint-pager.
(comint-term-environment): Add check on comint-pager. (bug#72426)
---
 lisp/comint.el | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index c7cd22d840a..4f28ddc3165 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -893,10 +893,6 @@ comint-exec-1
 	 (nconc
           (comint-term-environment)
 	  (list (format "INSIDE_EMACS=%s,comint" emacs-version))
-          (when comint-pager
-            (if (stringp comint-pager)
-                (list (format "PAGER=%s" comint-pager))
-              (error "comint-pager should be a string: %s" comint-pager)))
 	  process-environment))
 	(default-directory
 	  (if (file-accessible-directory-p default-directory)
@@ -925,7 +921,9 @@ comint-exec-1
     proc))
 
 (defun comint-term-environment ()
-  "Return an environment variable list for terminal configuration."
+  "Return an environment variable list for terminal configuration.
+
+Includes a value for PAGER based on `comint-pager'."
   ;; If using termcap, we specify `emacs' as the terminal type
   ;; because that lets us specify a width.
   ;; If using terminfo, we default to `dumb' because that is
@@ -934,12 +932,17 @@ comint-term-environment
   ;; Some programs that use terminfo get very confused
   ;; if TERM is not a valid terminal type.
   (with-connection-local-variables
-   (if system-uses-terminfo
-       (list (format "TERM=%s" comint-terminfo-terminal)
-             "TERMCAP="
-             (format "COLUMNS=%d" (window-width)))
-     (list "TERM=emacs"
-           (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))))
+   (nconc
+    (when comint-pager
+      (if (stringp comint-pager)
+          (list (format "PAGER=%s" comint-pager))
+        (error "comint-pager should be a string: %s" comint-pager)))
+    (if system-uses-terminfo
+        (list (format "TERM=%s" comint-terminfo-terminal)
+              "TERMCAP="
+              (format "COLUMNS=%d" (window-width)))
+      (list "TERM=emacs"
+            (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width)))))))
 
 (defun comint-nonblank-p (str)
   "Return non-nil if STR contains non-whitespace syntax."
-- 
2.39.3


  reply	other threads:[~2024-08-02 18:39 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 18:35 bug#72426: 29.2.50; comint-pager doesn't affect async-shell-command Spencer Baugh
2024-08-02 18:39 ` Spencer Baugh [this message]
2024-08-03  5:48 ` Eli Zaretskii
2024-08-03 10:47   ` Spencer Baugh
2024-08-03 15:38     ` Eli Zaretskii
2024-08-03 16:42       ` Spencer Baugh
2024-08-03 17:18         ` Eli Zaretskii
2024-08-06 15:33           ` Spencer Baugh
2024-08-06 15:46             ` Eli Zaretskii
2024-08-06 16:29               ` Jim Porter
2024-08-06 18:02                 ` Eli Zaretskii
2024-08-03 18:38       ` Jim Porter
2024-08-06 15:31         ` Spencer Baugh
2024-08-06 15:50           ` Eli Zaretskii
2024-08-06 16:42             ` Spencer Baugh
2024-08-06 18:07               ` Eli Zaretskii
2024-08-06 18:49                 ` Spencer Baugh
2024-08-06 19:07                   ` Eli Zaretskii
2024-08-06 19:23                     ` Spencer Baugh
2024-08-07  2:36                       ` Jim Porter
2024-08-07 11:51                         ` Eli Zaretskii
2024-08-07 15:05                           ` Spencer Baugh
2024-08-07 15:26                             ` Eli Zaretskii
2024-08-07 15:31                               ` Spencer Baugh
2024-08-07 16:08                                 ` Jim Porter
2024-08-07 11:18                       ` Eli Zaretskii
2024-08-07 15:09                         ` Spencer Baugh
2024-08-17  9:25                       ` Eli Zaretskii
2024-09-13  1:17       ` Dmitry Gutov
2024-09-13  6:08         ` Eli Zaretskii
2024-09-13 23:45           ` Dmitry Gutov
2024-09-14  6:27             ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ierh6c2rcpe.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=72426@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 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.