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,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12962 invoked from network); 28 Aug 2022 10:58:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Aug 2022 10:58:16 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1661684296; b=pFTw1Lpk2fM0oMWeXBvdVXWnj2WTbRNlSePFgYZdqw4GKMs2RE8ckuZ676vKtgeECknhvmGb9z kXAqdsp5CYn/DnTPDaRJH+40y8gKoa+nAR4tyfeFXi1AEXKX8Q90qj6jswZaOjnHhrvJwFrTal tmqb2P2HR2+dZXW3hMuDD2IClkUvlXmyjHLPBG5tjq5Bif4sAGARh2kpQqS2ri4gdVEErdnaTK SL+KuS8H4JvpvYjhDrk4wCuY+6ZHBF59sU4qNDq/sX06xHKGisjQAFyvRPh4GUe+O5KCr3WOh0 tHxSKrZgeV/+j7n0R6j7geL9j0CYCU2KsHm/anE2bt00gQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout2-smtp.messagingengine.com) smtp.remote-ip=64.147.123.25; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1661684296; bh=icRgwHvShO3Fy0QRLKGQ6ossmgpkQjol3khHQI2Yhv8=; 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:DKIM-Signature:DKIM-Signature; b=pGyxf+TPE6gtgbugTuLNzx+ds+sn726k20+O/cQQYvZIEBzron7OwfZuz8vMK8QohaShUySoe1 PYUhFmKSy996Ju8wUmaL0b4pabEJiqyN4n7lC7EYzrzJ1YfaZzM+hKFMhIKk/ybWzJvrg3d3uQ y8qN4ZdpWX4eLZB2sJAhQgQIkVOv1cnMMzLKK9zwzvMVc92vGvzq4h6PB5VDbtKeRgFyFNXiyD AqDVVe1MqTBFBmPF5IhKL5tWodDzu/rf8JxWPqf3vO3ocZwbWxmW5w3uzCV25rfe9SkdwYXzDa ORkDHj4JTAV2OIvDUJBv4BXfaFGhh617LIAq53lKlz7dhw==; 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=NlhSgQswRiHm9lqtopspNd5LDhjXByFrLY554Il+Y5U=; b=ojHfWcuLG9+p+Kv19uVCg5cbtb PC2v12b+X8MskDCASh/drtopPh+VWwQY7CC2M6khSDRb8nIuhlgftk3bC0BWZkl8jZSm1nDx7GnX+ Szve5YMYpnjzyr8r992PRMvv0sysVEfY/xqjIbjXYURJJlqJzljSj0hVHTrfOSnR3Pl4lTrt7lX7h UXeZgwzfymitPx+Cu32+Xcp9y43fDCNfTEZpgP+pY0CCBSi2YhTq1CUAuZrCPFaAO+cA7rvGJoSbg 2omIFfLUAZrgJaIBO2aCnHuwWfhE9IEntLHStlfrh5sS6/0qB/B540bhnPKkJANkphvIOIfG0JGPJ iRSYjQsQ==; Received: from authenticated user by zero.zsh.org with local id 1oSFzc-000H0o-O4; Sun, 28 Aug 2022 10:58:16 +0000 Authentication-Results: zsh.org; iprev=pass (wout2-smtp.messagingengine.com) smtp.remote-ip=64.147.123.25; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:56077) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oSFxn-000GHg-FT; Sun, 28 Aug 2022 10:56:24 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id CF1643200805; Sun, 28 Aug 2022 06:56:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 28 Aug 2022 06:56:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1661684181; x= 1661770581; bh=NlhSgQswRiHm9lqtopspNd5LDhjXByFrLY554Il+Y5U=; b=j +aRugf7klJADt4WV6iKdQsIxMNyy4t9CMu6rpB4EXt9Rjqk6GPFfyfwuEYPW597o vemOs0frMNlqbUO28OFi6lJ554b/WsEvujTRjs8OUHZ/p38oGhkNfzoDGo6BlrRc dgG/Qz+YIWZ4qT6bO3d+8xliWO7RvsZK1KRlvM3fqKd+srS1UF9ipydE0vGoAZ8z y+RmI13RoL8P35Bb6iTLE/lpaXscaIzAZLBxX7JPi8jiXWG557mgx84ywFQ0H8XP d589nurl0DLTbGBM4EqTt7rR7IlEnzveJiBBpc410aa8Ig7CuOLnPWRSqFbLLnOH T/82NZZoXfEVS+W1PvAKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1661684181; x=1661770581; bh=NlhSgQswRiHm9lqtopspNd5LDhjX ByFrLY554Il+Y5U=; b=PQCYzO1hkHicRENLLFeaq46XHs0LqVfAD+J3S5WSSFb9 EXJBG7dpz3u7Eo43PH2LyB5/i+2otG7hos3KPGLw77AptrjHmgk3XpoSijhfKRx2 XoBKm0LLL+p5NSDrz8GF20GxO5qUxrG9BNXQKXnxYwb/mIUI33y3XNQtO/g0THLP OUQD7o5ua/6WW/M3f74L6FLnn5pAf9zAGHOxxKlYp/ueSSbWHBbuwoiPpRr8vISS 9sDmgRXvl85YjDTRihtJjrIUDHyXzXhiLwyoWfztee40GIWabXg3AKW9VhhdY1qo zM3P1XezOclbHTZXKgFYyGi0BEuejzg63Wyehmm7+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejledgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujggfsehttddttddtredvnecuhfhrohhmpeffrghn ihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeegffevgfdvffeffeeludfhjeehkedtjedvieeluedtkeef gefhleekkeejtdegteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Aug 2022 06:56:20 -0400 (EDT) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4MFr8y0Jqbzh6; Sun, 28 Aug 2022 10:56:17 +0000 (UTC) Date: Sun, 28 Aug 2022 10:56:17 +0000 From: Daniel Shahaf To: Karel Balej Cc: zsh-users@zsh.org Subject: Re: todoman completion Message-ID: <20220828105617.GA5920@tarpaulin.shahaf.local2> References: <20220828064342.25a2cdzg5sdxm4x4@imladris> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220828064342.25a2cdzg5sdxm4x4@imladris> User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 27999 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: Karel Balej wrote on Sun, Aug 28, 2022 at 08:43:42 +0200: > Hello, > > I'm trying to get the bundled zsh completion function [1] for todoman > [2] to work on my system but I don't seem to be able to do so. > > Specifically, I'm currently attempting to make `todo list` complete > the available lists. The problem I am stuck at seems to be that the cache > policy function `__todo_lists_cache_policy` at line 127 is never called > and I cannot figure out why: the cache policy setting at lines 147-151 > seems correct and yet the call to `_cache_invalid` at line 153 does not > redirect to `__todo_lists_cache_policy` at all. If I place the function > name there directly, everything works as expected. > > Could you please point me to the cause of this issue? > Observations: 1. _cache_invalid won't call the policy function at all if use-cache isn't set. 2. The use of _cache_* functions isn't idiomatic (compare the callsites of those functions in zsh.git:Completion/**/_*). Hypothesis: In your case the use-cache style is unset or set to false (check `zstyle -L | grep use-cache`). That causes _cache_invalid to return false without calling the policy function, then todoman's completion calls _retrieve_cache and doesn't notice that it returns non-zero. Thus: Workaround: Set the use-cache style to a true value. Fix: Call _retrieve_cache idiomatically.