]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid Groff hanging on MS-Windows when invoked by "M-x man"
authorEli Zaretskii <eliz@gnu.org>
Thu, 8 Aug 2019 13:17:51 +0000 (16:17 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 8 Aug 2019 13:17:51 +0000 (16:17 +0300)
* lisp/man.el (Man-build-man-command): On MS-Windows, redirect
stdin of 'man' to the null device, to make sure Groff exits
immediately after formatting the man page.

lisp/man.el

index 409fadb66b8cde439b0c99dcef8e6e6c1141bd8b..731d480cbeec572551a71d978d09240768a7ccc2 100644 (file)
@@ -624,7 +624,13 @@ This is necessary if one wants to dump man.el with Emacs."
                           ;; so we don't need `2>' even with DOS shells
                           ;; which do support stderr redirection.
                           ((not (fboundp 'make-process)) " %s")
-                          ((concat " %s 2>" null-device)))))
+                          ((concat " %s 2>" null-device
+                                   ;; Some MS-Windows ports of Groff
+                                   ;; try to read stdin after exhausting
+                                   ;; the command-line arguments; make
+                                   ;; them exit if/when they do.
+                                   (if (eq system-type 'windows-nt)
+                                       (concat " <" null-device)))))))
        (flist Man-filter-list))
     (while (and flist (car flist))
       (let ((pcom (car (car flist)))