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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20505 invoked from network); 6 Jan 2022 10:39:17 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Jan 2022 10:39:17 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1641465557; b=s0okuJScfkqCpgi5Z1ASBAhtC9bj6Qge5olGxNyls//8v1dwEM4R5B+o9CFawzI2gEIGzQ60LV hvV+ZriCCEGQKMOJMvjqUDCZzZtDQhFrZpXoyWoD9+xXDlGBfp+wgvJn8qt6cO5XX4hrEtOePD bhLfHRBkT9PtJ6qYM0KYDw7nGLAPGmS96d6CJ7pGbIWbaf96L8i9LmrJsfOqg13WJEcZYG8oms KQsZYDtMn4xNSB+josAmaH+xkD338ShcOTw2rFGc3cI3rUKf8UiLsG8zSTUvQCnpJhOx7iJrg0 rqsgYR60W4+gGDyRGtkwbDOjxo5K7jkFc9mFtJzPJMvNPg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (pepin.polanet.pl) smtp.remote-ip=193.34.52.2; dmarc=none header.from=polanet.pl; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1641465557; bh=vOk1ySBLRdQOnkpJlQsjxYu9X7MNYTLw+/hHzabmuT8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature; b=ScSbOHQ9H5jX3MvrQ8AwfOUc6BY4Du80jXTSp9fFHqB1X1uDG3L0XT7Yg3qdOIggqz/IP/HvTC JLfpIKxsDHF2VGYQXnLwc64r7u44lqx6eWbYtVQLIKXufav0M2yljtbdkOl+qiAQZKQt2yQvnt cwcVQ9zRCaB5szc/UVl9qT+KKLgGpUmQ2NBJ+0pl2ai99AgEvODDTSIRWFFu6uI7rPSMdf4J7s TWQE7FqWbT+jIBl40kWpgfo52CUzKxh2jF0c/V798YZkF3eHZcAsjA36qR5Q75tPYFSSoiEGXZ P4qV9CquKyBHezyN/XSFbpV9HztyLeMtvamS2mbLZSnIXA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=rZ91oBLTAaUSV+6hkBZUlkAhd/eH4EK5dJ19v1nP+9A=; b=oUiHMBKIBEIqoGeA3DPDOF4GMR yqNBWozdoD7fbShaKBR6Rd6fCmdO6v76Y77PSRyvkdbiYmLhYepC56ZLvjFRdY/WNbuFxCB/YUH2H 9ECYQ08iS2knIQmrvXObD+z2ndpkWxA0A5H5h93DgFnteBT+/O/YI4LFN4UaF9O+V2i9H8sawrN9+ iTB+0q4+ap0NAfXdpK72ckb+hZfzZEnPjSUyOwsK+Ty0snT0ku9OW02GBCTWjEnvNWgHH7IofBIIB wf6TcjdEfBCAnrSvEuNcWlGmSfMFGZoqcL6vDauUqp8kcR1LY+9ZoJnXzgMdOx/mC/u8/7l64LqAR RAz40Htg==; Received: from authenticated user by zero.zsh.org with local id 1n5QAv-000CGR-1s; Thu, 06 Jan 2022 10:39:17 +0000 Authentication-Results: zsh.org; iprev=pass (pepin.polanet.pl) smtp.remote-ip=193.34.52.2; dmarc=none header.from=polanet.pl; arc=none Received: from pepin.polanet.pl ([193.34.52.2]:36595) by zero.zsh.org with esmtps (TLS1:DHE-RSA-AES256-SHA:256) id 1n5Q9z-000BXx-TK; Thu, 06 Jan 2022 10:38:21 +0000 Date: Thu, 6 Jan 2022 11:38:19 +0100 From: Tomasz Pala To: Bart Schaefer Cc: Zsh Users Subject: Re: _complete: insert unambiguous when globbing Message-ID: <20220106103818.GA10722@polanet.pl> References: <20220103123903.GA20434@polanet.pl> <20220105194643.GA13958@polanet.pl> <20220106015221.GA12608@polanet.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20220106015221.GA12608@polanet.pl> User-Agent: Mutt/1.5.20 (2009-06-14) X-Seq: 27455 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Thu, Jan 06, 2022 at 02:52:21 +0100, Tomasz Pala wrote: >> unsetopt globcomplete >> zstyle ':completion:*' completer _complete _match _expand >> zstyle ':completion::match:*' insert-unambiguous true > > Smart one! This is nice, but this time I got other issues: > > $ rpm --*er[tab] > > without glob_complete, this method of finding options for SOME commands > stops working. What's the difference between ps --* and ls --* that the > latter still works? This is weird - it's broken only when both styles are set: zstyle ':completion:*:descriptions' format '%B%d%b' zstyle ':completion:*:messages' format ':%d' > And back to my example: > > $ touch 2021.12.29-14:41:02.xz 2021.12.29-19:41:02.xz 2021.12.30-03:41:03.xz 2021.12.30-14:41:04.xz 2021.12.30-19:41:02.xz 2021.12.31-03:41:02.xz 2021.12.31-14:41:04.xz 2021.12.31-19:41:03.xz > $ ls *04[tab] > - this one is much nicer than my version, goes directly to: > $ ls 2021.12.3-14:41:04.xz (note the suffix) > with cursor __^__ placed here, on dash. However, unless I move cursor > left+right manually, pressing tab second time moves cursor to the end > with uncompletable line... This exposes some general issue - I don't know which part inserts unambiguous SUFFIX into the ZLE, but obviously it should be done only when completeinword is set. > And following one fails miserably... > $ ls *z[tab] > $ ls 2021.12.- > > See the dash at the end? From now on, no completion... This problem is This is probably some deeper bug somewhere, still happens with --norcs followed by settings from this thread. > There is still one issue with coloring completions, that works fine with > my approach, but seems to be stuck on _oldlist: > > highlights='${PREFIX:+=(*/|)(#bi)($PREFIX|$PREFIX:t)(?)(*(${LASTSEARCH})*)#*==1;32=1;31==1;32}':${(s.:.)LS_COLORS} > zstyle -e ':completion:*:*' list-colors 'reply=( "'$highlights'" "ma=44;1;33")' > > With _oldlist in action the colors are not updated after prepending the > unambiguous part. In my solution compstate[old_list]=keep is set on second tab strike and the colors are recalculated at this point; is it because this is done AFTER "# Stuff we always do to clean up" which restores ZLS_COLORS? Any way to simulate this for _oldlist? And one more final note - I said all of those sacrifice pattern from ZLE (which might get people angry if they loose some hand-crafted fine-tuned one and are unfamiliar with undo), however without globcomplete this pattern is also lost. -- Tomasz Pala