<div dir="ltr">Hello Racket devs,<div><br>
<div style>I'm working on tweaking how typing a double quote is handled in strings when DrRacket's auto parens mode is on, per recent post on the users list. If any of you use the mode and can offer feedback on the following, it'd be appreciated: In addition to handling Laurent's initial feature request (see message at bottom), I'm setting it up so that if the following string is in the DrRacket window:</div>
<div style> "abcdefghi"</div><div style>and you select the _def_ and press " (double quote), then it places double-quotes around the "def" with additional quotes to ensure that the other two portions of the string are still validly delimited, i.e.</div>
<div style> "abc""def""ghi"</div><div style><br></div><div style>One question is where to put the cursor following this operation? Should it be right inside the beginning of the lifted string, or in front of its double quotes, i.e.:</div>
<div style> "abc""|def""ghi" </div><div style>or "abc"|"def""ghi"</div><div style>?</div><div style><br></div><div style>Another question is whether to space off the "def" string that is created from the surrounding ones, i.e.</div>
<div style> "abc" "def" "ghi"</div><div style>instead of "abc""def""ghi"? </div><div style><br></div><div style>(As a side note: the Emacs paredit mode handles the situation of a double quotes typed inside a string by inserting an escaped \". It uses a separate key combination to handle splitting both strings and parenthesized expressions into two pieces.)</div>
</div><div style><br></div><div style>Thanks,</div><div style><br></div><div style>--- nadeem</div><div style><br></div><div style><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">On May 22, 2013, at 7:07 AM, Laurent wrote:</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">> Hi,</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">></span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">> The new behavior of automatic parenthesis matching is really nice, but there is one problem with string quotes.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">> For example, if the cursor is in the middle of a string and I type the string-quote symbol ", it places a quote which cuts the current string and leaves the right part in a bad syntax.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">></span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">> Most of the time, when I type a quote inside a string, it's because I want to split the string in two parts.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">> To do that, I have to type string-quote, string-quote, delete (to remove the extra string-quote added by the paren-match behavior), and left to go back between the two strings, which is mildly annoying.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">></span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">> Would it be possible (unless problematic) to have the default paren-match behavior for strings that splits the string instead of inserting a single string-quote, possibly unless the left symbol is a backslash?</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
</div></div>