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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 0736A22159 for ; Sat, 8 Jun 2024 17:50:27 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1717861827; b=hP9p/uRz5UWu6+g32gCFQ5qNO5cMZo6riisWPkIwHzt7bQQqpQIk81xLa09J0sxsVRLmGn1Qvt yUPygTE9Q/pAPqMquZqE5/+96IRvK+ZVgjRXXQLdo4iRtgXKMbqP3NeLKktvU2KC0nQKcQCyDy 4eSjZ8hHkL3xk7fXF3YQtHpO06znPARk2ucUqSLS39u856JNiKDFtXAEVYA3LTp7Kepd/dKLyW XbQz5Qda20OV+Q+p7xLAQYXhXxjK1Gb8V20UHEWjtwUuxZuRTNnhGYucoTLLiMuhUxwiU9NzwT OnSmMrLA7kWfYy7oD743O+KyeU0cLPoZmc8gheaujmaoUA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1717861827; bh=KzlhSxhO67fPwhBc6sZxGbNmW/IN1R7sH5mI8CURgF4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Zo+ITwauFr3Id9oK/ictf/KyNeXnnlTDCKLQ2oTTSCzDAsgljk4drpJ09S1jPZ9Q2wTACRFPMe 1o4QUQdjknDWKTmuA8oWbtm6FxpE7UuEWMRkE9egyddLjid0PqpLH16jpTvETKprnzr9lz1fYH k33AK64F6ORUq/VCTsO9tRVgwUFjwT8IwVqgx+mvqNxcfxPqy65ZFKbQ4tMzkhP1CGNx3NBoon WeudAS/0ufaG6kjE7b8XTZStaNIpi3QUICuSyRpF1OgD8sW7JpEyRKcQY910wxPRLntoPU3san Ur8b/bFdR3ZaopMC78uToYgNU7KFZ8EIdI0uZJMZ/ADyAQ==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ggIyyXYdyooL6v5bvwEDOIkocxEPk0mxHKWnZMrsoOs=; b=mULj5RShjwif/1lG0OYWtHM4SB 9hM1Y7GOalgbrp6Jqg4nEZypBr+nABK4ZptrjgVG7TD5KoFMPIyj1CR6OAyzPvd8P1QCOeWNzBbtw SFRnuNMDHZmVGgXao76H6NMkkzUt07vUSiGqXRSvw4t4pifw4zmx3qMt5b8i+6pIaTBlyzqJzbVkf ez4DENwOcLq0ZyAaEKfaRa3/hV0pRNj9dbxQsN/fg+UViNTcooW7mE1NoiKMpLehfkjI/4JK0bifV lUDU7FbxfJh6D8ZBmVGMbOiwGcUQf2I6chGNDDWO3cvJ6P+jW7nW3/wtJu/YpWpHITc0l4WUco6NS lTYQsFWg==; Received: by zero.zsh.org with local id 1sFyKo-000DLL-Kn; Sat, 08 Jun 2024 15:50:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ej1-f53.google.com ([209.85.218.53]:51297) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1sFyK0-000Czy-SG; Sat, 08 Jun 2024 15:49:40 +0000 Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a63359aaaa6so462537166b.2 for ; Sat, 08 Jun 2024 08:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717861776; x=1718466576; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ggIyyXYdyooL6v5bvwEDOIkocxEPk0mxHKWnZMrsoOs=; b=cwzDb1E+nYulQCRKPlvrRWY72Q/eiRDQ6NhVNExKJJZy88OkkSZTt2e1fd+Ae1nxNo lkxEaBPmiUAkVFMhUW1Cobw1x5dhT+tGWQ7S0dqTbQlgQ+jULwBrqgw2lX2QfCX8fvBT hqSYtxuEg10CDYmAvH3/ndn/IgQcWuJhXz8SeetVz19Omm2US56sRgCoFiEmovmI/9LO eJmnekCmsWxsJSqG+YOM3Ma5ziVxzyWUf1X0F9mXS/thqkJaTCaQ7GBZuzqZANiK0Sxq EZShSzxsXy/6ULk83HKIR/iRf+DAt9ObqJkY+KZC6YlWHAqnJ3P/v4IHTxqAtSgTzxat xiwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717861776; x=1718466576; h=content-transfer-encoding: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=ggIyyXYdyooL6v5bvwEDOIkocxEPk0mxHKWnZMrsoOs=; b=HeZwYGCPiXWjW8AlI5Z0Yh1XzH9AVjv5qVOyYPi9Mn6GsjlBIhjPPXG9nf4Q98ljgW bsYiGtJv3GG/+LGhlvZJb4va0IVh4DmFxsHBfNnRISkFo6HjOyCAWANPZa8rL9qBOsJ+ b1hE/Snja6k+QQVfxkvK8j1loBFkRMYTrbSDt7M0bbvXie+wrpUcRTZx9hWtTQHOiITb 2GuTYheXCXBFU4z7s3WnuDRCYsgPLDitkXdBpTRcUIACvOcw0Skvrz15A3Uu0iCvYIsO I0Ip5Vi5XPV4cv4iovOlgqlkbZjeJXTbcSccZ17Fi5lI1TKGitj1AbgJ2eB1GCXf0pGv x9ag== X-Gm-Message-State: AOJu0YxR/hnQ3dRm3haFy+9OZVT+vVrNfbwdm/9xTa34kiNsz9Xa7lgp gdgsvm6PKF/IqEx9A3m42HaqBclOKbh0KVRgR5UFEgkXRTPvfvW+HAcRJNtngPSDZHFT+JGjTRv hDgOdAfo0mZTcYmTMf/2QKXLNqQM= X-Google-Smtp-Source: AGHT+IHM6lhoNU+gn+PKgeSi9dJ6VQvMECzWBoG0gMzRM4LsN28HDrA6v+jSKoHEU7PKZSmpm+z3vD2hse3AFA8hzX0= X-Received: by 2002:a17:906:1305:b0:a68:fafb:a16e with SMTP id a640c23a62f3a-a6cd561213fmr359072266b.4.1717861775761; Sat, 08 Jun 2024 08:49:35 -0700 (PDT) MIME-Version: 1.0 References: <20240318151751.1096-1-mikachu@gmail.com> <0392B2D7-E833-4634-B237-76A833E2BEC8@kba.biglobe.ne.jp> In-Reply-To: <0392B2D7-E833-4634-B237-76A833E2BEC8@kba.biglobe.ne.jp> From: Mikael Magnusson Date: Sat, 8 Jun 2024 17:49:22 +0200 Message-ID: Subject: Re: PATCH: Handle completer filenames with funny characters in them To: "Jun. T" Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52947 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 Sat, Jun 8, 2024 at 3:56=E2=80=AFPM Jun. T wrote: > > > > 2024/03/19 0:17=E3=80=81Mikael Magnusson =E3=81=AE= =E3=83=A1=E3=83=BC=E3=83=AB: > > > > For example, a file called _foo;bar will cause this to happen: > > % hello [press tab]zsh: command not found: _foo > > zsh: command not found: bar > > With this patch the following has stopped working: > > % compdef '_files -g "*.h"' foo > % foo > foo (eval):1: command not found: _files -g "*.h" > > > @@ -412,7 +412,7 @@ compdef() { > > svc=3D > > fi > > if [[ -z "$new" || -z "${_comps[$1]}" ]]; then > > - _comps[$cmd]=3D"$func" > > + _comps[$cmd]=3D"${(q)func}" > > [[ -n "$svc" ]] && _services[$cmd]=3D"${1#*\=3D}" > > fi > > I don't know what is the best solution. > Quote only if $func is a single word?, > or quote only the first word of $func? Hmm, I thought I was clever, but not clever enough. I should probably move my quoting to the place that calls compdef with the filename arguments instead of quoting it inside compdef. --=20 Mikael Magnusson