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, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13694 invoked from network); 28 Aug 2022 06:44:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Aug 2022 06:44:45 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1661669085; b=BcMAI2BGnPV32e1orQJp/ZMQ4k04FD90+Q1e9hA4zFf4mPaKLPu8PEL/6R7K/HGyq6bLVQ9iT4 k3G/99/AOGtokxvL1XAW8wTkksoNAiwkBLTvPpV9/NLEOuiJT1escv1CfpsdyO/Z6397egm/TG xwUpi5mvooKUGL56/pnl+0qila+CfelOGaInBKBWaaxRtxNEdOj8UkDBfvZMahG1ri408/UUG9 Jj8/lc7zXJrKQwhdB8UVQZMNdDK8Icr4iyJW6CZuovXiDxa5lrPfJEUlDDottkwZdEu39TJ0i+ /x6n0Ug8oUhNOcXitm3m5S9xmuk4m0ryyPUP6MRFf6Mq4w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (nikam.ms.mff.cuni.cz) smtp.remote-ip=195.113.20.16; dkim=pass header.d=gimli.ms.mff.cuni.cz header.s=gen1 header.a=rsa-sha256; dmarc=none header.from=gimli.ms.mff.cuni.cz; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1661669085; bh=KjuKN5vwWNE807uR1CwAHO3w5suX1Trrf5yAw6unAJg=; 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:DKIM-Signature; b=cfRGFCRzfrFakfOsnX8lHxB4bKN4AjeTRjISSjTT0HkV10clyn917svi5z6m7YGTTUHITs4r7e 2YxXMPgMBza7Ast3WEK2kji3OItzFhKeI3IW1tTchWPWdawNEtaz0WLrGMjkuKE/m2HLXT+O+j AU7DjTq5HCf7gjMUrxgBqlNMOZqxyt4qYFwT25moV0rSpDMX1i2we2rouwVgd5RDUuJe1oEjWZ ohpEH8130ZWma/OIk6V2n2mLrZB4T75LdqSktAsmbIz9fQvkhHasomi0eoOu7ANq+JXJRf3uLD 32+DpOS72XfihkYhZ0s+weeUQj7XT0NHs4fo1l3AMTkiqw==; 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=Kd/+TMK333cFatZu5+ELttD3Xi51kt472Myt3sSNu6I=; b=LI756hAwq6rD06uCaUweC1rgbj /r2pQBd089ceF9ecHpHeZXU8GYX90i+YZCxEGsQofNLw4b5xe/7UtGulLjBjsVp24Jx7OMFnhEmpy 9BVdfqSWoQGY3tT1zktgmP0TICi8nPMzbAUBt1+HUJ4dwIwZ/sLu32ch8337FoWEXsBet8BmnsIVe FTmq2SdbeYP9vR8aJYT2uSbDIENguT2hJ9tlavPISU4pAqTt66g8/eS19JYjTucVPVqwzXgNR0TW6 H+NJDeYyP0cbRdzNu4uQQFuiPnd05IgK3h2pP3n878nGVKtvojYaYjosKz9yCOxuMTMdnIGQFayzT frqE50ZA==; Received: from authenticated user by zero.zsh.org with local id 1oSC2D-0006tM-7v; Sun, 28 Aug 2022 06:44:41 +0000 Authentication-Results: zsh.org; iprev=pass (nikam.ms.mff.cuni.cz) smtp.remote-ip=195.113.20.16; dkim=pass header.d=gimli.ms.mff.cuni.cz header.s=gen1 header.a=rsa-sha256; dmarc=none header.from=gimli.ms.mff.cuni.cz; arc=none Received: from nikam.ms.mff.cuni.cz ([195.113.20.16]:36013) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oSC1H-0006Dk-Ey; Sun, 28 Aug 2022 06:43:44 +0000 Received: from gimli.ms.mff.cuni.cz (gimli.ms.mff.cuni.cz [195.113.20.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by nikam.ms.mff.cuni.cz (Postfix) with ESMTPS id 8B098280044 for ; Sun, 28 Aug 2022 08:43:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gimli.ms.mff.cuni.cz; s=gen1; t=1661669022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=Kd/+TMK333cFatZu5+ELttD3Xi51kt472Myt3sSNu6I=; b=sAoPdXzLEdzVy48UEHRftlU6Ll4VVZbuOPknZ/vWdZwkwcO6afESU9GWQ64nCLt4WydhaP reTfCGpanhvM82wCc6/Nd+OLYCK+eQ65aBX+tKqv/STXJrvLnfGhkHuZY7O6TQaFSo9BoX ehAVle4oPzYP9irABrs38nXLbooZ9MY= Received: from imladris (internet5.mraknet.com [185.200.108.250]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: karelb) by gimli.ms.mff.cuni.cz (Postfix) with ESMTPSA id 6C3C8440B6A for ; Sun, 28 Aug 2022 08:43:42 +0200 (CEST) Date: Sun, 28 Aug 2022 08:43:42 +0200 From: Karel Balej To: zsh-users@zsh.org Subject: todoman completion Message-ID: <20220828064342.25a2cdzg5sdxm4x4@imladris> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="h64rmfdcdbx2wcku" Content-Disposition: inline X-Seq: 27996 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: --h64rmfdcdbx2wcku Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? I attach a patch of other changes I have had to make for the completion to work. [1] https://github.com/pimutils/todoman/blob/main/contrib/completion/zsh/_todo [2] https://github.com/pimutils/todoman Thank you, K. --h64rmfdcdbx2wcku Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="todoman.patch" diff --git a/contrib/completion/zsh/_todo b/contrib/completion/zsh/_todo index b9bbe8a..8951906 100644 --- a/contrib/completion/zsh/_todo +++ b/contrib/completion/zsh/_todo @@ -32,7 +32,7 @@ __color_mode(){ # }}} # {{{ general helper: set variable of path to configuration file __todo_set_conf(){ - todoman_configuration_file=${XDG_CONFIG_DIR:-${HOME}/.config}/todoman/todoman.conf + todoman_configuration_file=${XDG_CONFIG_DIR:-${HOME}/.config}/todoman/config.py if [[ -f $todoman_configuration_file ]]; then return 0 else @@ -43,7 +43,7 @@ __todo_set_conf(){ # {{{ general helper: set variable main.path from configuration file __todo_set_conf_path(){ if __todo_set_conf; then - tasks_lists_path="$(sed -n -e 's/^[^#]\s*path\s*=\s*\(.*\)$/\1/p' $todoman_configuration_file 2>/dev/null)" + tasks_lists_path="$(sed -n -e "s/^\\s*path\\s*=\\s*['\"]\\(.*\\)['\"]$/\\1/p" $todoman_configuration_file 2>/dev/null)" # the eval echo is needed since the path may contain ~ which should be evalueated to $HOME tasks_lists_dir="$(eval echo ${tasks_lists_path%/\**})" if [[ -z "${tasks_lists_path}" || ! -d "${tasks_lists_dir}" ]]; then --h64rmfdcdbx2wcku--