From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15864 invoked from network); 27 Jul 2021 05:53:07 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Jul 2021 05:53:07 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1627365187; b=eJdA/yaCMZ63t2UaN+LLqRSDj+Gxs83lyjH08P3WNqGxOdgIElF9VJgZu0VqabfweSLv/SDrVt RJWIN7klJcvNDbHpyLE4uWw4IajGlGUchTt7f6rKIU9PrLWtp+5zqvGkPzJB0moxZb/fSq8lMm D4RTZmatsncyoyNU3dNoDl5zvazIg8B1dKOn89j1wObGNa6UBa6uj3V4AWWuEIdDHXkyGHj4Ok w57f+ER2ZEtmYU+sOZ/xJ7ZnT6ifEglB/uVOo9J6syW/ROHsRiQk3x7pGoFX2e0SPxcwmUkXGm tQmbmAg3EvkVQIz0HEf2g5guSrdNYDm01Nmrx5esq7guvQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (egnor-2020.ofb.net) smtp.remote-ip=104.200.25.248; dkim=pass header.d=ofb.net header.s=ofb header.a=rsa-sha256; dmarc=none header.from=ofb.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1627365187; bh=qP1BBZvVUxGbuufLTXnNeQUU9amEbkuPAqWP74wHpBQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:From:Date:DKIM-Signature:DKIM-Signature; b=epVF5ERJyCFOr+EyMUl2w2k8rylFV6YT0U7B0QvMH5Kgcgf8IgvvbWw2ydoZyO7jSgADvXhA1y rJ5RgVQtZtfZcNxXxMKf0GZ83OEEi3HagOz4Usxj87HwcNqKE1kzYVX/Cp2TXLheArmIlhBgj+ yY15m9xU+ZSHeB0iIhdlxe2dlA6GHMxejiSEgtTZ7NbTx/XIPdc34nZz/9RtgRGkJfajAwfwCV p83tS/IDY/8pAHwR57cwhSN7hfQjf8K3H2ULu/YjUBVf9qaeLJoeUozMKrzY2ikTulgmA+vXDk rvghZZGcrYDMEPG2B+ML1DW6JaCSyqe+1KCg2VpgiIzjmw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Reply-To:Message-ID:Subject:Cc:To:From:Date: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=vh2UMN9WMkzY0/DlE8Q7AuRCu2eGVcqnDfhDy6+/3xk=; b=RNLydxGQIcop4hps129vz8I0MG tTFan9r1DeNmDNVhRm8oDWo/5y1mAhHY5nFqaDehEr5xUGQ+E5gTbE/BGBcSKl86NDnZ/0/YW8HLG sv7jcWIPxvMDczegFXSLRhiFY9pkzVi4Z/kjHdWn1dsK7Yn04T1gvpnPmBAcdtk1GawVSflmsCH3w qcXcGcwHRiGlA+TOafHB3827vGZPC13Tx1Wfk7eBpSV9HlV5rYqxErrmS/ocvsR8otyXanWeX1WlN dnQ9YrAKP8iGe+wSk/qVt6kEWqHG2w61whK2ChUgp0iITyRZRKYbVKAtEd1cZmsTXV7Z3Y5gANZGL TTV5G+0g==; Received: from authenticated user by zero.zsh.org with local id 1m8G1Y-000Fa1-Tj; Tue, 27 Jul 2021 05:53:04 +0000 Authentication-Results: zsh.org; iprev=pass (egnor-2020.ofb.net) smtp.remote-ip=104.200.25.248; dkim=pass header.d=ofb.net header.s=ofb header.a=rsa-sha256; dmarc=none header.from=ofb.net; arc=none Received: from egnor-2020.ofb.net ([104.200.25.248]:45688 helo=egnor-2020.members.linode.com) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1m8G11-000FHg-C7; Tue, 27 Jul 2021 05:52:32 +0000 Received: from ofb.net (163.242.197.104.bc.googleusercontent.com [104.197.242.163]) by egnor-2020.members.linode.com (Postfix) with ESMTP id 375824E267E; Tue, 27 Jul 2021 05:52:29 +0000 (UTC) Received: from localhost (unknown [135.180.118.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ofb.net (Postfix) with ESMTPSA id ABC853EE20; Mon, 26 Jul 2021 22:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ofb.net; s=ofb; t=1627365148; bh=qP1BBZvVUxGbuufLTXnNeQUU9amEbkuPAqWP74wHpBQ=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=cTt8rZUR6iXquAmPkkpjJIXRyEw/YFzfqSZ48ZJNUSGRSp6sRA+x74SGYLYk+hckS y/ouF+cAtUe6UtHUdq5L7B6cWsROEFqLaEU6MVv9JGtgdeV+hHcvlAHlOzsK+8YI2b PTcSsmxYqOv049X6YzLg8SniA6bjRWnYlOFdvyyS8caxB5JyDlj+Am14AhXaObSsfx VGZ/md+IqghTn3pUZTEDgel7U+0wLnV6olmP5m6uuH/ArmPOMiaj3PJ4X4c+/wl55w XJLY1iYww+EbeSCrXiK5sQ3reHM2A4CSzd7j+ZZdWjUU7uFd6RIBtDBmjxFHJiLEE+ TtIxgwycEA/xQ== Date: Mon, 26 Jul 2021 22:52:27 -0700 From: Frederick Eaton To: Bart Schaefer Cc: Zsh hackers list Subject: Re: [BUG] insert-last-word gets stuck at comments Message-ID: <20210727055227.4aobyf75yyckctve@localhost> Reply-To: frederik@ofb.net References: <20210726070654.v33wzoiwpqibwlas@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Seq: 49200 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Mon, Jul 26, 2021 at 03:50:17PM -0700, Bart Schaefer wrote: >On Mon, Jul 26, 2021 at 12:07 AM Frederick Eaton wrote: >> >> This may be a somewhat minor bug, but I think that when >> interactive_comments is set, the 'insert-last-word' widget gets stuck >> on lines that are fully commented: > >I'm able to reproduce this. A fully-commented line has an event >number but contains no words; e.g., it's also an "error" to attempt to >refer to event number 3 e.g. with !3 in the example: > >> $ zsh -f -i >> % setopt interactive_comments >> % echo hi #comment >> hi >> % # blah blah >> % echo bye #comment >> bye >> % echo foo >> foo >> % echo ... > >At this point: > >% !3 >zsh: no such word in event > >Even though !2 and !4 work as expected. So insert-last-word gets as >far as event 3 and then gets the no-such-word error, which interrupts >it. > >A workaround is to enable smart-insert-last-word. I've read the documentation for insert-last-word and smart-insert-last-word and I can't figure out how they are different. In the manual page, under 'smart-insert-last-word', it says: With a numeric argument, or when passed command line arguments in a call from another widget, it behaves like insert-last-word, except that words in comments are ignored when INTERACTIVE_COM- MENTS is set. So they are the same when interactive_comments is not set? However, according to my experiments it seems that insert-last-word also ignores comments when interactive_comments is set, so I am not able to understand the difference. Maybe someday someone will send a patch to fix insert-last-word to work as described in the documentation?