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.0 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 7B41C2396A for ; Wed, 24 Jan 2024 20:39:09 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1706125149; b=KFbiVhMtj86O8p2o+RVto3ai5Npq//3ovHE3m/ZaNSXKOjnsCurZxTXDyuJ41CTHuzX9spMjoo TRADmkMq8RQ0QvDa74mdq35jk0HeCg5pLLbAYmbm3DWSf2gyCGL7pCbROteWXSL3VraQ0eU+tZ z3GMqn8CcCJlpJbyBjvf4Wrz3E5CrUVG9mXBINjMqak8bE3kE8r+MTXvNKHAWg/RFl5GV4Msh4 IJTyEsxMrtDUPswGE4lH3vvXM6YQPgVzGeYREbpMOZP7IcELgNEd+s9FKMZIs9ABQz06Au/86b NlsNXfV+8pb8I9/WTiyxoRW2Zl9kdLgduST+y5GLr08e9Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f47.google.com) smtp.remote-ip=209.85.208.47; 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=1706125149; bh=7wpPRICXJeQOhmZ6AQHQydX+LbDCmV4Q4+Nubp2SQlU=; 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:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=PnvRAGOJavSxkQIiwajOJ74pGSArI8qzYPH63kgKMueUinmxvWYJOcztulGPtaAYGhKgqpl9eR VUzH5tdKaBAvBCKOZLx3YXbLK2K9HwjT24LXABrqvqrCnxhXNau/1kOBFXp9QeOJ3VSE+PiA2n WOn3ToFwSmSMHs+WrLcubMR3CPuZFypbtNXFQhcyvrjKm1liEM3oKz9Jbbp6DWumRrm9lrDsOK 72Z33x91Ro1RCIOkBNdy5sgkubHD/G1usE1lwAIh6oK/8bW+7ifUPXynRBcAu8l6OKLsMKgsKL DCdhYjmvvAAdVJ5vTV2XYCYrcMo6INmbP1jJkONOhHDzcA==; 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:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=7wpPRICXJeQOhmZ6AQHQydX+LbDCmV4Q4+Nubp2SQlU=; b=Od56qLIG7pB8HahNlHfe8A/MpJ OYQiXuMeC1YvAny1si5uNfZDZV1eeBL+s7/xEvOYdeEQ0K1PkLrb8N+8xnfSJE4M2d9/X/fdXdWCU zh2iLjk0m5WV51QZuC4+wPLsTLPn1aAAHVPiuC2tc5y2C04MbcXUdOPS/XuwJkyVAnDAEG1aFufUP 7fsnqkQAKoiXqcoy9tLvZ8cl46IU9ZldbOFdYIWDFw+6SMAgE7dAsWAalU1T7StWYhhsG6zlbSuni qheEca+gwqBXDZSL8dbfR+xpCCibUI7Eu3B3YwzjLZTp8Loc19gAHX5Ukw5C/ydmQRCevJDDheoDe nCpzw0/g==; Received: by zero.zsh.org with local id 1rSj5Z-0001lK-9Q; Wed, 24 Jan 2024 19:39:09 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f47.google.com) smtp.remote-ip=209.85.208.47; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f47.google.com ([209.85.208.47]:50194) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rSj29-0000kP-Hj; Wed, 24 Jan 2024 19:35:38 +0000 Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-55a8fb31fc2so5464524a12.0 for ; Wed, 24 Jan 2024 11:35:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706124937; x=1706729737; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7wpPRICXJeQOhmZ6AQHQydX+LbDCmV4Q4+Nubp2SQlU=; b=ICFDNHexqITy5y9eAUQr2z6dcLFQmCb0lrqnlniTfnXqxFaC/3NEfBjgspFmwebAnI 2Xq3zY/mNwJIQFawZkn3TJli/3I9/fpqxgwk2uBK6UpVswmKlaSKDBhzAyeQoUyFm8Ti o5kDcSiFJFK25L5zs50JJK3QlohxWfNCEdDgjdIg4Xyx9eN0ZeU3+YV7QHGTz79o9Ppi usDQQSNL+deJigymqZRCExNs+dazvO+0diNXVxsz9eWzDp8FcCu3cnsyR2dGxMstxKv3 GE3/DESqnIVlgWEd9TUbCIJs1hxvQ0OW6wUidhVn+s5AyUiSpHQeLnn2sfb20z9xuFAf OV7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706124937; x=1706729737; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7wpPRICXJeQOhmZ6AQHQydX+LbDCmV4Q4+Nubp2SQlU=; b=r5V7BtRsAhmQ41bfDKhx5vJa61mLYgYD7PUxudtFJTv2lZnHLiLG6JBZS7oyMNeS/P CvYPQ+oP42MhtWCGB/lNEQs0kf75VGBkJoNWNxC6SZE/vh3bRadnJZoU9gp5shp6IytO 7ZAnYLyy6xzgUk5VItn8DoMfBQoezJIJwJxxOZzOULYcSvDPmNUEpm7q4AGZdHl2v09s k44HOeuWE/pAgcXU8UeW/l7PlB7QIQelTEh2ShMMH+0379psXvqUYWe//vu1YSGY/dLM L+cLGuepYu01EAd/73naFUrJ0qNx/rt9Yk+EXadcAxsg3zsiQJX7OC8UmJYsjfTj9mQQ yD/w== X-Gm-Message-State: AOJu0Yy5e9+sWHsnh7m9OnZXtq5J4xXVDTP1ehrqP+eOgTAxnX5inrn0 UXKV6sRQ1idMZiJkjGFfLpfSl3xpL6YR3pj12BIodbnMEMlJTaY1MoN4RSUAPRiI2/8DRvzFMpt SuS0dP/8Ena35iMHXHNFRKVLzp7g= X-Google-Smtp-Source: AGHT+IFHP66LTWKl+Im42qhEYcB7tYayCIoZHVsbUZ4s74feTn+mG24cTIT//AFFZ58Nl9+YIvWCYefoD9VA930YPTY= X-Received: by 2002:a05:6402:b05:b0:55a:6a79:c312 with SMTP id bm5-20020a0564020b0500b0055a6a79c312mr2207599edb.11.1706124936697; Wed, 24 Jan 2024 11:35:36 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:7208:429b:b0:7c:8dba:96f8 with HTTP; Wed, 24 Jan 2024 11:35:36 -0800 (PST) In-Reply-To: References: <35F0FA32-34D7-4BF6-978D-EBFC2427ABE8@gmail.com> From: Mikael Magnusson Date: Wed, 24 Jan 2024 20:35:36 +0100 Message-ID: Subject: Re: Why are prompt expansions of %v sequences quoted in bindkey style? To: Marlon Richert Cc: Bart Schaefer , Roman Perepelitsa , Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29557 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: On 1/24/24, Marlon Richert wrote: > On Wed, Jan 24, 2024 at 10:53=E2=80=AFAM Mikael Magnusson > wrote: > >> >> Thinking about this made me realize that namerefs can be quite useful >> here, eg >> typeset -n .prompt.logicaldescription=3D'psvar[3]' >> then you don't have to remember what number you decided to use for >> what (I always forget what I picked). And it makes code using them >> slightly more self descriptive. >> > > Can you give an example of how you would use this in practice? I'm not su= re > I understand. I have a section in my prompt only shows if psvar[9] contains some string: {5935|20:34:22|~}% psvar[9]=3Dhello {5936|20:34:22|~}(hello)% but with the nameref i can do this: {5937|20:34:47|~}% .prompt.currenttask=3Dhi\ there {5938|20:34:47|~}(hi there)% which is easier (with tabcompletion). It also makes the code that sets .prompt.gitbranch a bit clearer. --=20 Mikael Magnusson