From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id EF1473858403 for ; Fri, 12 Apr 2024 22:29:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF1473858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EF1473858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712960948; cv=none; b=im9wgt0UcZ3l8jg5bytfJjw+JNW0uWVWwsyIqEeN0aO10SOt6c5c+QsMy9xpx/1spvieqSyCfIUrdE6movmulPR9FyyyxguYTv30iOLPVeRpxIdH2PKWdpwBPICRWlDaPeUn+Pqhvb6LP/HMLp6DtZaQ1AFSgyEkp4ebBoy5ncQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712960948; c=relaxed/simple; bh=/xWsDLYwCZ+ehE/j1uKc+Dw4JVaivllJXhU8oHg6pRo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gNKKUd69vy4LCNKAMBspEZWhe5jFzE3TuMK/X76oVcff2AG4HjZNLu4bd4F+saxmmAZpQzIp1j6TIRoU3bQlnH6t3ZyNlw678796O336lDxUgMmavsbM4A+YACp+ynMfwMg2Yz8plCZC9TQ27QLceO8lEzyZBsZgyvcGO/qMTA4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712960946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TY7rJ8+BStkoV7SydzaqR+vLGZskDCXZpQ4xTh6zo64=; b=Ksx+F3qjaiJmmfZxuqa+wmeAthBqhHIHPqruupnMQ/0OclNs7UYbYkWlgrQnabyPnGRxSj nd/rmwDyZ9QVDxaoQtmzqy97P0XjT0Qmm6TAkgCwnucoJyKpWMRMWbW8Wvhdc7XPGmeY3f tYLs7/epasXg4I+/LLCI+ZbeOM2Gytg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-213-E6S7rYDNM1W4NpWabmZctw-1; Fri, 12 Apr 2024 18:29:05 -0400 X-MC-Unique: E6S7rYDNM1W4NpWabmZctw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4155db7b58cso6829485e9.1 for ; Fri, 12 Apr 2024 15:29:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712960943; x=1713565743; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TY7rJ8+BStkoV7SydzaqR+vLGZskDCXZpQ4xTh6zo64=; b=XertVY3SnhLfku72O/c07pZU377fYSe61TXxablWA97/SSkVSyhbHuGW0XC4R1dRGJ DB+Wx34R+XlWm5Dresk10AWudgnLibxm5J9DwCipGrYSwEr2MO5pDwz/xrDv11mIA856 hp6iR2MFB9S4u9JqOEeoeRE1Whyw8fbv3EVG+kXJei+5460qXIGfur2slT8KqbXA+GF7 vHzpWhqAWBGES7A403NW1uMvxV0faN82ykIcgxWIdN+s0AdM2q5lkhk3Hsiy81MWQe2u UOBbx0F+3WWHhCsJRC40kXjeIutYydXqg/60Sv1sXh7RxhJfvyHPGjiP342EZe5kTQlv hDcg== X-Forwarded-Encrypted: i=1; AJvYcCXu9e9PCHdBg+T31V/7imOvE96i6uBdwEqPu3f3lPyGydZAaWfUqn1RW/b4FrKP7HWsX6hIS+JeMowJceGEtZinEsazUFfy9NMVmg== X-Gm-Message-State: AOJu0YxRhbLCGQuh8hDbupbmOYLSJH5jgvWSGdh/SEAIeRu0vvikvSfI pwtWONR9O8KJhUBIgCZevCloi0hvCbKsD6FMufdXgngr5R1Wi1KZFLyLeJQVh8rQ4BYBKxsAwBC rNGPO21fSsgY0OcVpZ31M5VL7tSh5WkAPsaGyVz7AlL97W9VWb79/2n8mzICmz/rHR4o= X-Received: by 2002:a05:600c:358d:b0:417:4ff3:391a with SMTP id p13-20020a05600c358d00b004174ff3391amr3080175wmq.31.1712960943612; Fri, 12 Apr 2024 15:29:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSjOQXs57MW6/9uozHBSkUSXNTHjt1UkVFrWipMFc2Hx1sFtm8uMyO5v/2dcYukS2sCtd4BA== X-Received: by 2002:a05:600c:358d:b0:417:4ff3:391a with SMTP id p13-20020a05600c358d00b004174ff3391amr3080163wmq.31.1712960943083; Fri, 12 Apr 2024 15:29:03 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id i11-20020a5d630b000000b0034659d971a6sm5147166wru.26.2024.04.12.15.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 15:29:02 -0700 (PDT) From: Andrew Burgess To: Eli Zaretskii Cc: lsix@lancelotsix.com, gdb-patches@sourceware.org Subject: Re: [PATCH 4/6] gdb: add match formatter mechanism for 'complete' command output In-Reply-To: <865xwms9ng.fsf@gnu.org> References: <6adc14efeac88ecd9501c0c8c53b622099333792.1711712401.git.aburgess@redhat.com> <20240330234918.fk4gdzmdeoojia27@octopus> <86ttknaqsx.fsf@gnu.org> <87pluu4gwb.fsf@redhat.com> <865xwms9ng.fsf@gnu.org> Date: Fri, 12 Apr 2024 23:29:02 +0100 Message-ID: <87il0m43m9.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Eli Zaretskii writes: >> From: Andrew Burgess >> Cc: gdb-patches@sourceware.org >> Date: Fri, 12 Apr 2024 18:42:12 +0100 >> >> > (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. >> >> That does sound better. I think there are still things that would need >> figuring out. For example, what if the user didn't do the second tab >> completion, but just kept typing. >> >> (gdb) file '/tmp/xx >> => (gdb) file '/tmp/xx/' >> (gdb) file '/tmp/xx/'abcd >> => ?? What would this do? >> >> What if there really was a file /tmp/xx/'abcd ? What happens then? > > ENTER does the same as TAB, and then submits the result. So GDB will > see '/tmp/xx/abcd' in that case. This all sounds great. Do you know of any other readline based projects that do completion like this? My concern here is that, as I understand readline, this isn't going to be easy to implement. And even if we could (somehow) convince readline to do this, it's going to result in a bunch of extra complexity compared to just having readline do things the way it wants to. And no, GDB doesn't have to use readline, but I'd rather not have to throw out readline just so we can have working filename completion. I'm not trying to be dismissive here. This started as "Andrew's come up with a design, he should have discussed it first." And I'm trying to work out if this is a serious, we should do it this other way. Or if this is just "See, there are other ways it could be done, you should have discussed it first"? To both of these my answer would be, I've not really invented anything here, I've just connected up GDB with readline, and what we get is the readline way of doing things. Maybe then you know that readline can be made to do things differently (hence me asking for examples). Or maybe you're suggesting we should forget readline and do things as you suggest ... I'm just trying to figure out what you ideal end result is here. Thanks, Andrew