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

An escaped space (\ ) shouldn't be treated as whitespace. #20

Open
Malabarba opened this issue Nov 26, 2013 · 5 comments
Open

An escaped space (\ ) shouldn't be treated as whitespace. #20

Malabarba opened this issue Nov 26, 2013 · 5 comments

Comments

@Malabarba
Copy link

In one of my lisp files I had a line like (defcustom name ?\, which basically sets the space char as the initial value of the variable.
After turning on ethan-wspace-mode (and editing + saving the file a few times), the space after \ was removed which means the actual code was changed.

@glasserc
Copy link
Owner

Yikes. Sorry about that. It seems to me that this is hard to do right -- while in Lisp, the "?\ " string means "a literal space" and the space should be preserved, in Bash or JavaScript, a terminal \ is supposed to indicate a line continuation and presumably the space should be removed. ethan-wspace is about making it obvious when there's something invisible going on, so I think the existing behavior is preferable. I'd suggest you write your space as ?\s, or put something after it (a comment to highlight the fact that it's a literal space?).

@Malabarba
Copy link
Author

Yeah, that's what I did to fix it. I just thought you'd like to know this
happens. ;)

@dgutov
Copy link
Contributor

dgutov commented Nov 26, 2013

@glasserc Instead of matching the character \, you could try matching the syntax class. That would be \\s\\.

@glasserc
Copy link
Owner

@dgutov I don't understand -- how does that solve the problem? Don't you still need to resolve the ambiguity of whether or not the space after the backslash is significant?

@Bruce-Connor Turns out ethan-wspace itself includes the "?\ " character, which now I want to change to "?\s".

@dgutov
Copy link
Contributor

dgutov commented Nov 26, 2013

Don't you still need to resolve the ambiguity of whether or not the space after the backslash is significant?

Hmm, yes, that's still a problem. Sorry for the noise.

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

No branches or pull requests

3 participants