From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#60464: 29.0.60; Regression - pcomplete-arg fails with argument 'last Date: Wed, 4 Jan 2023 15:35:42 +0100 Message-ID: <3a2a25bc-9b15-cdc9-ace2-b859f71b5e71@daniel-mendler.de> References: <87358u5y6l.fsf@daniel-mendler.de> <226b32f79f2d431d75b6@heytings.org> <009141ba-c21a-a5cb-a81b-c72a12a26207@daniel-mendler.de> <226b32f79f728e6bfed4@heytings.org> <82cf05e4-3c3f-9804-4801-eb31988f6d7d@daniel-mendler.de> <226b32f79f325daf9c7a@heytings.org> <226b32f79fe1e154cfb4@heytings.org> <1de8c8ce-4aa1-c6e4-1ede-0acafc620a50@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16505"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jim Porter , Eli Zaretskii , 60464@debbugs.gnu.org To: Stefan Monnier , Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 04 15:36:14 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 1pD4sH-0003zn-Lz for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Jan 2023 15:36:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pD4sF-0007w9-AY; Wed, 04 Jan 2023 09:36:11 -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 1pD4s8-0007p9-0E for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 09:36:04 -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 1pD4s6-0000Yu-Tx for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 09:36:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pD4s6-0005Zb-Gs for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2023 09:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Jan 2023 14:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60464 X-GNU-PR-Package: emacs Original-Received: via spool by 60464-submit@debbugs.gnu.org id=B60464.167284295221396 (code B ref 60464); Wed, 04 Jan 2023 14:36:02 +0000 Original-Received: (at 60464) by debbugs.gnu.org; 4 Jan 2023 14:35:52 +0000 Original-Received: from localhost ([127.0.0.1]:48005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pD4rw-0005Z1-CF for submit@debbugs.gnu.org; Wed, 04 Jan 2023 09:35:52 -0500 Original-Received: from server.qxqx.de ([178.63.65.180]:43467 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pD4rv-0005Ym-1F for 60464@debbugs.gnu.org; Wed, 04 Jan 2023 09:35:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EGLz1c4RP9n9IdBAwiXnOZYcQJuVJB8PTSBXiotyIhQ=; b=Lgups9UMA1eyj9aFwRtQEkE3xg GFiafPNgDo/MC7d//sqnQTH+7Xb/R0VoxVNBPFDTyq15zdumcHKgXJaHtD41/Z0X6Re1fTIOgOH5n JAagNjTqkm5OhA8Db5lmIHKZZjDmNeUJEDQjpCHYkutF4ISaD4zEkkjLLJXAqI4ELAKM=; Content-Language: en-US In-Reply-To: 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:252479 Archived-At: On 1/4/23 15:25, Stefan Monnier wrote: >> (defun pcomplete-arg (&optional index offset) >> (let ((arg >> (nth (+ (pcase index >> ('first 0) >> ('last pcomplete-last) >> (_ (- pcomplete-index (or index 0)))) >> (or offset 0)) >> pcomplete-args))) >> - arg >> + (if (or (stringp arg) >> + (eq index 'last)) >> + arg >> + (propertize >> + (car (split-string (pcomplete-actual-arg index offset))) >> + 'pcomplete-arg-value arg)))) >> >> IOW, instead of unconditionally returning arg, we now sometimes (when arg is >> not already a string and when index is not last) return the textual >> representation of that argument (what the user typed in) with the value of >> arg attached to it. > > I don't understand the `last` condition. > Could you explain it (e.g. with a concrete example that breaks if you > don't include it)? This seems like its opening the door for yet another bug. Gregory, could you please take a look at the version of pcomplete-arg that I've sent? Daniel