Fix insertion of backslashes in non-"" strings #99

Merged
merged 1 commit into from Dec 18, 2016

Conversation

Projects
None yet
2 participants
@trishume
Contributor

trishume commented Oct 30, 2016

This fixes the bug where backslashes are inserted on RET in {| string |} literals and embedded minor modes like smerge-mode, where they are unwanted.

This patch simply checks that the delimiter of a literal is " which equates to code 34. Only auto-inserting backslashes in "" is IMO a much better behaviour than inserting them in any string-like thing including {| |} literals (where they are just literal backslashes) and editing merge conflicts.

I wrote this as a patch in my init.el and when I went to submit it here I noticed #54 but that PR is enormous and over a year old and seems to be held up indefinitely. I propose this tiny patch as a way to fix the bug for now. Maybe eventually some better solution can be put in place, but this annoying little bug should be patched as soon as possible in the mean time.

@Chris00 @monnier

Fix insertion of backslashes in non-"" strings
This fixes the bug where backslashes are inserted on `RET` in `{| string |}` literals and embedded minor modes like [smerge-mode](https://github.com/jwiegley/emacs-release/blob/master/lisp/vc/smerge-mode.el), where they are unwanted.

I wrote this as a patch in my init.el and when I went to submit it here I noticed #54 but that PR is enormous and over a year old and seems to be held up indefinitely. I propose this tiny patch as a way to fix the bug for now. Maybe eventually some better solution can be put in place, but this annoying little bug should be patched as soon as possible in the mean time.
@trishume

This comment has been minimized.

Show comment
Hide comment
@trishume

trishume Dec 16, 2016

Contributor

ping @Chris00 have you looked at this?

Contributor

trishume commented Dec 16, 2016

ping @Chris00 have you looked at this?

@Chris00 Chris00 merged commit 01c1012 into ocaml:master Dec 18, 2016

@Chris00

This comment has been minimized.

Show comment
Hide comment
@Chris00

Chris00 Dec 18, 2016

Member

Thanks but note that tuareg_indent.el contains old code that will be removed at some point.

Member

Chris00 commented Dec 18, 2016

Thanks but note that tuareg_indent.el contains old code that will be removed at some point.

@trishume trishume deleted the trishume:patch-1 branch Dec 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment