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,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21110 invoked from network); 14 Apr 2021 11:11:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Apr 2021 11:11:13 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1618398673; b=wR0hcxt4+6bgrlNiA9QSNa1Gvq2eudbgp82hU6JuY6Beu0O49YozttRQgNQn92SU2X2VObNfWk +6LoKZeaw7Mi/v6Vn9KKZG7ULSTCDsqeOS8MQjdqVQ/Pk+dfFtaZWplKJeSrCe42tEfYxdWdLn Sim/1Onk/rFgSHuUmCfzb1jubGKOtqOaGLIG3w7/d/8Gz5cCu65JhiAFvY08EGiKSZSXL+sZnn j7XYABEpo4h3lSBXpSwweGCV1xaZqKvVfOwhG9HmoNc56PDFkf3Pq4CA231OH3nV2nfKVUmHf8 HA/4MOpw7vo4NphK7sZIKj2I9XU/ZL8AzsvAKElsFSWucA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (p3plsmtp21-06-2.prod.phx3.secureserver.net) smtp.remote-ip=68.178.252.72; dmarc=none header.from=rayninfo.co.uk; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1618398673; bh=0M+2o3EMzNSUrvvq6SyiMVlhI00IrhHhrPCtgrD21+4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:DKIM-Signature; b=JbRht4DuJmqgzN4fpgUgTB0UkuWnug57BhfAQuE8rSCkvAGlgP/NKhYSrXkggFfn05Lkld/4o1 OPRBnLkK7Li2bKPJEy+o3CcLOqry3wl96ldqSz/p+9gExj2jFIOrY6e86lLCCcbkxN8+emUMf4 X/cTf95Ysf1v1/qN1OxU7u8I43gQRUH6UojZvnne940AfpQNoaEys3dB+K2oaSen59i7DZfhoS Nbx8+Ef/DtvHWZxfplLS8iVeM2v0KfV+7Tnn76zw5niH/OKc7TyVOGBNpN/PPzuFWnsxfX9wTP 03snSNQi1fz8rwkVkrWxle62kPOVnctfE4wFqshaHGF1eQ==; 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-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+gX92/Mkzbcvs+ki4yjT6g/8fQ14hk8MRrQjvT+Xk7Y=; b=Tl3ViveseJ+tEpqhGY/0HCU6PD izEH/2PL0EbGJxoSMhr9SQBLoGHhn5P2CpHlkN01ldkAdrTBfI0qY+yop37RYNkaz2n3PrX3VZSsl EmsAVb7vIkVo5mnVUQaYFS5WTtb7ODvBJAg7FlWlngIbbPn6RyXhoudnztp2+lcGZ/jVrzI0tUPRZ rLQ+SJzDyIj1BDh/e4Mb3fzzCO3VpN9kfQuJo5iqnL4TpzMDw4oYPRIvzyNXw//pINwQFsuin0EKj T6upY4TGy41cWkGelX0ztI7qLJ6uuqf0LMwGuc718LkREF6dGwy57NCDjoJhroIkRG+yy8Dw0P9OG cMGbRZ6Q==; Received: from authenticated user by zero.zsh.org with local id 1lWdQP-000NCr-9W; Wed, 14 Apr 2021 11:11:13 +0000 Authentication-Results: zsh.org; iprev=pass (p3plsmtp21-06-2.prod.phx3.secureserver.net) smtp.remote-ip=68.178.252.72; dmarc=none header.from=rayninfo.co.uk; arc=none Received: from p3plsmtp21-06-2.prod.phx3.secureserver.net ([68.178.252.72]:36187 helo=p3plwbeout21-06.prod.phx3.secureserver.net) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1lWdPV-000MbM-P8; Wed, 14 Apr 2021 11:10:19 +0000 Received: from mailex.mailcore.me ([94.136.40.141]) by :WBEOUT: with ESMTP id WdPSlFmfWcUFUWdPSl6F1L; Wed, 14 Apr 2021 04:10:15 -0700 X-CMAE-Analysis: v=2.4 cv=eYv4w5IH c=1 sm=1 tr=0 ts=6076cd97 a=bheWAUFm1xGnSTQFbH9Kqg==:117 a=xhhAMP4KTkHY/vR9i7Lrow==:17 a=pm1UJGunjWoA:10 a=IkcTkHD0fZMA:10 a=3YhXtTcJ-WEA:10 a=_-08CkN2xbTeAwJq7J0A:9 a=QEXdDO2ut3YA:10 X-SECURESERVER-ACCT: zsh@rayninfo.co.uk X-SID: WdPSlFmfWcUFU Received: from [95.150.51.41] (helo=[192.168.1.231]) by smtp06.mailcore.me with esmtpa (Exim 4.92.3) (envelope-from ) id 1lWdPI-0005DI-Pi for zsh-users@zsh.org; Wed, 14 Apr 2021 12:10:13 +0100 Subject: Re: alias with a parameter To: zsh-users@zsh.org References: <20210407070518.szoet4rxbouwzelm@chazelas.org> <2902540a-9c07-4423-b0bb-6802af6e97a2@www.fastmail.com> <48bef9cb-fea7-1a17-96b1-dd4ae7bf54aa@spamtrap.tnetconsulting.net> <20210409224930.GB6760@tarpaulin.shahaf.local2> <41baeb56-de2f-2fb2-3544-ce703bf96223@rayninfo.co.uk> From: zzapper Message-ID: <6717f359-f340-a436-c2dd-1b9ae19d345a@rayninfo.co.uk> Date: Wed, 14 Apr 2021 12:10:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Mailcore-Auth: 8308408 X-Mailcore-Domain: 840527 X-122-reg-Authenticated: 8308408 X-Originating-IP: 95.150.51.41 X-CMAE-Envelope: MS4xfLhZoJIDvafigIhdoUwsAMIYYO7eon5tRdExdh9579+QYDj0JV0w1tkbT4SnaSDNM4PxHKDgP+zyM0gIMy8jokJ+mLOhlHvCY8KD8NwG43QydYsmStWe Rd6g4eC5OevuK+hom0o6MsbsNohUItqi+BtCt14nk8UlOnjEc1YvZ8ErHg/0t8KMlcw9V6Ngsk3/cA== X-Seq: 26651 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: >> I suspect that the case-esac structure is a neglected control structure. > indeed. and combined to the neglected alternative syntax (man zshmisc) > (probably inspired by rc, as well as the neglected rcquote option), you have: > > pd () case $+1 { (0) popd ;; (*) pushd "$1" ;; } > Am using a case statement as a ***visually elegant way*** of excluding a potentially changing list of Global Aliases from being automatically expanded The following excludes any single Uppercase Letter , any Alias V followed by a number, Any beginning with G function dontExpandGlobalAlias() {   if [ $# -gt 0 ] ; then case $1 in    [A-Z] | V<-> | G* ) ;;  *) echo "Yes expand"   ;; esac   fi } Just wondered if anyone had any input/improvements with or without GOLF