From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58921: Tab completion hangs in eshell Date: Thu, 23 Feb 2023 14:34:39 -0500 Message-ID: References: <2cb2b8aa-0813-5eae-3bfc-27831b3d50dd@housseini.me> <010201842d4961c3-56e13f9e-0c67-4fd2-9731-657c131da32c-000000@eu-west-1.amazonses.com> <537afe67-809e-c09b-db84-05f41ba5d3b4@gmail.com> <714828fe-bf60-f991-363b-6ee86fd70c30@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22132"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: reza , 58921@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 23 20:35:27 2023 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 1pVHNH-0005X3-1v for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Feb 2023 20:35:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVHMv-00024a-0K; Thu, 23 Feb 2023 14:35:05 -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 1pVHMt-000240-81 for bug-gnu-emacs@gnu.org; Thu, 23 Feb 2023 14:35:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVHMs-00060r-US for bug-gnu-emacs@gnu.org; Thu, 23 Feb 2023 14:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVHMs-00011f-BT for bug-gnu-emacs@gnu.org; Thu, 23 Feb 2023 14:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Feb 2023 19:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58921 X-GNU-PR-Package: emacs Original-Received: via spool by 58921-submit@debbugs.gnu.org id=B58921.16771808903919 (code B ref 58921); Thu, 23 Feb 2023 19:35:02 +0000 Original-Received: (at 58921) by debbugs.gnu.org; 23 Feb 2023 19:34:50 +0000 Original-Received: from localhost ([127.0.0.1]:35398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVHMf-000117-Py for submit@debbugs.gnu.org; Thu, 23 Feb 2023 14:34:50 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVHMe-00010t-0c for 58921@debbugs.gnu.org; Thu, 23 Feb 2023 14:34:48 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 264101000C3; Thu, 23 Feb 2023 14:34:42 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7E79B1000BC; Thu, 23 Feb 2023 14:34:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1677180880; bh=xqJgxGBWBDz8UP0NFwcRA7fWNFbkSGLEJCkLj57sLOg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Pu7S4JeO3QXgTnTSGxPN3N7W2qJK1RUnn+Rflo08hDAM6bOoki+yBmbF+OjnmLcT6 fnMJSC3nw1VEKEMEdWg6h6ISqWtMTCnbqTTn9VPfWqCOO6usn9+J4oNM1wpYaiM+Ed 02Q19lk0WcGmz8ribBQPtJn9m65akyPb7oIhwzR7KTeXZ+s08bg3j8ImvYO/Kx0+NU o7BoOjsWX1J7MNa3A3Uba/0ibGaYzNPwoPrRDkDtxv6oqMh2dlXC4gbg0h40hgMNLU COfB1rt4wxNgM/FAAkHAGJNamPGpTT+dSSqlF0mJM/D4eNULYrohA9su5NP8BA+UMJ FhzbGSMfg0HBA== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 372681209E5; Thu, 23 Feb 2023 14:34:40 -0500 (EST) In-Reply-To: <714828fe-bf60-f991-363b-6ee86fd70c30@gmail.com> (Jim Porter's message of "Thu, 23 Feb 2023 11:25:15 -0800") 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:256522 Archived-At: > So we just need to fix the case where the argument matches "\\`--.*=". I'm > still not really clear on all the details of how Pcomplete works, but > I think case (2) works because of this code just before my diff: > > (if (pcomplete-match "^--\\([^= \t\n\f]*\\)\\'" 0) > ;; FIXME: Extract this list from "tar --help". > (pcomplete-here* > '("--absolute-names" > ;; ... > "--volno-file="))) > > That is, if we have an arg starting with "--" and without an "=", call > 'pcomplete-here*'. Even the arg doesn't match anything in that list, it > should still move forward (I think). However, when we have an "=" in the > arg, the function instead evaluates the 'cond' block that I modified, so it > needs to be sure to call 'pcomplete-here*' (or some other function) to make > forward progress. The way I see it, either we still have an inf-loop or your (pcomplete-match "\\`--.*=" 0) condition is redundant. >From what you say the inf-loop should only manifest if we match neither (pcomplete-match "^--\\([^= \t\n\f]*\\)\\'" 0) nor (pcomplete-match "\\`--.*=" 0) and indeed: tar --pot\ seems to hang. Stefan