]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new user option Man-prefer-synchronous-call
authorSebastian Tennant <sdt@sebyte.me>
Thu, 10 Mar 2022 08:36:04 +0000 (08:36 +0000)
committerEli Zaretskii <eliz@gnu.org>
Thu, 2 Mar 2023 11:23:18 +0000 (13:23 +0200)
* lisp/man.el (Man-getpage-in-background): Add new defcustom
Man-prefer-synchronous-call and modify #'Man-getpage-in-background.
Only call #'start-process when 'make-process satisfies #'fboundp AND
Man-prefer-synchronous-call is bound to nil.  (Bug#61552)

Copyright-paperwork-exempt: yes

doc/emacs/programs.texi
etc/NEWS
lisp/man.el

index d97bd56be21a278a3cf86dc78781911342477e7c..c6c67047c43ae3916004bb0d5d86603defa01e77 100644 (file)
@@ -1387,6 +1387,12 @@ this, change the value of the variable @code{Man-switches} to
 @kbd{M-p} to switch between man pages in different sections.  The mode
 line shows how many manual pages are available.
 
+@vindex Man-prefer-synchronous-call
+  By default, @kbd{M-x man} calls the @code{man} program
+asynchronously.  If you would prefer it if @kbd{M-x man} called the
+@code{man} program synchronously, you may set variable
+@code{Man-prefer-synchronous-calls} to a non-@code{nil} value.
+
 @findex woman
 @cindex manual pages, on MS-DOS/MS-Windows
   An alternative way of reading manual pages is the @kbd{M-x woman}
index 31fb22fc1e27ba92abd2e46ccd6746a83b1b6858..744eab415589f9876c36fc91bcf33754480570c5 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -201,6 +201,13 @@ This command adds a docstring comment to the current defun.  If a
 comment already exists, point is only moved to the comment.  It is
 bound to 'C-c C-d' in 'go-ts-mode'.
 
+** Man-mode
+
++++
+*** New user option 'Man-prefer-synchronous-call'.
+When this is non-nil, call the 'man' program synchronously rather than
+asynchronously, which is the default behaviour.
+
 \f
 * New Modes and Packages in Emacs 30.1
 
index 9f75c07c79137b2aecb6c3b0f67a8ec680489c6f..5e5c10aac36c27ed60e43b85a6bd7f6790f15bf6 100644 (file)
   :group 'external
   :group 'help)
 
+(defcustom Man-prefer-synchronous-call nil
+  "Whether to call the Un*x 'man' program synchronously.
+When this is non-nil, call the 'man' program synchronously
+(rather than asynchronously, which is the default behaviour)."
+  :type 'boolean
+  :group 'man
+  :version 30.1)
+
 (defcustom Man-filter-list nil
   "Manpage cleaning filter command phrases.
 This variable contains a list of the following form:
@@ -1118,7 +1126,8 @@ Return the buffer in which the manpage will appear."
                                        "[cleaning...]")
                                      'face 'mode-line-emphasis)))
        (Man-start-calling
-        (if (fboundp 'make-process)
+        (if (and (fboundp 'make-process)
+                  (not Man-prefer-synchronous-call))
             (let ((proc (start-process
                          manual-program buffer
                          (if (memq system-type '(cygwin windows-nt))