From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 2FBE83858D32 for ; Sun, 31 Mar 2024 05:55:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FBE83858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2FBE83858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711864530; cv=none; b=dcjAC5Ev/3HWKtOLeUp0abRGjfl7Nv06/Nto7Zr1tW/Ypf7i2qVF6jh+QIoYVnjWxyMa+ikkh+cz588GkmoykDKz4sZNfKu/bybExt8F5dKsMFyiwowsCHpMFAzxmGfiLZzzZEVWLjA7Q6UxDa3slx+kes9MOyeL0B1imJFmf2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711864530; c=relaxed/simple; bh=2oHB3w6PMRDnG6em/jS/r2UoPm/P2OxfawPT0GkdRfE=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=fyNlf7KH8QrjFWz3vf9+xIcRqD6Ty/gLwBD0PiJfK/Tc1Dgu7puTzlnUYo38T95NiLszrkjqEimUFDl6cyPXKZe+8Mxu2Jgp83Oepqa2tULMKgVw3LtbhCYSCS91zfvci8mGk8/WfLGpcXZOKPEt0uhLDyFA2ElFwq0cTdguCQU= ARC-Authentication-Results: i=1; server2.sourceware.org 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 1rqoAC-0001s0-Ik; Sun, 31 Mar 2024 01:55:28 -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=hyQvQM1R+OssDMbiMNmW78zgJ3X/mftHZJjGLSZt1bw=; b=p1SxaSeUtrds kZFkNcIyM4xS5h+NBRL6ReNcvfzEkeBVK1Vj1f0Fl1vuNJ9cPvMyoeRF8O5yCrF9g6xDrYkJ8a3i+ 6NcBmmP387gWREC3Ch0tUpLFFdyrEXVoLMZ2RfFzAE5haDDT45gLXW3RPxJ5t8g98SO2tkGqVBdej rToarvkLTVAvvpUrTzx1vM5ajWW44IbEtuRhzZAL6M8IPKhwl1lvhB49vLy1AATpWpkZVU1twxUqI JoMvjd8i4VoycBh63G1d2Aq4ySBLSpEBQPKcDSgZcN9DjHHcs6rOt/Zl9sDtDTHgbiVB1qnKoY2XJ V4GSLu2snTPaDbWTObSKxw==; Date: Sun, 31 Mar 2024 08:55:26 +0300 Message-Id: <86ttknaqsx.fsf@gnu.org> From: Eli Zaretskii To: Lancelot SIX Cc: aburgess@redhat.com, gdb-patches@sourceware.org In-Reply-To: <20240330234918.fk4gdzmdeoojia27@octopus> (message from Lancelot SIX on Sat, 30 Mar 2024 23:49:18 +0000) Subject: Re: [PATCH 4/6] gdb: add match formatter mechanism for 'complete' command output References: <6adc14efeac88ecd9501c0c8c53b622099333792.1711712401.git.aburgess@redhat.com> <20240330234918.fk4gdzmdeoojia27@octopus> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Sat, 30 Mar 2024 23:49:18 +0000 > From: Lancelot SIX > Cc: gdb-patches@sourceware.org > > > (gdb) complete file '/tmp/xx > > file '/tmp/xxx/' > > > > The completion offered here is really only a partial completion, we've > > completed up to the end of the next directory name, but, until we have > > a filename then the completion is not finished and the trailing quote > > should not be added. > > > > This would match the readline behaviour, e.g.: > > > > (gdb) file '/tmp/xx > > (gdb) file '/tmp/xxx/ > > > > In this case readline completes the directory name, but doesn't add > > the trailing quote character. Btw, what readline does is not the only useful behavior. An alternative would be this: (gdb) file '/tmp/xx => (gdb) file '/tmp/xx/' (gdb) file '/tmp/xx/'a => (gdb) file '/tmp/xx/abcd' That is, allow to type after the closing quote, and remove the closing quote before trying to complete. This way, the user can use '/tmp/xx/' if that is what she needs, or continue typing and completing if not.