From: Steve Dondley <s@dondley.com>
To: "Lawrence Velázquez" <larryv@zsh.org>
Cc: zsh-users@zsh.org
Subject: Re: Is there any possible way to automatically escape characters when executing an alias in zsh?
Date: Sat, 11 Sep 2021 19:15:05 -0400 [thread overview]
Message-ID: <de07d596ee7174b28dd6757979b44917@dondley.com> (raw)
In-Reply-To: <88e7249e-09d7-4fc2-8b7f-d9e00c86f44f@www.fastmail.com>
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.
next prev parent reply other threads:[~2021-09-11 23:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-11 18:41 Steve Dondley
2021-09-11 19:00 ` zzapper
2021-09-11 19:16 ` Peter Stephenson
2021-09-11 19:28 ` Peter Stephenson
2021-09-11 20:45 ` Steve Dondley
2021-09-11 20:53 ` Peter Stephenson
2021-09-11 21:01 ` Steve Dondley
2021-09-11 22:39 ` Lawrence Velázquez
2021-09-11 23:15 ` Steve Dondley [this message]
2021-09-12 0:23 ` Bart Schaefer
2021-09-12 1:27 ` Steve Dondley
2021-09-12 2:26 ` Bart Schaefer
2021-09-12 3:02 ` Steve Dondley
2021-09-11 23:17 ` Bart Schaefer
2021-09-11 23:33 ` Steve Dondley
2021-09-12 3:33 ` Ray Andrews
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de07d596ee7174b28dd6757979b44917@dondley.com \
--to=s@dondley.com \
--cc=larryv@zsh.org \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).