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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6059 invoked from network); 21 Nov 2022 03:58:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Nov 2022 03:58:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669003094; b=dogsG2PmSoCZg4ns2Q5KxQJvGOAcoxlA9xU2ncdzV9s3rLxnraB75I/TfTUn58+pRbL7YfYYu9 G0ksu71KpVYvr2kl4Byjq56ycrg3QZE1l5/8YYiIPlULhCQB8+Dy2TgV1byhM8ZpMfonPog8p6 de8crG7lOXjAxAhqSWZbeU9PufPFseDRzkrdrKobaJ7WnhT3NPvJIddKvBraN+dKHBh8slyBcC BxWaMaC1PfOQP0g2kWrpW6BzaLf+B9wQzMoeyCZ6fpXiS+ELd5vHftdGEPncbk+cX+kLfILqax A2ffgVX5blGEo4kpDqVQ17y8efkD3pRfGIXyy9RrWicDFA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1669003094; bh=QNX6qofpFeeX3L9ekHyAUueLyVr1O7fO4pJpg5o8230=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=OkmzoT7PQ+MThHeoXlIX/EDf+fvtLHjEtELNP4Z+5802S94ktqfRc453mcoxQMwwlsrcyA5mlR l+1WNQ7LERA1KsKfqLCwIoUlvDr58AFA5us8vGHyTTThME4oHHo6JJvFUBGTZoiwtqc4V70g4v jqGAussG1gXvZcWxZ/WjwFBVUS4RDM4zQ5ytwRKOr0YnRk0BWal7cvPmHP8/BUTLSjMN1PMe0/ APj5Bl5+hq57gIblATLkUMKxvD2XN75YAD2gAs0XdEHgJerHlxfo8hpptZ6p2iQmcWzCDc/TmL NcKxxqKKrMiFbPgG1dx4zbYgcF1pUrHCzi50ayUpexO2PA==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=EKh5p0rD+6I+WrX/pxd+hRqzfvHOLuEYsoyA8cVYj6Q=; b=TfwesdY8hzZRRffZxFk3pIbDkl qL3dOpViCtQ4qws5t+sfJRGzxVA1Em0M04PLmtcn1sVM9Bm0y2M5h/t2VURBDyqtViEVF4JplX4oi 6QDPUsxHCGpadkthwwcbvJr8UaD5lmRlPwMr6sOG8/rEjmw3lIO2YIPD/nJrNkTsera9/spzsYExB CRc0jec3Z0ZhnBrDRw5CkMPRU/9wA15gwzlI6UMry/7+2ZrXe0uZmAF3m9hiE2LPPqZvGf9FaU+JC ElEHXPiL2a2xkG76Rh0QQ/07glrDvbqRhbXHV92mtbl1Ja9GZWw9kizojZH3PEGtcoG8CMfVNgUpc Mg03D+AA==; Received: by zero.zsh.org with local id 1owxwj-0002iG-0p; Mon, 21 Nov 2022 03:58:13 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f48.google.com ([209.85.208.48]:36862) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1owxw7-0002Bj-Hp; Mon, 21 Nov 2022 03:57:36 +0000 Received: by mail-ed1-f48.google.com with SMTP id v8so3483532edi.3 for ; Sun, 20 Nov 2022 19:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EKh5p0rD+6I+WrX/pxd+hRqzfvHOLuEYsoyA8cVYj6Q=; b=jUXBWmzPz4mj65hrIZuIj2oc7LdpP55ETU0P3i+mjvtKidbMPOaFTJf23dTIAQm5ex WgY1aBLr34RX1EyX6Tn0YuzLmDaOKF03r1Fo9orpOr5sJ3nKisiQeQ4oGE4Jvz9BoJNz KoELSC/z5JnZdQ4QqzjtEzUPXEInfrmy4JXcFJciuNeACxRgMcLicYBephZsl2SuM5Ol PVz477wF85pRTivFHfpfov48X0reiYceBIvlyjJYM94OxyF1JyG+2hm/hcyMhe+DUq1l 1hITZJG+IJL1FyYF146+vK7JSFYNLeJPJYJTeSFTLac4YBEFqC4rksL5W2ZpbxInyvPs wHNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EKh5p0rD+6I+WrX/pxd+hRqzfvHOLuEYsoyA8cVYj6Q=; b=2/7rxjW69SOFHoozw2A+r2ky0l9xMmMDOh+7bQpp/PAekbErYDtu4zPga2e969Hen0 VQpU1PyTz8S4oZ3CebFnxIRKVIVcsijs5772Km3o9eVrBtBP1j8uYBqVWhGkRHwTX143 umlJyFS8cRoeN0yPzxP3YY95ezPpKfoXnxeLD8YpxE0u83llb9csIKijSnqItP8NpYCq AWwF4pLb2nzECywGxKkvsmBsjXC90E2IYJiSIJ5Ft10rTBcIhZoeS8wZiSaQ50hWnpfu wvj1fOIG29ePhVDTqu3N2Td6phWE02NHpK3GpUBGdKfq5zwfrOqClWmfs5GC46SzTleH lp6A== X-Gm-Message-State: ANoB5plQWLHTJnLQrM/sg+lCrsv445bopWr+LePbpcQ3lPovLdEcGK6r qpMF4ou4qFcWocWFR1bNv1hwOzp9sz5EzRR0MtU1uw== X-Google-Smtp-Source: AA0mqf7Rf9twrQbgUsxocfB1LAqw0Y8Zi3IefbM0zm1/UGUPtQPO4VQs773W/YkFblvWncapp3W813ASZXpS2j5N96A= X-Received: by 2002:a05:6402:1013:b0:463:f3a:32ce with SMTP id c19-20020a056402101300b004630f3a32cemr1646366edu.366.1669003054831; Sun, 20 Nov 2022 19:57:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 20 Nov 2022 19:57:23 -0800 Message-ID: Subject: Re: Path with spaces in _canonical_paths To: thomas@coldfix.de Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 51009 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 Fri, Nov 18, 2022 at 9:42 AM wrote: > > I'm trying to use `_canonical_paths` (on zsh 5.9) to let the user autocomplete > a fixed list of files. I hope I'm not using it incorrectly. Tangentially to -workers: Is _canonical_paths documented in the wrong manual section? It's lumped in with functions that are expected to appear in the "completer" zstyle, which clearly it is not. > compdef '_canonical_paths -N files files /tmp/My\ File' cmd > cmd > > Shows the following completions: > > /tmp/My File (appears twice) > /tmp/My\ File > > i.e. I get in total 3 entries for the same path I'm not able to reproduce this using nothing but compinit plus the compdef above. I get just one completion, "/tmp/My\ File", regardless of whether that file exists or not. Try this: debug_canonical_paths () { _canonical_paths -N files files /tmp/My\ File } compdef '_complete_debug debug_canonical_paths' cmd Pressing TAB then drops a file in /tmp with a debug trace of the execution of _canonical_paths. In particular look at which "zstyle" lookups are being done and which of those might be causing the extra entries. You can also look at the context around elements being added to the "matches" array.