unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nika Otiashvili <nikaoto@gmail.com>
To: 45357@debbugs.gnu.org
Subject: bug#45357: [PATCH] * lisp/man.el (Man-getpage-in-background): always use shell-file-name
Date: Mon, 21 Dec 2020 23:24:13 +0400	[thread overview]
Message-ID: <CAHJNDzd7xqaeiFktD1E_Dsp61cwrdz402qoJw9-pNKBKqu0xJQ@mail.gmail.com> (raw)

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

Hello,
First time sending a patch to bug-gnu-emacs, not sure if this is the
correct format.
Please indicate any errors I made in my formatting of the email or the
attached patch file.

Regards,
Nika Otiashvili

[-- Attachment #2: 0001-lisp-man.el-Man-getpage-in-background-always-use-she.patch --]
[-- Type: text/x-patch, Size: 1885 bytes --]

From e27cc04bc2a1ca10d5e89ad585fc59eb0d462b8d Mon Sep 17 00:00:00 2001
From: Nika Otiashvili <nikaoto@gmail.com>
Date: Mon, 21 Dec 2020 23:14:28 +0400
Subject: [PATCH] * lisp/man.el (Man-getpage-in-background): always use
 shell-file-name

Copyright-paperwork-exempt: yes
; Reasons for change:
;
; * M-m man invokes Man-getpage-in-background, which launches
;   shell-file-name only when system-type is cygwin or windows-nt,
;   otherwise it launches /bin/sh. Some users may not have /bin/sh.
;
; * /bin/sh, when launched this way, runs through the user's
;   runtime configurations (.bashrc, .zshrc ...), however it does
;   not launch subshells even if there are appropriate shebangs at
;   the top of the rc files. Neither "#! /bin/bash", nor
;   "#! /usr/bin/env bash" launches bash. This causes the process
;   to crash if the rc files are incompatible with the user's
;   /bin/sh and instead of the rendered man page, it gives an error
;   message in the new buffer.
;
; * It is reasonable for the user to expect that any function that
;   launches a subshell under emacs should respect the
;   shell-file-name variable that they have configured.
---
 lisp/man.el | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lisp/man.el b/lisp/man.el
index c914ec34b97..c257536aeca 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1123,11 +1123,7 @@ Man-getpage-in-background
 	(Man-start-calling
 	 (if (fboundp 'make-process)
 	     (let ((proc (start-process
-			  manual-program buffer
-			  (if (memq system-type '(cygwin windows-nt))
-			      shell-file-name
-			    "sh")
-			  shell-command-switch
+                          manual-program buffer shell-file-name shell-command-switch
 			  (format (Man-build-man-command) man-args))))
 	       (set-process-sentinel proc 'Man-bgproc-sentinel)
 	       (set-process-filter proc 'Man-bgproc-filter))
-- 
2.20.1


             reply	other threads:[~2020-12-21 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 19:24 Nika Otiashvili [this message]
2020-12-22 15:14 ` bug#45357: [PATCH] * lisp/man.el (Man-getpage-in-background): always use shell-file-name Eli Zaretskii
2020-12-22 18:50   ` Michael Albinus
2020-12-23  0:55     ` Nika Otiashvili
2020-12-23  8:17       ` Michael Albinus

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=CAHJNDzd7xqaeiFktD1E_Dsp61cwrdz402qoJw9-pNKBKqu0xJQ@mail.gmail.com \
    --to=nikaoto@gmail.com \
    --cc=45357@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).