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,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21194 invoked from network); 21 Jan 2021 14:38:23 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Jan 2021 14:38:23 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1611239903; b=O3lBpUVwSX0bV5OLX4JuzQ6kJ5kJ7l7cNOW8VBZWFlVRm87i2aKdtVF6AGO8tlIXiUEswKkHiR wBM2Vf1nysov/A+jFDAqW2U5DbY3TM7I38EznmjDt3SS9szd66mqgBMJQpqDVOlXQkUGp1HkAv 4pWDSfNu5LJPxt7hcZOvIw9E0AoEKLOa959RvVDwdbPO39CYABpSyiaP4gImWW/9wcMp/KwOyb wYV8tPSoT61Sq/744RqRobIIwixVCv9ck2cg7j5FCWwzV0ziUDBOQF02xUZdhVRTe9FTYK0blD D0bzINor8JliQ+JEZBdJh8drdz8Io1ABfQBZGR+gYgVbbA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=gmail.com header.s=20161025 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-20200801; t=1611239903; bh=Tq6973Lbbk57MtvhtEUPb7yRM6f9ScpBwy3FY4+GRbM=; 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=zBHMn3OAKKnPbTjrvAma8vm0N/W3+gOJdYbM6tKadFEdBOx9sSAg9eUPBH7edtJUSJRL7zIEVm BRkVf3pKUjKN8aBa7/464nBnYu29Cq7GiTXqONE+mCdnhRIr5SuDgao0+wxUodNHBNgKqqGHMv Av5kHM5MEum0rVwJLLFZM/86Wg7CMCIsJTHZ+HpBOK6zQiyWa6dylcKy3ZeU5yf3F/lzeNMd33 pzd82kZLStQJUJtNZD8MMJOoLgyrH913HCVMw7Gqxfp6pyny3mvHvDSFfPn/ObBOS0PoVlIfDo ZOd/JXyBwDEMEXmFkUBPuO95rEwTdiFGAC9zYZ5OlznmXw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=VqKxpSne0vuAiB1P1wlbQXqScJBS8MMTubnJ4gZna90=; b=TdVCk3FxU+C1jHfrwyM9XnFTYT ylcNn3IcndTn2EcFVXbGCblK38FztDcla8VCGbyZMBDpxIqSTSQ0Hoe9/7BpdOt5AADQMAKU3ef6E QYp3Oq5hlFTbX89HjU36hqbKjm8sbsQcTFyH5ev3QzaDBHLdtCHV1xJW2/rY2Deoyf27xbiipMji8 VU15R4sMf865TDuX3xPhpdF9KYb0teOnyCV/Y2OP89PVKEozunc2w0VFoLVrDonWypY6maBSJIgPU 2afaL6VSvu14ScObmyr0f/lxwNb1n0G+wXzmewqudQ0SO56atiyCVbGE2Y6WfiYdpfW/iO/P3EDfY g9zxSa0g==; Received: from authenticated user by zero.zsh.org with local id 1l2b6M-0001K1-JN; Thu, 21 Jan 2021 14:38:22 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f48.google.com ([209.85.167.48]:39982) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l2b62-0001Ai-4i; Thu, 21 Jan 2021 14:38:02 +0000 Received: by mail-lf1-f48.google.com with SMTP id v24so2804800lfr.7 for ; Thu, 21 Jan 2021 06:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=VqKxpSne0vuAiB1P1wlbQXqScJBS8MMTubnJ4gZna90=; b=R8I60EvRcfprQNmAHY7jJNZPu+nJFsKXjkXZjYAllO7F2pw99cPFkEsoHmLg2MtMpM DDS8uY01VwAE6TjvvocxijJZXHkD7OZmF9lPcr57DKatr373CDAcWesXdtQRy+uhYUqd aejkG/nlU09OW72JHnPcyyzd05jMwYu/rYbTGCl7C2DECF7VmWvHQSFP6jGLYfT7tmsn oe8SD6NRhD2kJX5ggFHyz7zF7mmSdFVZ2ElOovJZaYhxsgyDqtdnI1QJMUnboDY5GXj7 04uzWq3MuYdpaRnAQwt64tMKgEYMLpvXQjmjkOCqEux1Zyn7fLmkoY1u7nlsUqKytzh6 /LQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VqKxpSne0vuAiB1P1wlbQXqScJBS8MMTubnJ4gZna90=; b=BYbB+/3o+AiI0NRVja/Roh5jFEfN/iR7dsBccjbwTOBJtktzqoZDCESuDZy29vBWmU iZwQzy4rBNPUI8odyTJ/DdOwRlARgO1HiiLiEaaBm1OdtKq5E3C6WdMv3ezTPxF10k1A Wk2UKGng363H+MICUmvVugSISi6CmNb5c5G1bw4xl1BWa2mv5Yg7wdyANDU+8mAk2heg sHDEuQl+/6Lzz5VqJSv86GtZNRLCiRexJ4QKzjrKTxIQk9iRwqBonqsVYLPwXT/sW8LF I6u01uPKxmLcnR/k1XqAzvc2cldW1h8azcAgYyUJvvjRNK3IVp6602wIx91zWxPLFJrG /NiA== X-Gm-Message-State: AOAM532hy+vsJyFLPT4+m90Hyq4EabakfWoZqK2cuvFNwGRelUN23OtH 9FMktoGqimSWVIdrWgu5rwl/DFYAtesR49+APPBqcq0rlyqNCA== X-Google-Smtp-Source: ABdhPJxMcrYNybt7P59OKvLL353TvDSdgSBgYvzlvh3L3lrL8H38UTxy0Rgnp6SXsEpNdDo/BZXnBsyDAKhMP5KnLxQ= X-Received: by 2002:ac2:484b:: with SMTP id 11mr5065759lfy.605.1611239880382; Thu, 21 Jan 2021 06:38:00 -0800 (PST) MIME-Version: 1.0 From: Marlon Richert Date: Thu, 21 Jan 2021 16:37:24 +0200 Message-ID: Subject: Bug report: Completion for dynamically named dirs fails when $SUFFIX is not empty To: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000b7de2405b96a0499" X-Seq: 47858 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: Archived-At: --000000000000b7de2405b96a0499 Content-Type: text/plain; charset="UTF-8" % cd $(mktemp -d) % ZDOTDIR=$PWD HOME=$PWD zsh -f % autoload -Uz compinit % compinit % zsh_directory_name() { [[ $1 == c ]] && compadd -S ']' foo } Given the above setup, when 1. $LBUFFER is `cd ~[` or `cd ~[fo`, 2. $RBUFFER is empty, and 3. I press ^I, 4. then $LBUFFER becomes `cd ~[foo]`. 1. $LBUFFER is `cd ~[`, 2. $RBUFFER is `fo` or `]`, and 3. I press ^I, 4. then completion beeps and the buffer remains unchanged. `functions -t _complete` shows that the problem is caused by $compstate[context] becoming `tilde` instead of `subscript` as soon as $SUFFIX is non-empty, which causes _complete() to not call _subscript(), which is the only point of entry to _dynamic_directory_name(). --000000000000b7de2405b96a0499 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
% cd $(mktemp -d)
% ZDOTDIR=3D= $PWD HOME=3D$PWD zsh -f
% autoload -Uz = compinit
% compinit
<= div>%=C2=A0zsh_directory_name() { [[ $1 =3D=3D c ]= ] && compadd -S ']' foo }

<= font face=3D"arial, sans-serif">Given the above setup, when

  1. $LBUFFER is=C2=A0<= font face=3D"monospace">`cd ~[` or=C2=A0`cd= ~[fo`,=C2=A0
  2. $RBUFFER=C2=A0is= empty, and=C2=A0
  3. I press <= /font>^I,<= /font>
  4. then=C2=A0$LBUFFER becomes `cd ~[foo]`= .
    1. $LBUFFER is=C2=A0= `cd ~[`,=C2=A0<= /font>
    2. $RBUFFER=C2=A0is `fo` or `]`, and=C2=A0
    3. I press ^I,
    4. then completion beeps and the b= uffer remains unchanged.

    `function= s -t _complete` shows that the prob= lem is caused by $compstate[context]= becoming = `tilde` instead of `subscript` as soon= as $SUFFIX is non-empty, which causes _comple= te() to not call=C2=A0_subscript(), wh= ich is the only point of entry to _dynamic_= directory_name().
    =

          --000000000000b7de2405b96a0499--