From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73656: 30.0.91; icomplete-vertical has no matches for M-x man RET chdir Date: Sun, 13 Oct 2024 15:09:08 +0300 Message-ID: <86msj8tdaz.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4606"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73656@debbugs.gnu.org, monnier@iro.umontreal.ca To: Van Ly Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 13 14:10:13 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 1szxQK-0000yi-5h for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Oct 2024 14:10:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szxPy-0005Nz-0i; Sun, 13 Oct 2024 08:09:50 -0400 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 1szxPv-0005NO-S8 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 08:09:48 -0400 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 1szxPv-0002y3-JI for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 08:09:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=Zy0S13bOV1Epjzbhw9+AP98UMeszbGvxLb3HyFNCfwY=; b=d9VeRlY6A2ZbAoocgtx/OOqriQ0k4D5UckRv8ImzlnGT19jfsU1Bu8o8KBAcDnrm3E1Fn+ayiVN6yeDW1DJhiBJ/qDUqpk89MvFEcAjOrdPxckz9RLhniisYllGfYia9IinMgT0Rtg8ENdRiNFOtMeQYR+xxLb5DTJ7h0lo/+2AOWIzG2CHFCIzUDkgQgz+2fTHa8rLvKrFvcPW4ZRDqL3KdxjyzCnv6cNChEnWUhtuX2VmeDRDIKl5rEvFs7neCujoR4OEt6NeAJvhtRnfZH2ippUGkOLBQinW0WbiGU9K3QF6xiTfhplI++UuSIsPYgYhgvodonQNZFo78JJrPfQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szxQ9-0006Ph-NY for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 08:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Oct 2024 12:10:01 +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.172882137624602 (code B ref 73656); Sun, 13 Oct 2024 12:10:01 +0000 Original-Received: (at 73656) by debbugs.gnu.org; 13 Oct 2024 12:09:36 +0000 Original-Received: from localhost ([127.0.0.1]:50476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szxPj-0006Ok-V1 for submit@debbugs.gnu.org; Sun, 13 Oct 2024 08:09:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szxPh-0006OR-Cu for 73656@debbugs.gnu.org; Sun, 13 Oct 2024 08:09:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szxPL-0002vy-C2; Sun, 13 Oct 2024 08:09:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Zy0S13bOV1Epjzbhw9+AP98UMeszbGvxLb3HyFNCfwY=; b=mmFcQpgTVuQg 4UeIK9b3GmQRgCH1oaZ3qgygRDC+r9heFf+vSEpdjz5W7dm3qRZwkW3lWzoh6OZEbuVA5wst197y1 Beak1Ssh6gmiv07480BaRxWY6nu40Z6F3XK7VeI4Y+qim2dmrm+IC0jtwSRk0aFwXTWfQtQuaY/eP cFdmDjRUeEKoDtBn0HUD2PygqcpBN9Kv0QPf3Qi1nWJQ0Sl/cgVYAsAKA2+efrEZHQna/n74PQouk IWcVyfOrbwR69X1o1ReLqMu0d/QMtEiNwP+JiRqkYNr67Dh7XVu+nkm95LRbxTM3axxIQyQ8CI2jB 0w2UauqSv5lTQI8jgQJlqQ==; In-Reply-To: (message from Van Ly on Wed, 09 Oct 2024 23:43:12 +1100) 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:293515 Archived-At: > From: Van Ly > Cc: monnier@iro.umontreal.ca, 73656@debbugs.gnu.org > Date: Wed, 09 Oct 2024 23:43:12 +1100 > > > Eli Zaretskii writes: > > > > > I think this points out the problem: man.el expects a different > > format, as documented in the doc string of Man-parse-man-k. But maybe > > I'm missing something, so I'll let others chime in. > > > > My suggestion is to step with Edebug through Man-parse-man-k and see > > what's wrong there. > > > > > > The netbsd-users say legacy behavior for "man -k output" is obtained by > > > > $ man -k -l chdir > $ apropos -l chdir > $ env APROPOS="-l" emacs -Q > > > > The Edebug session would cycle to line 16 below (line 953 in man.el) > foreach of the characters from chdir during icomplete-vertical > autocomplete to find no matches. > > > > 1 (defun Man-parse-man-k () > 2 "Parse \"man -k\" output and return the list of page names. > 3 > 4 The current buffer should contain the output of a command of the > 5 form \"man -k keyword\", which is traditionally also available with > 6 apropos(1). > 7 > 8 While POSIX man(1p) is a bit vague about what to expect here, > 9 this function tries to parse some commonly used formats, which > 10 can be described in the following informal way, with square brackets > 11 indicating optional parts and whitespace being interpreted > 12 somewhat loosely. > 13 > 14 foo[, bar [, ...]] [other stuff] (sec) - description > 15 foo(sec)[, bar(sec) [, ...]] [other stuff] - description" > 16 (goto-char (point-min)) > 17 ;; See man-tests for data about which systems use which format (hopefully we > 18 ;; will be able to simplify the code if/when some of those formats aren't > 19 ;; used any more). > 20 (let (table) > 21 (while (search-forward-regexp "^\\([^ \t,\n]+\\)\\(.*?\\)\ > 22 \\(?:[ \t]\\(([^ \t,\n]+?)\\)\\)?\\(?:[ \t]+- ?\\(.*\\)\\)?$" nil t) > 23 (let ((section (match-string 3)) > 24 (description (match-string 4)) > 25 (bound (match-end 2))) > 26 (goto-char (match-end 1)) > 27 (while > 28 (progn > 29 ;; The first regexp grouping may already match the section > 30 ;; tacked on to the name, which is ok since for the formats we > 31 ;; claim to support the third (non-shy) grouping does not > 32 ;; match in this case, i.e., section is nil. > 33 (push (propertize (concat (match-string 1) section) > 34 'help-echo description) > 35 table) > 36 (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t))))) > 37 (nreverse table))) If you edit this part of Man-completion-table: (let ((process-environment (copy-sequence process-environment))) (setenv "COLUMNS" "999") ;; don't truncate long names ;; manual-program might not even exist. And since it's ;; run differently in Man-getpage-in-background, an error ;; here may not necessarily mean that we'll also get an ;; error later. (when (eq 0 (ignore-errors (process-file manual-program nil '(t nil) nil >>>>>>>>>>>>>>>> "-k" (concat (when (or Man-man-k-use-anchor (string-equal prefix "")) "^") (if (string-equal prefix "") prefix ;; FIXME: shell-quote-argument ;; is not entirely ;; appropriate: we actually ;; need to quote ERE here. ;; But we don't have that, and ;; shell-quote-argument does ;; the job... (shell-quote-argument prefix)))))) (setq table (Man-parse-man-k))))) to use "-k" "-l" instead of "-k" in the line I emphasized, does that solve the problem?