From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 5AD6F2BA53 for ; Mon, 19 Feb 2024 13:31:00 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1708345860; b=Cg4BNepXQk+Kjz8yblLJjWPIH0YXR1FualL/qWQ81ynyzeGv7M3xiyWrp+9jneIOlIm/Yo4/u2 ieML27yMqMQm/EBA19X3WjuMZ/cCcevlJXcJTVUAWr/ygt54qWfQ3O0lq6XjjHgr6QlPGTsTnX 4kSxCeXx8e6zF0cecJay0TPJK5nM/DUfbu3VW7Vp/IFQRDV76gYOpZjzp7WeLDIMGtYeUp6+0M c5yEtEH8GVHlDv8pfZahIEl7Gb+I/WNQ3d6RuuyTtBmH0+4rLpSxe3Zcc2ScE0G1kR3NPLLFla YnR2y6xgTuteEYuVu4fPHpnYnN0ROKiI+4ETDMpowNjp+g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (qarx.de) smtp.remote-ip=31.15.64.162; dmarc=none header.from=fefe.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1708345860; bh=MuuWAnEopko8QEg5jkeGLYyi/Erel6t3S02kQosEvxU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: DKIM-Signature; b=cKX6AKCyVdJ17qkXgBIbyZIV/gQCGZlroAbj/XGEZRlAAFQ4rMNQGHpkVXkedBqsWR9K7ZcYU7 c1Igy3oJ8N6xkHKk5p6EcZ7NdB0nqbkV83P/awgP5Mhws7okFMlY2mwL5av8rGp5OGO3+HVb8x EUEnyftRVSTGJSHqYvMx6d2aCnBYON1ZX87JGvFAhTtKO4vc8YOJtQlojxocVAf9OkjQBFGjh8 Z82BZomvLafRz3c+He/5lbx+5Y80wEKgp0MuGA0PEb7XBiaeHEVLRlT40EY16p2Jz4fXHGQG6s Z8rS0JXC+jlvcBD+Z68myZR91DcbqFq02EFI+uF7jWNQFg==; 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:Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=F4utdc1UmpwhLopv6hDgTmQdKFB68v5aWCeN5UFTIiE=; b=PAZbKjQ96S6ryVv5pozrIAIgNn KJ6pY8mLNYlrEA7yb6Nsph6dAdxb7W74pkVVylpzTfGtgFCTqVItOR2tz25GgAzSO/jJr3xZbtAMi htX6agKcuKJ2hK+EyAIrV4Akwpdm3O9su7IRwSTm72asiGlaLtBCFCv3cXPLQPPSAA9X2oCexyk5x ULzyliMhUwsr3bxqDwvMLhQvEwhgY87sur6HGgAfyl7q9K+uoJ2qjELjCIKgN4rKcO3IeUOY69Pc8 UnsCa/6e808pVk4t737hMgDgFGQZzhHv1+h1IqAOpZXZE2ldhSiaEKzYi2nD0tMQUHWCyWbxqOdTC gBBHkG6w==; Received: by zero.zsh.org with local id 1rc2nT-0001yl-JN; Mon, 19 Feb 2024 12:30:59 +0000 Authentication-Results: zsh.org; iprev=pass (qarx.de) smtp.remote-ip=31.15.64.162; dmarc=none header.from=fefe.de; arc=none Received: from qarx.de ([31.15.64.162]:41218 helo=a.mx.fefe.de) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rc2mb-0001Hq-Vj; Mon, 19 Feb 2024 12:30:07 +0000 Received: (qmail 30723 invoked by uid 1000); 19 Feb 2024 12:30:10 -0000 Date: Mon, 19 Feb 2024 13:30:10 +0100 From: Felix von Leitner To: zsh-users@zsh.org Subject: external completion command Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Seq: 29688 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: Hello zsh-users, I have not kept up to date with the zsh command line completion functionality for more than ten years and decided to look at it again recently, only to find it transformed beyond recognition. I have written a few tools I use for my day job, that are based around looking words up for example in a TAGS file, and I have also written a search engine. I usually use these tools from inside my editor, but it would be nice to have proper completion from the shell, too. So, basically, what I want to do, is % s memc[TAB] memccpy memchr memcpy memcmp However, since the database covers potentially gigabytes of source code, I have written an optimized tool to list all the words that start with a certain prefix. I want zsh to run that tool with the prefix I already typed. I don't want to give zsh a list of all the words, because that would be very inefficient. I would also like to tell zsh to abort after reading 100 completions. I also don't want zsh to cache anything, neither on disk nor in RAM. If I type tab again, I want it to call the external command again. To give you an idea about the numbers: for the zsh 5.9 source tree, there are 76277 distinct words, but starting with memc there are 4. I don't want zsh to waste time reading and discarding 76273 words. Is this possible with the current completion system? Thanks, Felix