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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21758 invoked from network); 10 Nov 2021 22:00:55 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Nov 2021 22:00:55 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636581655; b=hjuw1MoGmr+jl1ZIrqqv1583G3YAr23FMjlTKIR1hcHJVfeqwTSsE3ofhnoaLxP9shASbu5OmH vLJdTUQse5kIMO2/EmLES+kGzbyJpr4Oho4pUEe12t2vmUnSmzvW+sNRHgcT5fS4bJz9EBYyka 15ltN+nKjax143Z0r6l0hGUQgjW4G9JrkTLuPBRZkAs28BNdhixmf/PnzOIkVFyAhxl82tBydJ zxOyPzrHef5xBcn4J7LhG1YsFocXdb9tschtRwONQLdUeEnN9fmBl5EFvcUwnnCs691hp3rS6+ z1t+Njd8NonK3TjjMOsmSv/nSE1cfDnNGLsmA9sCeLqPfQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vk1-f179.google.com) smtp.remote-ip=209.85.221.179; dkim=pass header.d=gmail.com header.s=20210112 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=1636581655; bh=UN5kzpeXhJa6gHuRsbnrD3q5kAo9vxH4S/5zK0fP3zQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=HpoudyBLjrzxMrEumlwoDgjxuS6NFH83NVm/9wnUcQIOLD8zzu1OxJmkNSXqVuO/GNVuu7GsjQ 0O+TquJ19yjq/3lvZ/82BfWAzad9QyOhQUdDo/uAuJbhpZiqT2uzT+XI+u7U6gNBwhky6xzA1L MTcGt+2Bn/4pZoU91TRoxKKMm1WfBGAF8V00B4yMu7v4hlFtULwTTtCqJKhlLdXwZRW0TcesHU F2sxxmfN0/9G8av5nnpwzay/fF9wZyhF7HXPsWlxCzPcg7JzNicQs7EiQXwxBUJQ5+I+1ITjqZ NrI80vh+D22tnSzwXRNZHGhXIv5/n4syZeRGsW7wf4n+SQ==; 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:To:Subject:Message-ID: Date:From:MIME-Version: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=UN5kzpeXhJa6gHuRsbnrD3q5kAo9vxH4S/5zK0fP3zQ=; b=OyBVV2UjNfhuKz+VW9J/ZRR8R8 sCcncnyHmBBSoVp46tU13HeXXWalDgG3aZUVhGeG7ssi1UX7b3PXL7OwUkOLFEHlcmUr7wMkIQiI6 NhrqO1l3Waqt7w9ivht8hghm+QBFTaSnoTWAPJqDQxoNUvH09x6EvpTK6E8UWCbnckppuP5UpbreD i/rz4PuDj34DmKvZRGKQsvvVkKrI0s/wC4nrEr8D+gTEYydP3FeLGJAqsvR6JcZFNZ9FYL7rDH1F5 QBk2ntPsfufkmh0n48h/X0vhRIMBU1fkD6KF/F5nfKFHQqdxUuXiN5TBH5rNsn3/aYQo57cM3yGOD ar8tCuGg==; Received: from authenticated user by zero.zsh.org with local id 1mkveH-000Jd3-4D; Wed, 10 Nov 2021 22:00:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vk1-f179.google.com) smtp.remote-ip=209.85.221.179; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vk1-f179.google.com ([209.85.221.179]:33584) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mkvdd-000JM9-CQ; Wed, 10 Nov 2021 22:00:13 +0000 Received: by mail-vk1-f179.google.com with SMTP id d130so2220347vke.0 for ; Wed, 10 Nov 2021 14:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=UN5kzpeXhJa6gHuRsbnrD3q5kAo9vxH4S/5zK0fP3zQ=; b=J7VkoqpcvjHekxM/dzr185Fp7N7FYeaYB4xUilj/63iiovbqexITali9vqE0yW0n+0 6AwL9ZGSAlYogqJGdHHZqfqkvZdK5e6SSOS474WFwQDvgnkTu5MU2z0har7LVTmhTMcX xdFn4xtiJAhuLlSxxd330mbXVFioBGetQAFFRohAMVruGmrIz4oGUCXbrI3XoXr94Cvr biRsIPQOhUr09WPUoL+ljURqR9eQM80MzU508J/2rxPsh+S/oheTgnRqWpHGX8I4ipfS n1Lq8X1eUQYal8UjEu2ezn1Z3Y/wFwEOiqgAgWiWym5bBkjYA5tnYTwCmst7zm21rHov HFaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=UN5kzpeXhJa6gHuRsbnrD3q5kAo9vxH4S/5zK0fP3zQ=; b=Na4MOemfN++iTmmn/+QyGOIMW3LsH2dGsW/KOCWb3Gw4jQIfG+i0jyRPZ4SYfgQ+DV UYsvV9QpCqn1Ixjjud+a6UR/AiI/HfY4qJzD7LWECMt5Vq8ESoPxFmsG41lLQo/TCton sr/0gIzCor2pYKi2KqvFrspYDZ38gpo2rDtFMIInJ22MlXKUMSc++sMuldgOWg+HMvh+ 2WGUh+9SKG2hZVj5zTlmz8BSqaTaWm1HgQ/L+JIrdFYZKhzDLvVZNzcnK3yKZONjQW/x MHVnqJhQKpTPtTytDpsylX9ltHdDw3Bz8cL9R8j6ytIFSuafa2y8pHriTn9IbrFu8XBv ZxQg== X-Gm-Message-State: AOAM532Gw7fvxiX97ixLy6/iWP6YMU5XrkzLUxM81M5dIhsO94Qi9tvN sQSY4oX2cH7B7ADYX/Xe0iU9mGo8qMESo50/X0pQOgcd75w= X-Google-Smtp-Source: ABdhPJyzX5Xrparcb8/vVeKIZNUSB8Iz2aMBOG9xQrUDy5pxM0OQNroASJCULQIBQJakdZMOyw8zprW2/Dolvgt9ghs= X-Received: by 2002:a1f:b64e:: with SMTP id g75mr2722672vkf.13.1636581611514; Wed, 10 Nov 2021 14:00:11 -0800 (PST) MIME-Version: 1.0 From: Marlon Richert Date: Wed, 10 Nov 2021 23:59:35 +0200 Message-ID: Subject: [BUG] Any type of file in command position gets misleadingly completed as 'executable file' To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49559 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: % zsh -f % autoload compinit; compinit % zstyle '*' format '%d' % zstyle '*' group-name '' % mkdir foo % foo^D executable file foo/ % touch bar % bar^D executable file bar The problem is in _files and it is two-fold: * _files always adds '*:all-files', which ignores the pattern passed with the -g flag. * Even though _files passes its file pattern tags to _next_label, if _files was passed a tag and/or description, it _always_ prefers these over the ones returned by _next_label's call to _description. I propose fixing this as follows: * _files should not add '*:all-files'. Why would anyone want _non-matching_ files to be listed? * The 'globbed-files' tag should be renamed to just 'files' and have a default description of 'file'. (As an aside, the docs speak of an 'other-files' tag used when zstyle list-directories-first is set, but this is never actually offered. Let's remove that, too.) * If _files was passed a tag and/or a description, then these should replace the 'files' tag (formerly 'globbed-files') and its description, respectively -- but not the 'directories' tag and/or its description -- and these should be passed to _next_label. * For each tag and description that _files passes to _next_label, it should always prefer the resulting "$expl[@]" over "$opts[@]" when calling _path_files. This way: * Directories will always be listed as directories, unless overridden through the zstyles supported by _description. * Any tag and/or description passed to _files will be used to override only the 'files' tag and its description, and these will be passed to _description. * Non-matching files will not be listed.