Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed quoting to double quote outside, escaped double quote inside … #2657

Closed
wants to merge 1 commit into from

Conversation

cark
Copy link

@cark cark commented Jun 23, 2019

PR Supporting #2656
Changed quoting for command line invocation of clojure.
Tested working with windows 10 and ubuntu.

@Malabarba
Copy link
Member

All of this manual escaping feels scary. Won't shell-quote-argument work for this? It's supposed to support all systems Emacs runs on (Windows included).

@cark
Copy link
Author

cark commented Jun 24, 2019

In this case, we're dealing with 3 different quoting/escaping rules on windows, all conflicting and fighting with each other. I can't imagine shell-quote-argument making sense on any of that. I explained the rationale for this pr in #2656

@Malabarba
Copy link
Member

What worries me is that I think the change you made might break the command on linux and Mac. At least, it reads like you're changing a ' for a ", and that has several consequences in bash.

@cark
Copy link
Author

cark commented Jun 24, 2019

I tested this on ubuntu, i don't have a mac though

@bbatsov
Copy link
Member

bbatsov commented Jun 26, 2019

The behaviour should be the same, as the shell's what matters not the OS. It'd be nice if a few people tested the change before we merge this PR, though. Right now I'm traveling and I'm short on time for this.

@corasaurus-hex
Copy link

This is definitely the wrong way to do escaping in sh and bash. Things within double quotes get evaluated for variable substitution. Single quotes is the right way to go, and it should change ' within the argument to '\'' like so:

$ echo 'hi$varg'\''uys'
hi$varg'uys

As opposed to with double quotes where this happens:

$ echo "hi$varg\"uys"
hi"uys

@corasaurus-hex
Copy link

It sounds like platform-specific quoting is needed, where you could just call (quote "hi$varg'uys") and get back 'hi$varg'\''uys' already wrapped in quotes and the internal single quotes already escaped. For windows it could wrap it in different, appropriate quoting and escape quotes within it.

@bbatsov
Copy link
Member

bbatsov commented Aug 8, 2019

See also #2685 I think it's pretty elegant way to solve this quoting mess.

@cark
Copy link
Author

cark commented Aug 8, 2019

That's actually how i did it with my binary wrapper, it works

@bbatsov
Copy link
Member

bbatsov commented Aug 20, 2019

Guess we can close this one.

@bbatsov bbatsov closed this Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants