<br><br>On Thursday, May 23, 2013, Nadeem Abdul Hamid wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Racket devs,<div><br>
<div>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> "abcdefghi"</div><div>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> "abc""def""ghi"</div><div><br></div><div>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> "abc""|def""ghi" </div><div>or "abc"|"def""ghi"</div><div>?</div><div><br></div></div></div></blockquote><div><br></div><div>Oh: another possibility: keep the selection where it is (or, perhaps better, select the open quote, the def, and the close quote).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div></div><div>Another question is whether to space off the "def" string that is created from the surrounding ones, i.e.</div>
<div> "abc" "def" "ghi"</div><div>instead of "abc""def""ghi"? </div><div><br></div><div>(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><br></div><div>Thanks,</div><div><br></div><div>--- nadeem</div><div><br></div><div><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>
</blockquote>