From: Stefan Kangas Date: Thu, 2 Jan 2025 19:19:24 +0000 (+0100) Subject: Respect 'manual-program' variable X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e968b956d6dbc06e27cd03343a7bbf9ec96b94da;p=emacs.git Respect 'manual-program' variable * lisp/man.el (Man-man-k-flags): Respect 'manual-program' variable. (cherry picked from commit ca79916179ffb5ddc801e1ccb12c5ff72f6516d8) --- diff --git a/lisp/man.el b/lisp/man.el index a73159d40ce..da702e79815 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -977,14 +977,15 @@ foo(sec)[, bar(sec) [, ...]] [other stuff] - description" ;; seems like the safest choice, but `man -k apropos' seems almost as safe ;; and usually returns a much shorter output. (with-temp-buffer - (with-demoted-errors "%S" (call-process "man" nil t nil "-k" "apropos")) + (with-demoted-errors "%S" + (call-process manual-program nil t nil "-k" "apropos")) (let ((lines (count-lines (point-min) (point-max))) (completions (Man-parse-man-k))) (if (>= (length completions) lines) '("-k") ;; "-k" seems to return sane results: look no further! (erase-buffer) ;; Try "-k -l" (bug#73656). - (with-demoted-errors "%S" (call-process "man" nil t nil + (with-demoted-errors "%S" (call-process manual-program nil t nil "-k" "-l" "apropos")) (let ((lines (count-lines (point-min) (point-max))) (completions (Man-parse-man-k)))