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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4096 invoked from network); 11 Sep 2021 23:15:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Sep 2021 23:15:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1631402153; b=fuyMwc4bx0NpIT6qsO6FzRvNsdSa15b7HQPvLGThltI51zhjviiHuxTLJb0Tu1bp6j3JitF0yl rzOW2WoFLQD8/AOPrVPQPqqjMObUqZSqQ1sy+dopsEoqCmaRQ0pE/MeqmwGfpRWVzZTuNsJAGU n7hkZStH8I2p9w5Icmrzcb9mp9i1KkeHENNj2WXCMXIZIlAht4zYcVn+N4EVfPtVmRPL2qC4Xe UEK023g9g6nAqVPzTXR5nBPe6S9V9IOjg7Ou/fEliuqpYVAgSnAN8tFcDkp5DIbaafMB++qbxS 3u3IdmCuaP05QB/Z6gSJne+AEeSio9jdGgN0DCkLLbaYpA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (email.dondley.com) smtp.remote-ip=34.203.132.18; dkim=pass header.d=dondley.com header.s=default header.a=rsa-sha256; dmarc=pass header.from=dondley.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1631402153; bh=8CPNlDoIO1aqPOKCzlkj0ggXn0d+0a+3lsm4tMyuTdo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:DKIM-Signature: DKIM-Signature; b=TR2Aff4QubsKsS2eD3kn4CVM+9vZ4AtrSU4LlHXQ7UUWCe0QGNbV1g+S0n0vboGplqakBO6s5Q lRGuTFtqg5mqt0m4mzUSUew+qdJZ3xblTrOlL29tQhqI0Qu+4W36QfXnaltjAoTs9jdcF0shgu OYw4VPQ0Fobdl8BfQjtPkoFJuXIY2O7LOclfP/PvXQeWDlDA/6e8J3HHCqCX+ZE73AweGOwGtW jt8ftgVyYApuG691G71ZJf2LCcaqNwBgPsn7/4gIE82vsjIdbYbta/eP/wpPqUVl2zWlbUGiQG /Edy0m2JOraB+2TAGbNwB7AdtPrhZ942PeNJxh4yiiirww==; 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:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=QSrBmkHrdk8fpmaaruwAxQ92q4Mc60epz3+dGE1R0dA=; b=iwtpJADRn3F3WOAsuV3G9XC15H 8b0NVHYbjJgkfx8pN93+39hvx1SGuxT0JpxFZxNDYhLWCQq+yenNUz1fuecq8Uzw69wvAAuQQWE3k OhFSBaJyF1lObSWSCgVJaY6XzFr8sL1Tw5mOQJ+y6a3nYtBQIWqmb/OuJL+x/R++Ykstrc3A4zpOE KZlU+RiquLz3eMg5KU59H5f77JKeoallQm+vx13CN7D5v7oHytp4DDavJM8uWGxVACXrgG1OFJqV1 0tfxL9HTN+5mlePeMrTl97s19JWSF6ZT9QSCHLE3H83PsmEMf9wOtCub10GIXGYumFNthoyDybfYY gZEDDytw==; Received: from authenticated user by zero.zsh.org with local id 1mPCDw-0005bW-Ke; Sat, 11 Sep 2021 23:15:52 +0000 Authentication-Results: zsh.org; iprev=pass (email.dondley.com) smtp.remote-ip=34.203.132.18; dkim=pass header.d=dondley.com header.s=default header.a=rsa-sha256; dmarc=pass header.from=dondley.com; arc=none Received: from email.dondley.com ([34.203.132.18]:59168) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mPCDF-0004tX-UA; Sat, 11 Sep 2021 23:15:11 +0000 Received: from email.dondley.com (email.dondley.com [34.203.132.18]) by email.dondley.com (Postfix) with ESMTPSA id 5514C208F6; Sat, 11 Sep 2021 19:15:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dondley.com; s=default; t=1631402108; bh=8CPNlDoIO1aqPOKCzlkj0ggXn0d+0a+3lsm4tMyuTdo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YMklcEAil+grYlOYGdr0s33g6KC86uLlxrDptiX41MWbM3SL1u6TVbvry3JLjB/SB cbpnIEH2Ziu4MGnwCIb+bj3j6Zr2XUaLBlMeZWjToqKvkWzW14CNA4165HDp/RRhuW y6IJA9RxrIzzAXqxG2lRwOp//cTjLV3VUYJpQAmSFEPIi6rieFR12GSA83hsSNhUuK 4cW9I/CP9op4GAnIP54Jz31Kenid+90X8gEkHgeC/vtaLSnGNXNl6K4AVLnybiUL4u NkDD2zbNWVXZUvZnJ4ulatEL/47YKsJGJ8eIY+ReADXpQ0gbM4rq6/QGSCn4JWzRjs 4pUtXeOMrop5g== MIME-Version: 1.0 Date: Sat, 11 Sep 2021 19:15:05 -0400 From: Steve Dondley To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: zsh-users@zsh.org Subject: Re: Is there any possible way to automatically escape characters when executing an alias in zsh? In-Reply-To: <88e7249e-09d7-4fc2-8b7f-d9e00c86f44f@www.fastmail.com> References: <8432871497e50ae7a6136a9e03a09ad6@dondley.com> <4df9fd0786c03076984bfd7d5cccc34c6780f519.camel@ntlworld.com> <01fed731885d32a336c7b0f31c8f4156@dondley.com> <88e7249e-09d7-4fc2-8b7f-d9e00c86f44f@www.fastmail.com> User-Agent: Dondley Message-ID: X-Sender: s@dondley.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Seq: 27111 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 2021-09-11 06:39 PM, Lawrence Velázquez wrote: > On Sat, Sep 11, 2021, at 5:01 PM, Steve Dondley wrote: >> >> > "man zshzle" will tell you about special widgets. Basically, they're >> > just user defined commands that instead of being called by a keystroke >> > are called at particular points during editing. >> > >> > The test is just an ordinary zsh pattern, as used for globbing / file >> > matching, so it's easy to extend... >> > >> > if [[ $BUFFER = (tasn|taxx|tmxx)' '* && $BUFFER != *\\* ]]; then >> >> Nice. Yeah, this annoyance has been bugging me for years. I'll share >> this out to the TW community, I'm sure others will love this, too. > > This is fun and all, but it's not clear to me why this is desirable > over, say: > > % tasn "call Tom's friend" The technical answer is two-fold: 1) I may not know ahead of time if I double quotes are needed and would rather not have to go back and insert if I forget them. 2) I could address this by always putting in double quotes. But that's four keystrokes I'd rather not have to type if I don't have to. And actually, it's more like thousands upon thousand of keystrokes over a few years time. A 1/2 second here and there eventually adds up to hours typing a key I don't have. Why would I want to do that? The non-technical answer is that computers should accommodate us, not vice versa. I shouldn't have to be knowledgeable about my shell to interact with an application. A good application should be accessible to non-technical users who may have no idea why they need to type in a slash into a sentence meant for humans to input and read. So I can now introduce this program to my wife who knows nothing of shells and I don't have to explain to her "always surround the tasks with double quotes but if you want to use a double quote in between those quotes you have to escape it with a back slash (no, not that one, the one above the 'return' key). That would be a non-starter.