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,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8831 invoked from network); 1 Jun 2023 18:36:11 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Jun 2023 18:36:11 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1685644572; b=mweO1UnGwbXMOgKIMNEyOar/7GLfsblg4HTD9NhWcNtT+fS+yofnPOc0GteQnUn66tSSl3hLW3 dgg2JyfgXjSX6Y3mRo1zM2A7q+qtKb9DpJhHxCSayyL49PrEmz7muR1BVAx3ngCtoeLo+kFhzL A1kZJIjK8wrtS1J+HyFc2j3EAae9aC0hY3qRFnHQGrKA8sIlV4UpQzT0mUpQEex7nokRG3AdwE WFLQUVe0Qb/fHA34YtBED4giLtfnD+7G95/scQaj/uwcWjtaqvvb7k0PUNJeQ3vnOajZLZDQG0 2kBJx1DX9Wo5+vCr/64H0mUROAvOd2yd+CrFP6lMARFESA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay3-d.mail.gandi.net) smtp.remote-ip=217.70.183.195; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1685644572; bh=Arzp8ye06TP5JQVwVPk9TZIV2cK3lKG8NOvQ7DKy78I=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: DKIM-Signature; b=Nm/Etmtd8VUv89b3ei+3UC2Z+hRcFjk5ECWR0dMdNSnrCmDXV1z1OtreWWyUCz79wk+XhS5sOf MbhV2Q/AvVTwyk/cgkgZlivDpZl7Y9eXOQS0Pfm6MjhGkgLN1nO48JgtDaswczoAGooCjb2w3J Mf9ALgJGhM31voEuWHicyCYUZD4ronziAb0w0XGZbtG4K4FrMfZ7lhpinxvcW7IPjtbSKcyj0D wq5Hjxhn/sgYo5x72ziT+ojEsJNO9dH6+Sqpq/0itbLYnKP0VftXGC0+8uaNo3+eNCb+Keg28M 9cMcoAIMOLPoRs9x7pjC1sbOyBxMN/U2y7rW3DzeNde0qQ==; 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:MIME-Version:Message-ID: Subject:To:From:Date: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=Arzp8ye06TP5JQVwVPk9TZIV2cK3lKG8NOvQ7DKy78I=; b=pWVQgKuvy5vuPHi3dOxJCJrSX/ Lh+qNhufeemJ6vlJzBBd0UGXYtvxP3uQS/d8CxAjH6hOfSUrTxJ8vQrgdwZhhYfnmAKOcIitXNkXN 3YP7mLewCxlBUQ7L2sSI7BdP6ZYptPsJr4S4jWYSPRajMGd4b7P5oNFiie98P0o5SUbNTXmys21QL QKtTOfHhdT7R+337x2xavmlc75HNyMFaYYzywflkukNK+OH8xkrrhgC1ukEeobYEQPIaVPs0KgTPk vRnIQ9ZJguSX8aBdgd8lUMf+vWfauXCHpuifqntbLQ1+8gstnFB4r5beX6wi3lBqj6s9nB8bV79iQ lmMf8dtg==; Received: by zero.zsh.org with local id 1q4n9f-000BoQ-82; Thu, 01 Jun 2023 18:36:11 +0000 Authentication-Results: zsh.org; iprev=pass (relay3-d.mail.gandi.net) smtp.remote-ip=217.70.183.195; dmarc=none header.from=chazelas.org; arc=none Received: from relay3-d.mail.gandi.net ([217.70.183.195]:47199) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1q4n9S-000BVP-41; Thu, 01 Jun 2023 18:35:58 +0000 X-GND-Sasl: stephane@chazelas.org Received: by mail.gandi.net (Postfix) with ESMTPSA id B0DAC60004 for ; Thu, 1 Jun 2023 18:35:57 +0000 (UTC) Date: Thu, 1 Jun 2023 19:35:56 +0100 From: Stephane Chazelas To: Zsh hackers list Subject: histsubstpattern in zmv Message-ID: <20230601183556.nl3zhv2kdxgj7x4d@chazelas.org> Mail-Followup-To: Zsh hackers list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Seq: 51814 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: The csh-style ${var:s/foo/bar} is often more legible and easy to cumulate than the Korn-style equivalent ${var/foo/bar} Compare: ${${(L)var//[[:blank:]]/_}//\/foo[^/]#} with: ${var:l:gs/[[:blank:]]/_:gs|/foo[^/]#|} The csh-style also has :& to repeat. But that needs set -o histsubstpattern and in zmv, emulate -LR zsh resets options. Would it be possibe to enable it in zmv along with extendedglob which is already enabled there, or if not allow the user to enable it, or maybe even better introduced some :+s/pattern/repl/ :-s/string/repl/ or :S/pattern/replacement/ so we can use both at the same time, like ${f:gs/***/3-stars/:gS/???/any-3-chars} ? Thanks, Stephane