* bug#1212: 23.0.60; split-string-and-unquote problems
@ 2008-10-20 16:04 Eli Zaretskii
2008-10-20 17:01 ` Andreas Schwab
2008-10-20 17:08 ` Andreas Schwab
0 siblings, 2 replies; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-20 16:04 UTC (permalink / raw
To: emacs-pretest-bug
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.
Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
The function split-string-and-unquote is a great help in taking apart
shell command lines, but the values it returns seem incorrect in some
situations, at least from shell command quoting perspective:
(split-string-and-unquote "foo\ bar")
=> ("foobar") [where's my blank?]
(split-string-and-unquote "foo\\\ bar")
=> ("foo\\bar") [where's my blank?]
(split-string-and-unquote "foo\" \"bar")
=> ("foo" " " "bar") [where's my blank]
(split-string-and-unquote "foo\"*\"bar")
=> ("foo" "*" "bar") [can't quote in the middle of a string?]
(split-string-and-unquote "foo\\\"bar")
=> End of file during parsing [how do you quote a quote?]
Also, it doesn't support '..' quoting, which is quite frequent in
shell commands.
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
d:/gnu/emacs/etc/DEBUG for instructions.
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-10-20 on HOME-C4E4A596F7
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: ENU
value of $XMODIFIERS: nil
locale-coding-system: cp1255
default-enable-multibyte-characters: t
Major mode: Lisp Interaction
Minor modes in effect:
show-paren-mode: t
tooltip-mode: t
tool-bar-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
global-auto-composition-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<down> <down> <down> <down> <down> <down> C-SPC <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> M-w C-x b <return> C-y <return> M-:
<up> <C-right> <C-right> <C-right> <C-right> <right>
<right> <right> <right> <right> <right> <right> <delete>
* <return> M-: <up> C-SPC C-e M-w <return> C-y SPC
= > SPC C-x b <return> <down> <down> C-a C-SPC <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> M-w C-x b <return> C-y <return> M-:
<up> <up> <up> <up> <down> <up> <up> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <delete> <delete> <delete>
<delete> <delete> <delete> <delete> <delete> <delete>
<delete> <delete> <delete> <delete> <delete> <delete>
<delete> <delete> <delete> <delete> <delete> <delete>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <delete> <delete> <delete>
<delete> <delete> <delete> <delete> <delete> <delete>
<delete> <delete> <delete> <delete> <delete> <right>
<right> C-SPC C-a M-w <return> C-y SPC = > SPC <down>
<down> <down> <up> C-a M-: <up> <return> <C-right>
<C-right> <C-right> <C-right> <C-right> <C-left> C-SPC
<up> <down> C-e M-w <up> <left> C-y <right> M-: <up>
<up> <up> <up> <C-right> <C-right> <C-right> <C-right>
<C-right> \ <return> M-: <up> <C-right> <C-right> <C-right>
<C-right> <C-right> \ <return> M-: <up> C-SPC C-e M-w
<return> <up> <up> <up> <left> <return> C-y SPC = >
SPC C-x b <return> <down> <down> <down> <down> <down>
<down> <down> <left> <left> <left> <left> <left> <left>
<left> <left> <left> <left> <left> <left> <left> <left>
<left> <left> <left> C-SPC <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> M-w C-x b <return> C-y C-x <up> <down>
<up> M-x r e p o r t - e m a <tab> <return>
Recent messages:
("foo" "*" "bar") [2 times]
Mark set [3 times]
split-string-and-unquote: End of file during parsing
Mark set
split-string-and-unquote: End of file during parsing
Mark set [2 times]
("foo\\" "bar")
("foo\\bar") [2 times]
Mark set [3 times]
Scanning for dabbrevs...100%
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 16:04 bug#1212: 23.0.60; split-string-and-unquote problems Eli Zaretskii
@ 2008-10-20 17:01 ` Andreas Schwab
2008-10-20 19:06 ` Eli Zaretskii
2008-10-20 17:08 ` Andreas Schwab
1 sibling, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-20 17:01 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
> (split-string-and-unquote "foo\ bar")
> => ("foobar") [where's my blank?]
(elisp)Syntax for Strings.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 16:04 bug#1212: 23.0.60; split-string-and-unquote problems Eli Zaretskii
2008-10-20 17:01 ` Andreas Schwab
@ 2008-10-20 17:08 ` Andreas Schwab
2008-10-20 19:16 ` Eli Zaretskii
1 sibling, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-20 17:08 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
> The function split-string-and-unquote is a great help in taking apart
> shell command lines, but the values it returns seem incorrect in some
> situations, at least from shell command quoting perspective:
The docstring of split-string-and-unquote doesn't mention the word
"shell" anywhere. Why do you think that "Emacs Lisp quoting" has
anything to do with "shell command quoting"?
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 17:01 ` Andreas Schwab
@ 2008-10-20 19:06 ` Eli Zaretskii
2008-10-20 21:30 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-20 19:06 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Mon, 20 Oct 2008 19:01:12 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > (split-string-and-unquote "foo\ bar")
> > => ("foobar") [where's my blank?]
>
> (elisp)Syntax for Strings.
I tried that as well, in the part you omitted.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 17:08 ` Andreas Schwab
@ 2008-10-20 19:16 ` Eli Zaretskii
2008-10-20 21:28 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-20 19:16 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Mon, 20 Oct 2008 19:08:35 +0200
>
> Why do you think that "Emacs Lisp quoting" has anything to do with
> "shell command quoting"?
Because I grep'ped Emacs sources for its users.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 19:16 ` Eli Zaretskii
@ 2008-10-20 21:28 ` Andreas Schwab
2008-10-20 22:53 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 39+ messages in thread
From: Andreas Schwab @ 2008-10-20 21:28 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andreas Schwab <schwab@suse.de>
>> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> Date: Mon, 20 Oct 2008 19:08:35 +0200
>>
>> Why do you think that "Emacs Lisp quoting" has anything to do with
>> "shell command quoting"?
>
> Because I grep'ped Emacs sources for its users.
That does not make it more suitable.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 19:06 ` Eli Zaretskii
@ 2008-10-20 21:30 ` Andreas Schwab
2008-10-20 22:36 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-20 21:30 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andreas Schwab <schwab@suse.de>
>> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> Date: Mon, 20 Oct 2008 19:01:12 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > (split-string-and-unquote "foo\ bar")
>> > => ("foobar") [where's my blank?]
>>
>> (elisp)Syntax for Strings.
>
> I tried that as well, in the part you omitted.
What did you try?
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 21:30 ` Andreas Schwab
@ 2008-10-20 22:36 ` Eli Zaretskii
2008-10-21 9:25 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-20 22:36 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Mon, 20 Oct 2008 23:30:35 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Mon, 20 Oct 2008 19:01:12 +0200
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> > (split-string-and-unquote "foo\ bar")
> >> > => ("foobar") [where's my blank?]
> >>
> >> (elisp)Syntax for Strings.
> >
> > I tried that as well, in the part you omitted.
>
> What did you try?
The other inputs, see my original mail.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 21:28 ` Andreas Schwab
2008-10-20 22:53 ` Eli Zaretskii
@ 2008-10-20 22:53 ` Eli Zaretskii
2008-10-20 22:53 ` Eli Zaretskii
2 siblings, 0 replies; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-20 22:53 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212, emacs-devel
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Mon, 20 Oct 2008 23:28:21 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Mon, 20 Oct 2008 19:08:35 +0200
> >>
> >> Why do you think that "Emacs Lisp quoting" has anything to do with
> >> "shell command quoting"?
> >
> > Because I grep'ped Emacs sources for its users.
>
> That does not make it more suitable.
You know, since you evidently know better, how about if you explained
what that pair of functions is supposed to do, exactly, and what are
their intended uses? The doc strings fall short by a large margin,
and NEWS had this to say about these functions:
*** `split-string-and-unquote' does (what?)
*** `combine-and-quote-strings' does (what?)
If I can understand the explanation, maybe I could produce from it a
suitable section of the ELisp manual, which is the reason why I
started to play with split-string-and-unquote. Failing that, I will
stick to my interpretation.
Here's what I wrote in the ELisp manual about these two functions;
comments and corrections, if someone has them, are greatly
appreciated:
@cindex quoting and unquoting shell command line
The following two functions help creating shell commands from
individual argument strings and taking shell command lines apart into
individual arguments.
@defun split-string-and-unquote string &optional separators
This function splits @var{string} into substrings at matches for the
regular expression @var{separators}, like @code{split-string} does
(@pxref{Creating Strings}), but it additionally removes quoting from
the substrings. It then makes a list of the substrings and returns
it.
If @var{separators} is omitted or nil, it defaults to @code{"\\s-+"},
which is a regular expression that matches one or more characters with
whitespace syntax (@pxref{Syntax Class Table}).
The quoting this function supports is of 2 styles: by enclosing a
whole string in double quotes @code{"@dots{}"}, or by quoting
individual characters with a backslash escape @samp{\}. The latter is
also used in Lisp strings, so this function can handle those as well.
@end defun
@defun combine-and-quote-strings list-of-strings &optional separator
This function concatenates @var{list-of-strings} into a single string,
quoting each string in the list that needs quoting as it goes. It
also sticks the @var{separator} string in between each pair of strings
in the result, and returns that result. If @var{separator} is omitted
or @code{nil}, it defaults to a blank @code{" "}.
The strings in @var{list-of-strings} that need quoting are those that
include @var{separator} as their substring. Quoting a string encloses
it in double quotes @code{"@dots{}"}. In the simplest case, if you
are consing a shell command from the individual command-line
arguments, every argument that includes embedded blanks will be
quoted.
@end defun
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 21:28 ` Andreas Schwab
@ 2008-10-20 22:53 ` Eli Zaretskii
2008-10-20 22:53 ` Eli Zaretskii
2008-10-20 22:53 ` Eli Zaretskii
2 siblings, 0 replies; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-20 22:53 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212, emacs-devel
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Mon, 20 Oct 2008 23:28:21 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Mon, 20 Oct 2008 19:08:35 +0200
> >>
> >> Why do you think that "Emacs Lisp quoting" has anything to do with
> >> "shell command quoting"?
> >
> > Because I grep'ped Emacs sources for its users.
>
> That does not make it more suitable.
You know, since you evidently know better, how about if you explained
what that pair of functions is supposed to do, exactly, and what are
their intended uses? The doc strings fall short by a large margin,
and NEWS had this to say about these functions:
*** `split-string-and-unquote' does (what?)
*** `combine-and-quote-strings' does (what?)
If I can understand the explanation, maybe I could produce from it a
suitable section of the ELisp manual, which is the reason why I
started to play with split-string-and-unquote. Failing that, I will
stick to my interpretation.
Here's what I wrote in the ELisp manual about these two functions;
comments and corrections, if someone has them, are greatly
appreciated:
@cindex quoting and unquoting shell command line
The following two functions help creating shell commands from
individual argument strings and taking shell command lines apart into
individual arguments.
@defun split-string-and-unquote string &optional separators
This function splits @var{string} into substrings at matches for the
regular expression @var{separators}, like @code{split-string} does
(@pxref{Creating Strings}), but it additionally removes quoting from
the substrings. It then makes a list of the substrings and returns
it.
If @var{separators} is omitted or nil, it defaults to @code{"\\s-+"},
which is a regular expression that matches one or more characters with
whitespace syntax (@pxref{Syntax Class Table}).
The quoting this function supports is of 2 styles: by enclosing a
whole string in double quotes @code{"@dots{}"}, or by quoting
individual characters with a backslash escape @samp{\}. The latter is
also used in Lisp strings, so this function can handle those as well.
@end defun
@defun combine-and-quote-strings list-of-strings &optional separator
This function concatenates @var{list-of-strings} into a single string,
quoting each string in the list that needs quoting as it goes. It
also sticks the @var{separator} string in between each pair of strings
in the result, and returns that result. If @var{separator} is omitted
or @code{nil}, it defaults to a blank @code{" "}.
The strings in @var{list-of-strings} that need quoting are those that
include @var{separator} as their substring. Quoting a string encloses
it in double quotes @code{"@dots{}"}. In the simplest case, if you
are consing a shell command from the individual command-line
arguments, every argument that includes embedded blanks will be
quoted.
@end defun
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 21:28 ` Andreas Schwab
2008-10-20 22:53 ` Eli Zaretskii
2008-10-20 22:53 ` Eli Zaretskii
@ 2008-10-20 22:53 ` Eli Zaretskii
2008-10-21 1:11 ` Stefan Monnier
` (2 more replies)
2 siblings, 3 replies; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-20 22:53 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212, emacs-devel
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Mon, 20 Oct 2008 23:28:21 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Mon, 20 Oct 2008 19:08:35 +0200
> >>
> >> Why do you think that "Emacs Lisp quoting" has anything to do with
> >> "shell command quoting"?
> >
> > Because I grep'ped Emacs sources for its users.
>
> That does not make it more suitable.
You know, since you evidently know better, how about if you explained
what that pair of functions is supposed to do, exactly, and what are
their intended uses? The doc strings fall short by a large margin,
and NEWS had this to say about these functions:
*** `split-string-and-unquote' does (what?)
*** `combine-and-quote-strings' does (what?)
If I can understand the explanation, maybe I could produce from it a
suitable section of the ELisp manual, which is the reason why I
started to play with split-string-and-unquote. Failing that, I will
stick to my interpretation.
Here's what I wrote in the ELisp manual about these two functions;
comments and corrections, if someone has them, are greatly
appreciated:
@cindex quoting and unquoting shell command line
The following two functions help creating shell commands from
individual argument strings and taking shell command lines apart into
individual arguments.
@defun split-string-and-unquote string &optional separators
This function splits @var{string} into substrings at matches for the
regular expression @var{separators}, like @code{split-string} does
(@pxref{Creating Strings}), but it additionally removes quoting from
the substrings. It then makes a list of the substrings and returns
it.
If @var{separators} is omitted or nil, it defaults to @code{"\\s-+"},
which is a regular expression that matches one or more characters with
whitespace syntax (@pxref{Syntax Class Table}).
The quoting this function supports is of 2 styles: by enclosing a
whole string in double quotes @code{"@dots{}"}, or by quoting
individual characters with a backslash escape @samp{\}. The latter is
also used in Lisp strings, so this function can handle those as well.
@end defun
@defun combine-and-quote-strings list-of-strings &optional separator
This function concatenates @var{list-of-strings} into a single string,
quoting each string in the list that needs quoting as it goes. It
also sticks the @var{separator} string in between each pair of strings
in the result, and returns that result. If @var{separator} is omitted
or @code{nil}, it defaults to a blank @code{" "}.
The strings in @var{list-of-strings} that need quoting are those that
include @var{separator} as their substring. Quoting a string encloses
it in double quotes @code{"@dots{}"}. In the simplest case, if you
are consing a shell command from the individual command-line
arguments, every argument that includes embedded blanks will be
quoted.
@end defun
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 22:53 ` Eli Zaretskii
2008-10-21 1:11 ` Stefan Monnier
2008-10-21 1:11 ` Stefan Monnier
@ 2008-10-21 1:11 ` Stefan Monnier
2 siblings, 0 replies; 39+ messages in thread
From: Stefan Monnier @ 2008-10-21 1:11 UTC (permalink / raw
To: Eli Zaretskii; +Cc: Andreas Schwab, 1212, emacs-devel, emacs-pretest-bug
> *** `split-string-and-unquote' does (what?)
> *** `combine-and-quote-strings' does (what?)
AFAIK, these two functions are meant to:
- provide a way to specify any list of strings within a single string
(i.e. it needs to provide some separators and some way to quote the
separators), using a format that's simple to type for the end user.
- be inverse of each other; more precisely
(equal STR (split-string-and-unquote (combine-and-quote-strings STR)))
this is also stipulated in the docstring of split-string-and-unquote.
As the docstring of split-string-and-unquote explains, the quoting used
is the same as the one used for ELisp strings.
I could have used sh-style quoting or csh-style, or any other style, but
csh-style is nasty, sh-style is too powerful (what should we do with
backquotes and $(...)), and ELisp is what Emacs uses already and it's
reasonably simple and we know it handles all cases reasonably well, so
it seemed like an OK choice.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 22:53 ` Eli Zaretskii
@ 2008-10-21 1:11 ` Stefan Monnier
2008-10-21 1:11 ` Stefan Monnier
2008-10-21 1:11 ` Stefan Monnier
2 siblings, 0 replies; 39+ messages in thread
From: Stefan Monnier @ 2008-10-21 1:11 UTC (permalink / raw
To: Eli Zaretskii; +Cc: Andreas Schwab, 1212, emacs-devel, emacs-pretest-bug
> *** `split-string-and-unquote' does (what?)
> *** `combine-and-quote-strings' does (what?)
AFAIK, these two functions are meant to:
- provide a way to specify any list of strings within a single string
(i.e. it needs to provide some separators and some way to quote the
separators), using a format that's simple to type for the end user.
- be inverse of each other; more precisely
(equal STR (split-string-and-unquote (combine-and-quote-strings STR)))
this is also stipulated in the docstring of split-string-and-unquote.
As the docstring of split-string-and-unquote explains, the quoting used
is the same as the one used for ELisp strings.
I could have used sh-style quoting or csh-style, or any other style, but
csh-style is nasty, sh-style is too powerful (what should we do with
backquotes and $(...)), and ELisp is what Emacs uses already and it's
reasonably simple and we know it handles all cases reasonably well, so
it seemed like an OK choice.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 22:53 ` Eli Zaretskii
2008-10-21 1:11 ` Stefan Monnier
@ 2008-10-21 1:11 ` Stefan Monnier
2008-10-21 6:27 ` Eli Zaretskii
2008-10-21 1:11 ` Stefan Monnier
2 siblings, 1 reply; 39+ messages in thread
From: Stefan Monnier @ 2008-10-21 1:11 UTC (permalink / raw
To: Eli Zaretskii; +Cc: Andreas Schwab, 1212, emacs-devel, emacs-pretest-bug
> *** `split-string-and-unquote' does (what?)
> *** `combine-and-quote-strings' does (what?)
AFAIK, these two functions are meant to:
- provide a way to specify any list of strings within a single string
(i.e. it needs to provide some separators and some way to quote the
separators), using a format that's simple to type for the end user.
- be inverse of each other; more precisely
(equal STR (split-string-and-unquote (combine-and-quote-strings STR)))
this is also stipulated in the docstring of split-string-and-unquote.
As the docstring of split-string-and-unquote explains, the quoting used
is the same as the one used for ELisp strings.
I could have used sh-style quoting or csh-style, or any other style, but
csh-style is nasty, sh-style is too powerful (what should we do with
backquotes and $(...)), and ELisp is what Emacs uses already and it's
reasonably simple and we know it handles all cases reasonably well, so
it seemed like an OK choice.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 1:11 ` Stefan Monnier
@ 2008-10-21 6:27 ` Eli Zaretskii
2008-10-21 15:43 ` Stefan Monnier
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 6:27 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Andreas Schwab <schwab@suse.de>, emacs-pretest-bug@gnu.org, 1212@emacsbugs.donarmstrong.com, emacs-devel@gnu.org
> Date: Mon, 20 Oct 2008 21:11:10 -0400
>
> > *** `split-string-and-unquote' does (what?)
> > *** `combine-and-quote-strings' does (what?)
>
> AFAIK, these two functions are meant to:
>
> - provide a way to specify any list of strings within a single string
> (i.e. it needs to provide some separators and some way to quote the
> separators), using a format that's simple to type for the end user.
Thanks.
However, this describes roughly what the code does (which I kinda
understood myself by reading it ;-), but does not explain under what
circumstances would those functions be useful. By looking at the uses
of split-string-and-unquote, I deduced that the intended use is for
taking apart shell command lines. If that is not the intent, then
what is it?
> - be inverse of each other; more precisely
> (equal STR (split-string-and-unquote (combine-and-quote-strings STR)))
> this is also stipulated in the docstring of split-string-and-unquote.
The doc strings make very clear that the functions are reversible, but
that in itself does not yet mean they are useful, or for what purpose
exactly.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-20 22:36 ` Eli Zaretskii
@ 2008-10-21 9:25 ` Andreas Schwab
2008-10-21 10:18 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-21 9:25 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andreas Schwab <schwab@suse.de>
>> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> Date: Mon, 20 Oct 2008 23:30:35 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> From: Andreas Schwab <schwab@suse.de>
>> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> >> Date: Mon, 20 Oct 2008 19:01:12 +0200
>> >>
>> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >>
>> >> > (split-string-and-unquote "foo\ bar")
>> >> > => ("foobar") [where's my blank?]
>> >>
>> >> (elisp)Syntax for Strings.
>> >
>> > I tried that as well, in the part you omitted.
>>
>> What did you try?
>
> The other inputs, see my original mail.
Please read the node again. There is no blank.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 9:25 ` Andreas Schwab
@ 2008-10-21 10:18 ` Eli Zaretskii
2008-10-21 11:00 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 10:18 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Tue, 21 Oct 2008 11:25:33 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Mon, 20 Oct 2008 23:30:35 +0200
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> >> From: Andreas Schwab <schwab@suse.de>
> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> >> Date: Mon, 20 Oct 2008 19:01:12 +0200
> >> >>
> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >>
> >> >> > (split-string-and-unquote "foo\ bar")
> >> >> > => ("foobar") [where's my blank?]
> >> >>
> >> >> (elisp)Syntax for Strings.
> >> >
> >> > I tried that as well, in the part you omitted.
> >>
> >> What did you try?
> >
> > The other inputs, see my original mail.
>
> Please read the node again. There is no blank.
Please read my questions again, in the original report.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 10:18 ` Eli Zaretskii
@ 2008-10-21 11:00 ` Andreas Schwab
2008-10-21 11:33 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-21 11:00 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andreas Schwab <schwab@suse.de>
>> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> Date: Tue, 21 Oct 2008 11:25:33 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> From: Andreas Schwab <schwab@suse.de>
>> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> >> Date: Mon, 20 Oct 2008 23:30:35 +0200
>> >>
>> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >>
>> >> >> From: Andreas Schwab <schwab@suse.de>
>> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> >> >> Date: Mon, 20 Oct 2008 19:01:12 +0200
>> >> >>
>> >> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >> >>
>> >> >> > (split-string-and-unquote "foo\ bar")
>> >> >> > => ("foobar") [where's my blank?]
^^^^^^^^^^^^^^^^^
>> >> >>
>> >> >> (elisp)Syntax for Strings.
>> >> >
>> >> > I tried that as well, in the part you omitted.
>> >>
>> >> What did you try?
>> >
>> > The other inputs, see my original mail.
>>
>> Please read the node again. There is no blank.
>
> Please read my questions again, in the original report.
I did, see above.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 11:00 ` Andreas Schwab
@ 2008-10-21 11:33 ` Eli Zaretskii
2008-10-21 11:49 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 11:33 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Tue, 21 Oct 2008 13:00:35 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Tue, 21 Oct 2008 11:25:33 +0200
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> >> From: Andreas Schwab <schwab@suse.de>
> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> >> Date: Mon, 20 Oct 2008 23:30:35 +0200
> >> >>
> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >>
> >> >> >> From: Andreas Schwab <schwab@suse.de>
> >> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> >> >> Date: Mon, 20 Oct 2008 19:01:12 +0200
> >> >> >>
> >> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >> >>
> >> >> >> > (split-string-and-unquote "foo\ bar")
> >> >> >> > => ("foobar") [where's my blank?]
> ^^^^^^^^^^^^^^^^^
> >> >> >>
> >> >> >> (elisp)Syntax for Strings.
> >> >> >
> >> >> > I tried that as well, in the part you omitted.
> >> >>
> >> >> What did you try?
> >> >
> >> > The other inputs, see my original mail.
> >>
> >> Please read the node again. There is no blank.
> >
> > Please read my questions again, in the original report.
>
> I did, see above.
Which part of "the other inputs" did you misunderstand?
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 11:33 ` Eli Zaretskii
@ 2008-10-21 11:49 ` Andreas Schwab
2008-10-21 12:25 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-21 11:49 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andreas Schwab <schwab@suse.de>
>> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> Date: Tue, 21 Oct 2008 13:00:35 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> From: Andreas Schwab <schwab@suse.de>
>> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> >> Date: Tue, 21 Oct 2008 11:25:33 +0200
>> >>
>> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >>
>> >> >> From: Andreas Schwab <schwab@suse.de>
>> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> >> >> Date: Mon, 20 Oct 2008 23:30:35 +0200
>> >> >>
>> >> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >> >>
>> >> >> >> From: Andreas Schwab <schwab@suse.de>
>> >> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> >> >> >> Date: Mon, 20 Oct 2008 19:01:12 +0200
>> >> >> >>
>> >> >> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >> >> >>
>> >> >> >> > (split-string-and-unquote "foo\ bar")
>> >> >> >> > => ("foobar") [where's my blank?]
>> ^^^^^^^^^^^^^^^^^
>> >> >> >>
>> >> >> >> (elisp)Syntax for Strings.
>> >> >> >
>> >> >> > I tried that as well, in the part you omitted.
>> >> >>
>> >> >> What did you try?
>> >> >
>> >> > The other inputs, see my original mail.
>> >>
>> >> Please read the node again. There is no blank.
>> >
>> > Please read my questions again, in the original report.
>>
>> I did, see above.
>
> Which part of "the other inputs" did you misunderstand?
This is completely irrelevant. I have answered _only_ your question
above.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 11:49 ` Andreas Schwab
@ 2008-10-21 12:25 ` Eli Zaretskii
2008-10-21 12:50 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 12:25 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Tue, 21 Oct 2008 13:49:02 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Tue, 21 Oct 2008 13:00:35 +0200
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> >> From: Andreas Schwab <schwab@suse.de>
> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> >> Date: Tue, 21 Oct 2008 11:25:33 +0200
> >> >>
> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >>
> >> >> >> From: Andreas Schwab <schwab@suse.de>
> >> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> >> >> Date: Mon, 20 Oct 2008 23:30:35 +0200
> >> >> >>
> >> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >> >>
> >> >> >> >> From: Andreas Schwab <schwab@suse.de>
> >> >> >> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> >> >> >> Date: Mon, 20 Oct 2008 19:01:12 +0200
> >> >> >> >>
> >> >> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >> >> >>
> >> >> >> >> > (split-string-and-unquote "foo\ bar")
> >> >> >> >> > => ("foobar") [where's my blank?]
> >> ^^^^^^^^^^^^^^^^^
> >> >> >> >>
> >> >> >> >> (elisp)Syntax for Strings.
> >> >> >> >
> >> >> >> > I tried that as well, in the part you omitted.
> >> >> >>
> >> >> >> What did you try?
> >> >> >
> >> >> > The other inputs, see my original mail.
> >> >>
> >> >> Please read the node again. There is no blank.
> >> >
> >> > Please read my questions again, in the original report.
> >>
> >> I did, see above.
> >
> > Which part of "the other inputs" did you misunderstand?
>
> This is completely irrelevant. I have answered _only_ your question
> above.
The answer to that specific question is completely irrelevant to the
problem I reported in the original bug report. You need to consider
all the examples and questions together.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 12:25 ` Eli Zaretskii
@ 2008-10-21 12:50 ` Andreas Schwab
2008-10-21 12:58 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-21 12:50 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
> The answer to that specific question is completely irrelevant to the
> problem I reported in the original bug report. You need to consider
> all the examples and questions together.
It makes half of your examples useless.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 12:50 ` Andreas Schwab
@ 2008-10-21 12:58 ` Eli Zaretskii
2008-10-21 13:24 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 12:58 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,
> DNS_FROM_SECURITYSAGE autolearn=no version=3.1.0
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Tue, 21 Oct 2008 14:50:30 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > The answer to that specific question is completely irrelevant to the
> > problem I reported in the original bug report. You need to consider
> > all the examples and questions together.
>
> It makes half of your examples useless.
I made a lot of trials out of sheer despair. The examples were
supposed to demonstrate that nothing worked.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 12:58 ` Eli Zaretskii
@ 2008-10-21 13:24 ` Andreas Schwab
2008-10-21 13:36 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-21 13:24 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
>> X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,
>> DNS_FROM_SECURITYSAGE autolearn=no version=3.1.0
>> From: Andreas Schwab <schwab@suse.de>
>> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
>> Date: Tue, 21 Oct 2008 14:50:30 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > The answer to that specific question is completely irrelevant to the
>> > problem I reported in the original bug report. You need to consider
>> > all the examples and questions together.
>>
>> It makes half of your examples useless.
>
> I made a lot of trials out of sheer despair. The examples were
> supposed to demonstrate that nothing worked.
Of course, if there is nothing to split. What's your point?
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 13:24 ` Andreas Schwab
@ 2008-10-21 13:36 ` Eli Zaretskii
2008-10-21 13:44 ` Andreas Schwab
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 13:36 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Tue, 21 Oct 2008 15:24:11 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,
> >> DNS_FROM_SECURITYSAGE autolearn=no version=3.1.0
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> >> Date: Tue, 21 Oct 2008 14:50:30 +0200
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> > The answer to that specific question is completely irrelevant to the
> >> > problem I reported in the original bug report. You need to consider
> >> > all the examples and questions together.
> >>
> >> It makes half of your examples useless.
> >
> > I made a lot of trials out of sheer despair. The examples were
> > supposed to demonstrate that nothing worked.
>
> Of course, if there is nothing to split. What's your point?
The point is that the function says it also _unquotes_. It's the
unquoting that didn't work for me in the cases I described in the bug
report. Adding more text just so it could split doesn't change the
problematic behavior, but would clutter the bug report with irrelevant
details.
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 13:36 ` Eli Zaretskii
@ 2008-10-21 13:44 ` Andreas Schwab
2008-10-21 15:13 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Andreas Schwab @ 2008-10-21 13:44 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-pretest-bug, 1212
Eli Zaretskii <eliz@gnu.org> writes:
> The point is that the function says it also _unquotes_.
Why did you emphasize on the missing blank then?
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 39+ messages in thread
* bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 13:44 ` Andreas Schwab
@ 2008-10-21 15:13 ` Eli Zaretskii
0 siblings, 0 replies; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 15:13 UTC (permalink / raw
To: Andreas Schwab; +Cc: emacs-pretest-bug, 1212
> From: Andreas Schwab <schwab@suse.de>
> Cc: 1212@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
> Date: Tue, 21 Oct 2008 15:44:44 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > The point is that the function says it also _unquotes_.
>
> Why did you emphasize on the missing blank then?
Because I couldn't find any way of quoting embedded blanks with
backslashes, something frequently done in shell commands.
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 6:27 ` Eli Zaretskii
@ 2008-10-21 15:43 ` Stefan Monnier
2008-10-21 16:05 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Stefan Monnier @ 2008-10-21 15:43 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-devel
> However, this describes roughly what the code does (which I kinda
> understood myself by reading it ;-), but does not explain under what
> circumstances would those functions be useful. By looking at the uses
> of split-string-and-unquote, I deduced that the intended use is for
> taking apart shell command lines. If that is not the intent, then
> what is it?
The intent is for the user to be able to enter in a minibuffer a list of
strings, where most of them should usually not need any quoting.
The most common use is to enter a list of arguments to pass to
a command. Note that "arguments to pass to a command" (even if the
first element could be the command itself) is not the same as "shell
command line", since it does not include operators such as |, &, ;, $,
and `.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 15:43 ` Stefan Monnier
@ 2008-10-21 16:05 ` Eli Zaretskii
2008-10-22 2:04 ` Stefan Monnier
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-21 16:05 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: emacs-devel@gnu.org
> Date: Tue, 21 Oct 2008 11:43:25 -0400
>
> > However, this describes roughly what the code does (which I kinda
> > understood myself by reading it ;-), but does not explain under what
> > circumstances would those functions be useful. By looking at the uses
> > of split-string-and-unquote, I deduced that the intended use is for
> > taking apart shell command lines. If that is not the intent, then
> > what is it?
>
> The intent is for the user to be able to enter in a minibuffer a list of
> strings, where most of them should usually not need any quoting.
> The most common use is to enter a list of arguments to pass to
> a command. Note that "arguments to pass to a command" (even if the
> first element could be the command itself) is not the same as "shell
> command line", since it does not include operators such as |, &, ;, $,
> and `.
Well, in that case my understanding of the intent of these functions
was quite accurate. Which also means that split-string-and-unquote
should, indeed, handle quoting with a backslash and ".." quoting in
the middle of a word, as in `foo" "bar'. Right?
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-21 16:05 ` Eli Zaretskii
@ 2008-10-22 2:04 ` Stefan Monnier
2008-10-22 4:31 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Stefan Monnier @ 2008-10-22 2:04 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-devel
>> > However, this describes roughly what the code does (which I kinda
>> > understood myself by reading it ;-), but does not explain under what
>> > circumstances would those functions be useful. By looking at the uses
>> > of split-string-and-unquote, I deduced that the intended use is for
>> > taking apart shell command lines. If that is not the intent, then
>> > what is it?
>>
>> The intent is for the user to be able to enter in a minibuffer a list of
>> strings, where most of them should usually not need any quoting.
>> The most common use is to enter a list of arguments to pass to
>> a command. Note that "arguments to pass to a command" (even if the
>> first element could be the command itself) is not the same as "shell
>> command line", since it does not include operators such as |, &, ;, $,
>> and `.
> Well, in that case my understanding of the intent of these functions
> was quite accurate. Which also means that split-string-and-unquote
> should, indeed, handle quoting with a backslash and ".." quoting in
> the middle of a word, as in `foo" "bar'. Right?
No. Just because the arguments are passed to commands doesn't mean they
should use sh-style quoting. Proof is, neither csh nor Tcl obey sh-style
quoting for the arguments to commands they run.
The list of strings will be passed to call-process or start-process
which ultimately will pass them to execv or somesuch: no shell in sight.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-22 2:04 ` Stefan Monnier
@ 2008-10-22 4:31 ` Eli Zaretskii
2008-10-22 14:58 ` Stefan Monnier
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-22 4:31 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Tue, 21 Oct 2008 22:04:51 -0400
>
> The list of strings will be passed to call-process or start-process
> which ultimately will pass them to execv or somesuch: no shell in sight.
But the original string could have been a properly quoted shell
command, and those do use sh-style quoting. The function needs to
remove that quoting.
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-22 4:31 ` Eli Zaretskii
@ 2008-10-22 14:58 ` Stefan Monnier
2008-10-22 19:43 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Stefan Monnier @ 2008-10-22 14:58 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-devel
>> The list of strings will be passed to call-process or start-process
>> which ultimately will pass them to execv or somesuch: no shell in sight.
> But the original string could have been a properly quoted shell
> command, and those do use sh-style quoting.
I do not understand: what makes you think it could be a properly quoted
shell command?
/We/ define what it can accept. And as of now, we (well, admittedly,
IIUC, it's mostly just myself) decided that it accepts a syntax derived
from Elisp string quoting, so if you feed it sh-style quoted strings, it
won't work in general (tho it will if you stick to the common subset, of
course).
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-22 14:58 ` Stefan Monnier
@ 2008-10-22 19:43 ` Eli Zaretskii
2008-10-22 21:42 ` Stefan Monnier
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-22 19:43 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Wed, 22 Oct 2008 10:58:49 -0400
>
> >> The list of strings will be passed to call-process or start-process
> >> which ultimately will pass them to execv or somesuch: no shell in sight.
> > But the original string could have been a properly quoted shell
> > command, and those do use sh-style quoting.
>
> I do not understand: what makes you think it could be a properly quoted
> shell command?
Because you said that working with shell commands was why these
functions were invented in the first place. And that is how they are
used in Emacs as of now.
> /We/ define what it can accept.
But hopefully, /we/ decide that to accomplish some specific practical
goal, not just to craft a function that accepts a small subset of that
goal. Right? So what class of _practical_ problems do these two
functions solve? After all, using Lisp syntax in shell commands is
not an interesting use-case, is it?
> And as of now, we (well, admittedly,
> IIUC, it's mostly just myself) decided that it accepts a syntax derived
> from Elisp string quoting, so if you feed it sh-style quoted strings, it
> won't work in general (tho it will if you stick to the common subset, of
> course).
Are you saying that modes that work with shell commands, such as GUD,
should not use these functions, because they don't generally support
the full syntax of quoted shell commands?
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-22 19:43 ` Eli Zaretskii
@ 2008-10-22 21:42 ` Stefan Monnier
2008-10-22 22:11 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Stefan Monnier @ 2008-10-22 21:42 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-devel
>> >> The list of strings will be passed to call-process or start-process
>> >> which ultimately will pass them to execv or somesuch: no shell in sight.
>> > But the original string could have been a properly quoted shell
>> > command, and those do use sh-style quoting.
>>
>> I do not understand: what makes you think it could be a properly quoted
>> shell command?
> Because you said that working with shell commands was why these
> functions were invented in the first place. And that is how they are
> used in Emacs as of now.
No, they're used to run commands. Without going through a shell.
> Are you saying that modes that work with shell commands, such as GUD,
> should not use these functions, because they don't generally support
> the full syntax of quoted shell commands?
IIUC GUD does not use a shell, so it can use this just fine.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-22 21:42 ` Stefan Monnier
@ 2008-10-22 22:11 ` Eli Zaretskii
2008-10-23 1:18 ` Stefan Monnier
0 siblings, 1 reply; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-22 22:11 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Wed, 22 Oct 2008 17:42:36 -0400
> >> I do not understand: what makes you think it could be a properly quoted
> >> shell command?
>
> > Because you said that working with shell commands was why these
> > functions were invented in the first place. And that is how they are
> > used in Emacs as of now.
>
> No, they're used to run commands. Without going through a shell.
Then why would one need quoting?
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-22 22:11 ` Eli Zaretskii
@ 2008-10-23 1:18 ` Stefan Monnier
2008-10-23 4:29 ` Eli Zaretskii
0 siblings, 1 reply; 39+ messages in thread
From: Stefan Monnier @ 2008-10-23 1:18 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-devel
>> >> I do not understand: what makes you think it could be a properly quoted
>> >> shell command?
>> > Because you said that working with shell commands was why these
>> > functions were invented in the first place. And that is how they are
>> > used in Emacs as of now.
>> No, they're used to run commands. Without going through a shell.
> Then why would one need quoting?
Because when you run a command with start-process or call-process, you
need to specify a list of strings (each being an argument), but the user
usually wants to enter the list within a single minibuffer. So from the
string returned by the read-string (or equivalent) function, we need to
get a list of strings.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-23 1:18 ` Stefan Monnier
@ 2008-10-23 4:29 ` Eli Zaretskii
2008-10-23 4:39 ` Miles Bader
2008-10-23 13:55 ` Stefan Monnier
0 siblings, 2 replies; 39+ messages in thread
From: Eli Zaretskii @ 2008-10-23 4:29 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Wed, 22 Oct 2008 21:18:20 -0400
>
> >> >> I do not understand: what makes you think it could be a properly quoted
> >> >> shell command?
> >> > Because you said that working with shell commands was why these
> >> > functions were invented in the first place. And that is how they are
> >> > used in Emacs as of now.
> >> No, they're used to run commands. Without going through a shell.
> > Then why would one need quoting?
>
> Because when you run a command with start-process or call-process, you
> need to specify a list of strings (each being an argument), but the user
> usually wants to enter the list within a single minibuffer. So from the
> string returned by the read-string (or equivalent) function, we need to
> get a list of strings.
If I am prompted for a command in the minibuffer, as in "M-x compile",
I will type a command that uses shell quoting (assuming I need
quoting). That is the natural thing to do, so I expect most users to
do the same. I don't expect many of them to use Lisp string quoting
for commands.
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-23 4:29 ` Eli Zaretskii
@ 2008-10-23 4:39 ` Miles Bader
2008-10-23 13:55 ` Stefan Monnier
1 sibling, 0 replies; 39+ messages in thread
From: Miles Bader @ 2008-10-23 4:39 UTC (permalink / raw
To: Eli Zaretskii; +Cc: Stefan Monnier, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> Because when you run a command with start-process or call-process, you
>> need to specify a list of strings (each being an argument), but the user
>> usually wants to enter the list within a single minibuffer. So from the
>> string returned by the read-string (or equivalent) function, we need to
>> get a list of strings.
>
> If I am prompted for a command in the minibuffer, as in "M-x compile",
> I will type a command that uses shell quoting (assuming I need
> quoting). That is the natural thing to do, so I expect most users to
> do the same. I don't expect many of them to use Lisp string quoting
> for commands.
Yup, I agree... it seems likely to cause confusion...
-Miles
--
Politics, n. A strife of interests masquerading as a contest of
principles. The conduct of public affairs for private advantage.
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: bug#1212: 23.0.60; split-string-and-unquote problems
2008-10-23 4:29 ` Eli Zaretskii
2008-10-23 4:39 ` Miles Bader
@ 2008-10-23 13:55 ` Stefan Monnier
1 sibling, 0 replies; 39+ messages in thread
From: Stefan Monnier @ 2008-10-23 13:55 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-devel
>> >> >> I do not understand: what makes you think it could be a properly quoted
>> >> >> shell command?
>> >> > Because you said that working with shell commands was why these
>> >> > functions were invented in the first place. And that is how they are
>> >> > used in Emacs as of now.
>> >> No, they're used to run commands. Without going through a shell.
>> > Then why would one need quoting?
>>
>> Because when you run a command with start-process or call-process, you
>> need to specify a list of strings (each being an argument), but the user
>> usually wants to enter the list within a single minibuffer. So from the
>> string returned by the read-string (or equivalent) function, we need to
>> get a list of strings.
> If I am prompted for a command in the minibuffer, as in "M-x compile",
> I will type a command that uses shell quoting (assuming I need
> quoting). That is the natural thing to do, so I expect most users to
> do the same. I don't expect many of them to use Lisp string quoting
> for commands.
Indeed, `compile' uses a shell and hence obeys shell quoting.
Stefan
^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2008-10-23 13:55 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20 16:04 bug#1212: 23.0.60; split-string-and-unquote problems Eli Zaretskii
2008-10-20 17:01 ` Andreas Schwab
2008-10-20 19:06 ` Eli Zaretskii
2008-10-20 21:30 ` Andreas Schwab
2008-10-20 22:36 ` Eli Zaretskii
2008-10-21 9:25 ` Andreas Schwab
2008-10-21 10:18 ` Eli Zaretskii
2008-10-21 11:00 ` Andreas Schwab
2008-10-21 11:33 ` Eli Zaretskii
2008-10-21 11:49 ` Andreas Schwab
2008-10-21 12:25 ` Eli Zaretskii
2008-10-21 12:50 ` Andreas Schwab
2008-10-21 12:58 ` Eli Zaretskii
2008-10-21 13:24 ` Andreas Schwab
2008-10-21 13:36 ` Eli Zaretskii
2008-10-21 13:44 ` Andreas Schwab
2008-10-21 15:13 ` Eli Zaretskii
2008-10-20 17:08 ` Andreas Schwab
2008-10-20 19:16 ` Eli Zaretskii
2008-10-20 21:28 ` Andreas Schwab
2008-10-20 22:53 ` Eli Zaretskii
2008-10-20 22:53 ` Eli Zaretskii
2008-10-20 22:53 ` Eli Zaretskii
2008-10-21 1:11 ` Stefan Monnier
2008-10-21 1:11 ` Stefan Monnier
2008-10-21 6:27 ` Eli Zaretskii
2008-10-21 15:43 ` Stefan Monnier
2008-10-21 16:05 ` Eli Zaretskii
2008-10-22 2:04 ` Stefan Monnier
2008-10-22 4:31 ` Eli Zaretskii
2008-10-22 14:58 ` Stefan Monnier
2008-10-22 19:43 ` Eli Zaretskii
2008-10-22 21:42 ` Stefan Monnier
2008-10-22 22:11 ` Eli Zaretskii
2008-10-23 1:18 ` Stefan Monnier
2008-10-23 4:29 ` Eli Zaretskii
2008-10-23 4:39 ` Miles Bader
2008-10-23 13:55 ` Stefan Monnier
2008-10-21 1:11 ` Stefan Monnier
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.