Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
> Yes, I believe Eclipse does something like this too, maybe not with such a visual sort of indication. I agree that it's very cool functionality but it requires really thorough tracking > of some hidden state as Robby says (history of the users' key and/or mouse interaction) and I don't think I'm going to go for this right now. I understand if it's not worth implementing for complexity reasons. I was just suggesting what I thought was a good visual solution to the potential confusion caused by such hidden state. And forgive me if this is an ignorant question since I have no idea what it takes to implement something like this, but couldn't you just have the state be tied to the specific closing paren character? If that were possible, the state could just include whether it is temporary and which opening paren it is linked to, and certain user actions change that state to permanent or deleted. I don't see a need to track history. But again, I have very little knowledge about this subject. On Sat, Nov 24, 2012 at 12:16 PM, Nadeem Abdul Hamid wrote: > On Sat, Nov 24, 2012 at 12:07 PM, Nick Shelley wrote: > >> For what it's worth, Xcode differentiates these cases by inserting a >> temporary closing paren that is gray instead of black. You can make it >> permanent by arrowing over it, typing it yourself, tabbing over it, or just >> moving the cursor outside the matching parens. When it becomes permanent it >> is black like the other text and you have to delete it individually, but >> while it is still gray it will be deleted automatically if you delete the >> opening paren. >> >> I sort of like this behavior, and the visual difference gets rid of any >> potential confusion. >> > > Yes, I believe Eclipse does something like this too, maybe not with such a > visual sort of indication. I agree that it's very cool functionality but it > requires really thorough tracking of some hidden state as Robby says > (history of the users' key and/or mouse interaction) and I don't think I'm > going to go for this right now. > > > >> On Saturday, November 24, 2012, Robby Findler wrote: >> >>> On Sat, Nov 24, 2012 at 8:53 AM, Laurent >>> wrote: >>> > >>> > >>> > >>> > On Sat, Nov 24, 2012 at 3:11 PM, Nadeem Abdul Hamid >>> wrote: >>> >> >>> >> On Sat, Nov 24, 2012 at 4:03 AM, Laurent >>> wrote: >>> >>> >>> >>> If you can, I think it would be a good idea to remove the paren pair >>> if >>> >>> the user deletes the opening paren he just typed by mistake. Undo >>> should do >>> >>> the same (which apparently it does not currently; missing >>> >>> 'begin/end-edit-sequence' ?). >>> >> >>> >> >>> >> Yeah, the undo behavior I've fixed. The first scenario you mention >>> might >>> >> be tricky - how do you distinguish between typing an open paren and >>> then >>> >> immediately deleting it vs. typing an open paren, making a bunch of >>> other >>> >> edits, and then coming back and deleting the open paren? >>> > >>> > >>> > I think it would already be good enough to only consider the case >>> where the >>> > user types the paren and wants to remove them immediately (e.g., he >>> placed >>> > them in the wrong place, or wanted square brackets instead, or just >>> changed >>> > his mind). >>> > In the case of meanwhile edits, I don't think the user would bother >>> deleting >>> > the closing paren himself. >>> >>> I think that hidden state like this can lead to confusing behavior. >>> Probably you want to have deleting a paren do the same thing, >>> regardless of what the character most recently typed was. >>> >>> Robby >>> _ >>> Racket Developers list: >>> http://lists.racket-lang.org/dev >>> >> >> _ >> Racket Developers list: >> http://lists.racket-lang.org/dev >> >> > _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
On Sat, Nov 24, 2012 at 12:07 PM, Nick Shelley wrote: > For what it's worth, Xcode differentiates these cases by inserting a > temporary closing paren that is gray instead of black. You can make it > permanent by arrowing over it, typing it yourself, tabbing over it, or just > moving the cursor outside the matching parens. When it becomes permanent it > is black like the other text and you have to delete it individually, but > while it is still gray it will be deleted automatically if you delete the > opening paren. > > I sort of like this behavior, and the visual difference gets rid of any > potential confusion. > Yes, I believe Eclipse does something like this too, maybe not with such a visual sort of indication. I agree that it's very cool functionality but it requires really thorough tracking of some hidden state as Robby says (history of the users' key and/or mouse interaction) and I don't think I'm going to go for this right now. > On Saturday, November 24, 2012, Robby Findler wrote: > >> On Sat, Nov 24, 2012 at 8:53 AM, Laurent >> wrote: >> > >> > >> > >> > On Sat, Nov 24, 2012 at 3:11 PM, Nadeem Abdul Hamid >> wrote: >> >> >> >> On Sat, Nov 24, 2012 at 4:03 AM, Laurent >> wrote: >> >>> >> >>> If you can, I think it would be a good idea to remove the paren pair >> if >> >>> the user deletes the opening paren he just typed by mistake. Undo >> should do >> >>> the same (which apparently it does not currently; missing >> >>> 'begin/end-edit-sequence' ?). >> >> >> >> >> >> Yeah, the undo behavior I've fixed. The first scenario you mention >> might >> >> be tricky - how do you distinguish between typing an open paren and >> then >> >> immediately deleting it vs. typing an open paren, making a bunch of >> other >> >> edits, and then coming back and deleting the open paren? >> > >> > >> > I think it would already be good enough to only consider the case >> where the >> > user types the paren and wants to remove them immediately (e.g., he >> placed >> > them in the wrong place, or wanted square brackets instead, or just >> changed >> > his mind). >> > In the case of meanwhile edits, I don't think the user would bother >> deleting >> > the closing paren himself. >> >> I think that hidden state like this can lead to confusing behavior. >> Probably you want to have deleting a paren do the same thing, >> regardless of what the character most recently typed was. >> >> Robby >> _ >> Racket Developers list: >> http://lists.racket-lang.org/dev >> > > _ > Racket Developers list: > http://lists.racket-lang.org/dev > > _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
For what it's worth, Xcode differentiates these cases by inserting a temporary closing paren that is gray instead of black. You can make it permanent by arrowing over it, typing it yourself, tabbing over it, or just moving the cursor outside the matching parens. When it becomes permanent it is black like the other text and you have to delete it individually, but while it is still gray it will be deleted automatically if you delete the opening paren. I sort of like this behavior, and the visual difference gets rid of any potential confusion. On Saturday, November 24, 2012, Robby Findler wrote: > On Sat, Nov 24, 2012 at 8:53 AM, Laurent > > > wrote: > > > > > > > > On Sat, Nov 24, 2012 at 3:11 PM, Nadeem Abdul Hamid > > > > wrote: > >> > >> On Sat, Nov 24, 2012 at 4:03 AM, Laurent > >> > > wrote: > >>> > >>> If you can, I think it would be a good idea to remove the paren pair if > >>> the user deletes the opening paren he just typed by mistake. Undo > should do > >>> the same (which apparently it does not currently; missing > >>> 'begin/end-edit-sequence' ?). > >> > >> > >> Yeah, the undo behavior I've fixed. The first scenario you mention might > >> be tricky - how do you distinguish between typing an open paren and then > >> immediately deleting it vs. typing an open paren, making a bunch of > other > >> edits, and then coming back and deleting the open paren? > > > > > > I think it would already be good enough to only consider the case where > the > > user types the paren and wants to remove them immediately (e.g., he > placed > > them in the wrong place, or wanted square brackets instead, or just > changed > > his mind). > > In the case of meanwhile edits, I don't think the user would bother > deleting > > the closing paren himself. > > I think that hidden state like this can lead to confusing behavior. > Probably you want to have deleting a paren do the same thing, > regardless of what the character most recently typed was. > > Robby > _ > Racket Developers list: > http://lists.racket-lang.org/dev > _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
On Sat, Nov 24, 2012 at 8:53 AM, Laurent wrote: > > > > On Sat, Nov 24, 2012 at 3:11 PM, Nadeem Abdul Hamid wrote: >> >> On Sat, Nov 24, 2012 at 4:03 AM, Laurent wrote: >>> >>> If you can, I think it would be a good idea to remove the paren pair if >>> the user deletes the opening paren he just typed by mistake. Undo should do >>> the same (which apparently it does not currently; missing >>> 'begin/end-edit-sequence' ?). >> >> >> Yeah, the undo behavior I've fixed. The first scenario you mention might >> be tricky - how do you distinguish between typing an open paren and then >> immediately deleting it vs. typing an open paren, making a bunch of other >> edits, and then coming back and deleting the open paren? > > > I think it would already be good enough to only consider the case where the > user types the paren and wants to remove them immediately (e.g., he placed > them in the wrong place, or wanted square brackets instead, or just changed > his mind). > In the case of meanwhile edits, I don't think the user would bother deleting > the closing paren himself. I think that hidden state like this can lead to confusing behavior. Probably you want to have deleting a paren do the same thing, regardless of what the character most recently typed was. Robby _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
On Sat, Nov 24, 2012 at 3:11 PM, Nadeem Abdul Hamid wrote: > On Sat, Nov 24, 2012 at 4:03 AM, Laurent wrote: > >> If you can, I think it would be a good idea to remove the paren pair if >> the user deletes the opening paren he just typed by mistake. Undo should do >> the same (which apparently it does not currently; missing >> 'begin/end-edit-sequence' ?). > > > Yeah, the undo behavior I've fixed. The first scenario you mention might > be tricky - how do you distinguish between typing an open paren and then > immediately deleting it vs. typing an open paren, making a bunch of other > edits, and then coming back and deleting the open paren? > I think it would already be good enough to only consider the case where the user types the paren and wants to remove them immediately (e.g., he placed them in the wrong place, or wanted square brackets instead, or just changed his mind). In the case of meanwhile edits, I don't think the user would bother deleting the closing paren himself. Another idea could be to remove the closing paren of the enclosed s-expr automatically; but there may be some cases where this could lead to undesired behaviors. Laurent _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
On Sat, Nov 24, 2012 at 4:03 AM, Laurent wrote: > If you can, I think it would be a good idea to remove the paren pair if > the user deletes the opening paren he just typed by mistake. Undo should do > the same (which apparently it does not currently; missing > 'begin/end-edit-sequence' ?). Yeah, the undo behavior I've fixed. The first scenario you mention might be tricky - how do you distinguish between typing an open paren and then immediately deleting it vs. typing an open paren, making a bunch of other edits, and then coming back and deleting the open paren? _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
If you can, I think it would be a good idea to remove the paren pair if the user deletes the opening paren he just typed by mistake. Undo should do the same (which apparently it does not currently; missing 'begin/end-edit-sequence' ?). Laurent On Fri, Nov 23, 2012 at 1:20 AM, Nadeem Abdul Hamid wrote: > Hello all, > > I've been discussing with Robby a possible improvement of DrRacket's > "automatic parentheses" behavior and would like to get a sense of others' > general opinion about this. What follows is a description of my proposal > and then some concrete questions. > > ;; > The idea is to have DrRacket automatically skip over > automatically-inserted closing parens if the user types one while the > cursor is right in front of one. (The Eclipse Java IDE does this with > various types of braces and parens, and in the past I've found this very > nice and have observed others (my students) interact well with such a > feature.) > > A concrete example: suppose you are in the process of typing the > expression "(+ 4 (- 1 2) 3)". After you type the first opening > parentheses and the characters following it up to the "2", the expression > in the editor looks like: > (+ 4 (- 1 2|)) > where the | represents the cursor's position. Note the two > automatically-inserted closing parens that are after the cursor right now. > With > the current implementation, you have to then use the right arrow key to > make the cursor skip past the first auto-inserted ")" and then you can > type "3". However, that really disrupts the typing process because even > if you don't type a ) as a habit and then realize you have to delete the > extra one, you still have to lift and move your finger to the arrow keys > area of the keyboard or type some other key combination to skip the > cursor forward. > > My proposal would be to have it so that if you type ")" in the editor > state above, it becomes: > (+ 4 (- 1 2)|) > and now you continue typing a space and the 3. Of course, the same thing > should apply for other types of parens - ( [ { etc. > > I don't know about others, but I actually get annoyed with the curent > automatic parens feature to the point of disabling it. That is, I like > the auto-parens feature not because it relieves me from having to type > closing parentheses - I don't mind that, and I actually tend to do that > automatically as I'm typing expressions; but the benefit is that it always > keeps parens balanced while I'm still in the middle of typing an > expression. However, with the current behavior, it tends to make me type > extra closing parentheses and have to go back and delete parens to balance > things up again. > > ;; > So, the questions: > > 1. Do you use the automatic parentheses feature of DrRacket? > > 2a. If yes, does the proposal above resonate well with you? > 2b. And, do you think this "smart skipping" of auto-inserted closing > parentheses should become the intrinsic behavior of the automatic > parentheses mode, or should it be a separate preference? (i.e. have two > preference options - the current automatic parentheses one and then a > subordinate option that enables/disables this skipping over of > auto-inserted closing parentheses as the user types them) > > 3. If your answer to #1 is "No", why not? (Is it because you find its > current behavior awkward in some way?) > > Thanks, > > nadeem > > > _ > Racket Developers list: > http://lists.racket-lang.org/dev > > _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
On Fri, Nov 23, 2012 at 1:20 AM, Nadeem Abdul Hamid wrote: > 1. Do you use the automatic parentheses feature of DrRacket? No. > 3. If your answer to #1 is "No", why not? (Is it because you find its > current behavior awkward in some way?) Yes. Typing close parentheses is much less hassle than having to move the cursor over autoinserted ones. I will certainly try the option you described, when/if available, and I will try to like it. Cheers P. _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
On 11/22/2012 05:20 PM, Nadeem Abdul Hamid wrote: 1. Do you use the automatic parentheses feature of DrRacket? No. I've disabled it and similar features on every code editor I've used. 2a. If yes, does the proposal above resonate well with you? Answering anyway: I would be willing to try it again if your proposal were implemented. 3. If your answer to #1 is "No", why not? (Is it because you find its current behavior awkward in some way?) I just have never liked it. I honestly can't say whether it was having to arrow over closing braces/parens or something else. Neil ⊥ _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Survey for DrRacket users related to automatic parentheses behavior
I use balanced parents. Agree with current annoyance. Agree with the proposal - simple, effective. On Nov 22, 2012 7:29 PM, "Nadeem Abdul Hamid" wrote: > Hello all, > > I've been discussing with Robby a possible improvement of DrRacket's > "automatic parentheses" behavior and would like to get a sense of others' > general opinion about this. What follows is a description of my proposal > and then some concrete questions. > > ;; > The idea is to have DrRacket automatically skip over > automatically-inserted closing parens if the user types one while the > cursor is right in front of one. (The Eclipse Java IDE does this with > various types of braces and parens, and in the past I've found this very > nice and have observed others (my students) interact well with such a > feature.) > > A concrete example: suppose you are in the process of typing the > expression "(+ 4 (- 1 2) 3)". After you type the first opening > parentheses and the characters following it up to the "2", the expression > in the editor looks like: > (+ 4 (- 1 2|)) > where the | represents the cursor's position. Note the two > automatically-inserted closing parens that are after the cursor right now. > With > the current implementation, you have to then use the right arrow key to > make the cursor skip past the first auto-inserted ")" and then you can > type "3". However, that really disrupts the typing process because even > if you don't type a ) as a habit and then realize you have to delete the > extra one, you still have to lift and move your finger to the arrow keys > area of the keyboard or type some other key combination to skip the > cursor forward. > > My proposal would be to have it so that if you type ")" in the editor > state above, it becomes: > (+ 4 (- 1 2)|) > and now you continue typing a space and the 3. Of course, the same thing > should apply for other types of parens - ( [ { etc. > > I don't know about others, but I actually get annoyed with the curent > automatic parens feature to the point of disabling it. That is, I like > the auto-parens feature not because it relieves me from having to type > closing parentheses - I don't mind that, and I actually tend to do that > automatically as I'm typing expressions; but the benefit is that it always > keeps parens balanced while I'm still in the middle of typing an > expression. However, with the current behavior, it tends to make me type > extra closing parentheses and have to go back and delete parens to balance > things up again. > > ;; > So, the questions: > > 1. Do you use the automatic parentheses feature of DrRacket? > > 2a. If yes, does the proposal above resonate well with you? > 2b. And, do you think this "smart skipping" of auto-inserted closing > parentheses should become the intrinsic behavior of the automatic > parentheses mode, or should it be a separate preference? (i.e. have two > preference options - the current automatic parentheses one and then a > subordinate option that enables/disables this skipping over of > auto-inserted closing parentheses as the user types them) > > 3. If your answer to #1 is "No", why not? (Is it because you find its > current behavior awkward in some way?) > > Thanks, > > nadeem > > > _ > Racket Developers list: > http://lists.racket-lang.org/dev > > _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Survey for DrRacket users related to automatic parentheses behavior
Hello all, I've been discussing with Robby a possible improvement of DrRacket's "automatic parentheses" behavior and would like to get a sense of others' general opinion about this. What follows is a description of my proposal and then some concrete questions. ;; The idea is to have DrRacket automatically skip over automatically-inserted closing parens if the user types one while the cursor is right in front of one. (The Eclipse Java IDE does this with various types of braces and parens, and in the past I've found this very nice and have observed others (my students) interact well with such a feature.) A concrete example: suppose you are in the process of typing the expression "(+ 4 (- 1 2) 3)". After you type the first opening parentheses and the characters following it up to the "2", the expression in the editor looks like: (+ 4 (- 1 2|)) where the | represents the cursor's position. Note the two automatically-inserted closing parens that are after the cursor right now. With the current implementation, you have to then use the right arrow key to make the cursor skip past the first auto-inserted ")" and then you can type "3". However, that really disrupts the typing process because even if you don't type a ) as a habit and then realize you have to delete the extra one, you still have to lift and move your finger to the arrow keys area of the keyboard or type some other key combination to skip the cursor forward. My proposal would be to have it so that if you type ")" in the editor state above, it becomes: (+ 4 (- 1 2)|) and now you continue typing a space and the 3. Of course, the same thing should apply for other types of parens - ( [ { etc. I don't know about others, but I actually get annoyed with the curent automatic parens feature to the point of disabling it. That is, I like the auto-parens feature not because it relieves me from having to type closing parentheses - I don't mind that, and I actually tend to do that automatically as I'm typing expressions; but the benefit is that it always keeps parens balanced while I'm still in the middle of typing an expression. However, with the current behavior, it tends to make me type extra closing parentheses and have to go back and delete parens to balance things up again. ;; So, the questions: 1. Do you use the automatic parentheses feature of DrRacket? 2a. If yes, does the proposal above resonate well with you? 2b. And, do you think this "smart skipping" of auto-inserted closing parentheses should become the intrinsic behavior of the automatic parentheses mode, or should it be a separate preference? (i.e. have two preference options - the current automatic parentheses one and then a subordinate option that enables/disables this skipping over of auto-inserted closing parentheses as the user types them) 3. If your answer to #1 is "No", why not? (Is it because you find its current behavior awkward in some way?) Thanks, nadeem _ Racket Developers list: http://lists.racket-lang.org/dev