From: Tomi Ollila <tomi.ollila@iki.fi>
To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] cli: add a tool for starting new message in the emacs ui
Date: Thu, 20 Mar 2014 12:31:24 +0200 [thread overview]
Message-ID: <m2bnx1duv7.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <877g7pn9bs.fsf@nikula.org>
On Wed, Mar 19 2014, Jani Nikula <jani@nikula.org> wrote:
> On Wed, 19 Mar 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:
>> On Wed, Mar 19 2014, Jani Nikula <jani@nikula.org> wrote:
>>
>>> +
>>> +# Positional parameters.
>>> +while [ $# -gt 0 ]; do
>>> + ELISP="${ELISP} (message-goto-to) (insert \"${1}, \")"
>>> + shift
>>> +done
>>
>> for arg; do
>
> for arg in $@; ?
Yes, that is less obfuscated version of that, whichever you feel more
comfortable with... for more discussion about the alternatives here see:
http://www.in-ulm.de/~mascheck/various/bourne_args/
(but don't look that -- it is unnecessary and only causes headache ;D)
>> maybe arg=${arg//\\/\\\\}; arg=${arg//"/\\"};
>>
>> ${parameter/pattern/string} -- Pattern substition in bash manual.
>
> I'm inclined to go with "don't do that then" ;)
$ bash -c 'arg=${0//\\/\\\\}; echo ${arg//\"/\\\"}' 'this"is\a test'
this\"is\\a test
$ zsh -c 'arg=${0//\\/\\\\}; echo ${arg//\"/\\\"}' 'this"is\a test'
this\"is\a test
$ ksh -c 'arg=${0//\\/\\\\}; echo ${arg//\"/\\\"}' 'this"is\a test'
this\"is\\a test
Interestigly zsh on Scientific Linux 6.2 fails here (zsh 4.3.10) -- I tried
various tricks and none helped. Hmm also zsh 4.3.17 on Ubuntu 12.04 fails.
zsh 5.0.2 on Fedora 20 works OK. ksh & bash installed on all these 3
systems work OK (and also bash 3.2.51... on Mac OS X).
IMO this quoting should be done -- so I can send you email with:
$ notmuch-emacs-mua '"Jani Nikula" <jani@nikula.org>'
Tomi
next prev parent reply other threads:[~2014-03-20 10:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-19 19:25 [PATCH] cli: add a tool for starting new message in the emacs ui Jani Nikula
2014-03-19 21:24 ` Tomi Ollila
2014-03-19 21:54 ` Jani Nikula
2014-03-20 10:31 ` Tomi Ollila [this message]
2014-04-06 15:43 ` [PATCH v2] " Jani Nikula
2014-04-07 3:59 ` Jameson Graef Rollins
2014-07-01 20:02 ` [PATCH] " David Bremner
2014-07-04 17:36 ` Tomi Ollila
2015-01-18 16:21 ` David Bremner
2015-01-18 21:07 ` Tomi Ollila
2015-01-19 16:32 ` Tomi Ollila
2015-01-20 17:53 ` [DRAFT PATCH v2] modified notmuch-emacs-mua v2 Tomi Ollila
2015-01-20 18:58 ` David Bremner
2015-01-21 9:38 ` Tomi Ollila
2015-01-21 16:50 ` David Bremner
2015-02-22 20:34 ` [PATCH] cli: add a tool for starting new message in the emacs ui David Bremner
2015-03-06 7:06 ` David Bremner
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2bnx1duv7.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=jani@nikula.org \
--cc=notmuch@notmuchmail.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://yhetil.org/notmuch.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).