From: Eli Zaretskii <eliz@gnu.org>
To: Dave Abrahams <dave@boostpro.com>
Cc: 7563-done@debbugs.gnu.org, 1212-done@debbugs.gnu.org
Subject: bug#7563: 23.2; `split-string-and-unquote' mis-documented / purpose unclear
Date: Sat, 11 Dec 2010 11:50:35 +0200 [thread overview]
Message-ID: <83fwu4vdsk.fsf@gnu.org> (raw)
In-Reply-To: <m27hfn52q7.wl%dave@boostpro.com>
> Date: Sun, 05 Dec 2010 16:28:16 -0500
> From: Dave Abrahams <dave@boostpro.com>
> Cc:
>
> This function performs two types of quoting: enclosing a whole
> string in double quotes `"..."', and quoting individual characters
> with a backslash escape `\'. The latter is also used in Lisp
> strings, so this function can handle those as well.
>
>
> First problem: the last paragraph above is simply wrong.
> split-string-and-unquote doesn't perform any type of quoting; it
> un-quotes.
I changed "performs" to "supports". Thanks for catching this.
> Second problem: the doc implies that a string that could be executed
> by the shell could be split into its constituent arguments by
> split-string-and-unquote, but in general, it cannot, e.g.:
>
> (split-string-and-unquote "'foo bar'") => ("'foo" "bar'")
> (split-string-and-unquote "foo\\ bar") => ("foo" "bar")
>
> I'm not sure what this function is really supposed to be for, but any
> implication that it properly handles conversion into shell arguments
> is highly misleading. Some motivation should be given for proper use
> of split-string-and-unquote, or it should be deprecated.
This has come up before; see Bug #1212 and this thread:
http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00431.html
The best explanation I can give you is that this function is for
taking minibuffer input and converting it to a list of string
arguments as required by call-process and start-process. (I added
this information to the manual.) Note that the documentation does not
mention "shell" anywhere. You could also gain some insight by looking
at the users of this function.
With those changes, I'm closing this bug report (and 1212 as well),
because the issue has been already beaten to death in the above
discussion.
The changes I made are on the emacs-23 branch, btw, in case you want
to eyeball them.
next prev parent reply other threads:[~2010-12-11 9:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-05 21:28 bug#7563: 23.2; `split-string-and-unquote' mis-documented / purpose unclear Dave Abrahams
2010-12-05 21:38 ` bug#7563: related bug Dave Abrahams
2010-12-06 0:37 ` bug#7563: one more detail Dave Abrahams
2010-12-11 9:51 ` Eli Zaretskii
2010-12-11 9:50 ` Eli Zaretskii [this message]
[not found] ` <m2fwu477ch.wl%dave@boostpro.com>
[not found] ` <834oakux25.fsf@gnu.org>
[not found] ` <524EC395-B36D-4678-AF93-43C24C9E9745@boostpro.com>
2010-12-11 18:50 ` bug#7563: 23.2; `split-string-and-unquote' mis-documented / purpose unclear Eli Zaretskii
2010-12-11 19:41 ` Dave Abrahams
2010-12-11 20:42 ` Eli Zaretskii
2010-12-11 22:27 ` Dave Abrahams
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=83fwu4vdsk.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=1212-done@debbugs.gnu.org \
--cc=7563-done@debbugs.gnu.org \
--cc=dave@boostpro.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.