From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Van Ly via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73656: 30.0.91; icomplete-vertical has no matches for M-x man RET chdir Date: Sun, 17 Nov 2024 05:34:35 +0000 Message-ID: References: Reply-To: Van Ly Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35549"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73656@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 17 06:35:15 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tCXwI-00095y-VC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Nov 2024 06:35:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCXw9-0006Bn-C1; Sun, 17 Nov 2024 00:35:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCXw6-0006Be-ST for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 00:35:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tCXw6-0006pI-Gj for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 00:35:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:In-Reply-To:From:To:References:Subject; bh=lunz4hCWUDIBIBQxLoo3YjJSdGpboikwghIf3JI5zJs=; b=g1w+3C+YVOFZtJ0KtHb6ntlFkWV/ieFqyaL+Wm+b0OxsvR+fvEoVBpMEQM7N+likRDHGKD/HHljgPrh0+bY36ssRSbG1glSBowspblcIv8mQP1qyYfIJ4hTxYSuXkNQC8FpvOdZ1GAv7SCR/oyKnPWlnfTU7yN9Q7G9+DYuG7uuIggluOUpVeO28WaqfaFzwDTfZ3AOf9cVZphpr1ywiH0BL41Ufu6/wi7juaEt08ZCzb/pccil9ATnIbLHihh0ltZVywPPppSQ4O9RhWgtVa0GorYpM2CJ9zcRxJgCaZH9QQZz7ApaN1ag3JVbEsifPaeVIoI24L5i6d0xpHCpgdw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCXw6-0005Ec-Bx for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 00:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Van Ly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Nov 2024 05:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73656 X-GNU-PR-Package: emacs Original-Received: via spool by 73656-submit@debbugs.gnu.org id=B73656.173182168920097 (code B ref 73656); Sun, 17 Nov 2024 05:35:02 +0000 Original-Received: (at 73656) by debbugs.gnu.org; 17 Nov 2024 05:34:49 +0000 Original-Received: from localhost ([127.0.0.1]:55577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCXvs-0005E4-Th for submit@debbugs.gnu.org; Sun, 17 Nov 2024 00:34:49 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:58733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCXvq-0005Dp-6Z for 73656@debbugs.gnu.org; Sun, 17 Nov 2024 00:34:47 -0500 Original-Received: from sdf.org (iceland.freeshell.org [205.166.94.5]) by mx.sdf.org (8.18.1/8.14.3) with ESMTPS id 4AH5Yapo008003 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sun, 17 Nov 2024 05:34:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sdf.org; s=sdf.org; t=1731821683; bh=Uv2C/eBQGceXV+rPLImjaAOLnrycBcDZj1KlM1x++CM=; h=From:To:Cc:Subject:In-Reply-To:Date; b=C+t0UNJx6cuI2XSW5O1IAg48ye5X8fzMRymixsULf/ldmJHDyrnR9YTAdArgBhD/9 lISuT57icF9qUdmnWS1hmCifcToac5p3jQZBNZ2TQ2Qn+pl2299tK6n4Dy5MQ5ppi6 MwNJM7h7Kbk4e34leim/I7gskzO2AzXH+I+XR9TU= Original-Received: (from van.ly@localhost) by sdf.org (8.18.1/8.12.8/Submit) id 4AH5YZ9b024170; Sun, 17 Nov 2024 05:34:35 GMT In-Reply-To: <86cyivguow.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Nov 2024 15:43:59 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295507 Archived-At: Eli Zaretskii writes: > Ping! Can you try this patch? If it solves the problem, I'd like us > to install it. The patch as received, applied works on debian, netbsd. diff -u /u/van/src/emacs/30.0.91/lisp/man.el.original /u/van/src/emacs/30.0.91/lisp/man.el --- /u/van/src/emacs/30.0.91/lisp/man.el.original 2024-11-11 03:14:07.625129807 +1100 +++ /u/van/src/emacs/30.0.91/lisp/man.el 2024-11-17 16:22:08.348331007 +1100 @@ -972,6 +972,27 @@ table) (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t))))) (nreverse table))) + +(defvar Man-man-k-flags + ;; It's not clear which man page will "always" be available, `man -k man' + ;; 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")) + (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 + "-k" "-l" "apropos")) + (let ((lines (count-lines (point-min) (point-max))) + (completions (Man-parse-man-k))) + (if (and (> lines 0) (>= (length completions) lines)) + '("-k" "-l") ;; "-k -l" seems to return sane results. + '("-k")))))) + "List of arguments to pass to get the expected \"man -k\" output.") (defun Man-completion-table (string pred action) (cond @@ -1007,9 +1028,13 @@ ;; error later. (when (eq 0 (ignore-errors - (process-file + (apply + #'process-file manual-program nil '(t nil) nil - "-k" (concat (when (or Man-man-k-use-anchor + ;; FIXME: When `process-file' runs on a remote hosts, + ;; `Man-man-k-flags' may be wrong. + `(,@Man-man-k-flags + ,(concat (when (or Man-man-k-use-anchor (string-equal prefix "")) "^") (if (string-equal prefix "") @@ -1021,7 +1046,7 @@ ;; But we don't have that, and ;; shell-quote-argument does ;; the job... - (shell-quote-argument prefix)))))) + (shell-quote-argument prefix))))))) (setq table (Man-parse-man-k))))) ;; Cache the table for later reuse. (when table Diff finished. Sun Nov 17 16:29:12 2024 -- vl