emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add shell-quasiquote.


From: Taylan Ulrich Bayırlı/Kammer
Subject: Re: [PATCH] Add shell-quasiquote.
Date: Tue, 20 Oct 2015 19:28:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: address@hidden (Taylan Ulrich Bayırlı/Kammer)
>> Cc: address@hidden
>> Date: Tue, 20 Oct 2015 18:31:00 +0200
>> 
>> > This is not about non-Posix shells (although that aspect did start
>> > this thread).  This is about using project-wide APIs for certain
>> > standard jobs.  That should have been a no-brainer, because it makes
>> > no sense to have several functions doing the same job in subtly
>> > different ways.
>> >
>> > So you were politely requested to call that function for quoting shell
>> > arguments in your package.  Doing that is the only thing that stands
>> > in the way of accepting your package on ELPA.  AFAIK, there were no
>> > other comments.
>> >
>> > If you think shell-quote-argument should be changed, feel free to
>> > submit a patch proposal to that effect, and state there your reasons
>> > for the changes.  If they are accepted, all Lisp programs in Emacs
>> > that need to quote command arguments will work that way, and everybody
>> > will win by having a better Emacs.
>> 
>> I've already provided an extensive explanation of the problem with
>> shell-quote-argument, what the solution to that problem is, and provided
>> a patch to apply that solution.
>> 
>> The patch was turned down.  (By you.)
>
> That was about the documentation.  I understood, perhaps incorrectly,
> that you also thought the code of the function needed some changes.
> At least your alternative implementation quotes slightly differently,
> e.g. it quotes even if the string doesn't need any quoting (because it
> includes only characters from the Posix portable set).  It also quotes
> 'like this', whereas shell-quote-argument uses backslashes.

The bug report explicitly stated that the current implementation of
shell-quote-argument passes the strictest criterion of correctness, and
included a horrible stress-test script to demonstrate it, merely so I
could justify my documentation patch.

I think I'm trying to be much more cooperative than what you seem to
believe.

Please read my mails more carefully.  I usually spend a lot of time on
them to make them as clear and comprehensive as possible.  Tell me if
they get too "comprehensive," as in burdensome to read.

>> > I cannot understand why you insist on tying your contribution with two
>> > orthogonal issues: what and how should be quoted, and what should be
>> > in the doc string.  By doing this, you prevent acceptance of your
>> > package, which IMO is a pity.
>> 
>> I don't know what you mean with "what and how should be quoted."
>
> See above; I hope now what I meant is clear.

I see.  No, I never said the difference between how shell-quote-argument
and shqq--quote-string do things was significant.  When I found out
about the difference, I explicitly stated it was insignificant.

>> The doc string can serve as a clear declaration of strict safety
>> guarantees that will make the function appropriate for my use case.
>> Until that's done, the function is not appropriate for my use case
>> because it does not declare the guarantees necessary for my use case.
>
> Documentation cannot change what the code does.  If the function will
> be appropriate after changing its doc string, it is appropriate now.

Documentation can change what associated code will do in the future.
Sometimes, ensuring that code will remain appropriate in the future is
very important, as in the cases I explained.

>> In practical terms, as explained before, this means that someone editing
>> the function in the future may insert bugs into it which, from what I've
>> gathered from other posts in the thread, it indeed also had in the past.
>
> Documentation cannot prevent such incidents.  However, we can make
> this harder by adding tests for this function.  There already are 3
> tests that use it, and we can add more if needed.  Patches to add such
> tests are welcome.

Documentation can very well prevent such incidents, because in the case
where the semantics of a function is wonky, as is the case in quoting
strings for shell commands, it can be the documentation that makes the
difference of how carefully future programmers think of what changes
they're making to the code.

Indeed, tests allow mechanically verifiable invariants, which is better.
I might write such tests for shell-quote-argument in the future, but the
lack of a bigger improvement does not justify the rejection of a smaller
improvement.

> The upshot is that it's a pity to hold off a package for reasons that
> can and should be taken care of independently and orthogonally.
>
>> It has also not been verified whether it's void of such bugs for systems
>> other than POSIX, which is why I left declaring that to you; my patches
>> were only adding the declaration of safety for POSIX, which I've made
>> very sure of and gladly take responsibility for.
>
> The test suite runs on all supported systems, including MS-Windows,
> and the tests all succeed.  This function is quite old, so any
> problems with it should have been reported long ago.  The issue with
> an embedded newline doesn't exist on MS-Windows at all.

For how long did the embedded newline problem remain in the POSIX
variant, which is probably used by ten times as many people?

>> All of these things I've already said before, multiple times, with
>> different wording, every time as clearly as I could.
>
> I'm still hoping you will change your mind.

I have not been given any reason to change my mind.  Shoop da woop and
we're talking about unit testing all of a sudden, and my actual points
have once more been ignored.  Congratulations!

Taylan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]