Re: [racket-users] DrRacket stubbornly indents code as if it were Racket
Hi Yuhao: The Scribble indentation mode is currently implemented by adding a keymap that overrides the tab key. You can find the implementation here of the callback itself here: https://github.com/racket/gui/blob/master/gui-lib/scribble/private/indentation.rkt and the code that communicates with DrRacket to install it is here: https://github.com/plt/racket/blob/master/pkgs/at-exp-lib/scribble/base/reader.rkt You can find documentation on how that wiring works here: http://docs.racket-lang.org/tools/Editor_Modes.html?q=definitions-text-surrogate#%28idx._%28gentag._27._%28lib._scribblings%2Ftools%2Ftools..scrbl%29%29%29 hth, Robby On Mon, Jun 15, 2015 at 11:20 PM, Yuhao Dong yd2d...@uwaterloo.ca wrote: Greetings Racketeers, I'm trying to make my own #lang that has a non-sexp syntax, like Scribble. However, the problem is the DrRacket always tries to indent my code as if it were Racket, which is extremely unusable and annoying. Since changing DrRacket's indenting behaviors seems undocumented, I looked at how Scribble did it, and then I put what I thought must be correct code here: https://github.com/quantum1423/mir/blob/master/lang/reader.rkt However, DrRacket still indents my code as if it were Racket, although it does turn off syntax highlighting correctly. I added the with-output-to-file line to see if the drracket:indentation branch is ever executed, but apparently it isn't. How does Scribble manage to get DrRacket to indent it in a non-sexp way? Thanks! Yuhao Dong -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] DrRacket stubbornly indents code as if it were Racket
You can select the text mode in the menu EditModes(near the bottom)Text mode It disables indentation, but it may disable too many features. For example it disables also parens matching :( . And it also disables background syntax expansion, but you can still use the check syntax button manually. (Perhaps you can create a no-indent mode, I didn't look at the code.) Gustavo On Tue, Jun 16, 2015 at 1:20 AM, Yuhao Dong yd2d...@uwaterloo.ca wrote: Greetings Racketeers, I'm trying to make my own #lang that has a non-sexp syntax, like Scribble. However, the problem is the DrRacket always tries to indent my code as if it were Racket, which is extremely unusable and annoying. Since changing DrRacket's indenting behaviors seems undocumented, I looked at how Scribble did it, and then I put what I thought must be correct code here: https://github.com/quantum1423/mir/blob/master/lang/reader.rkt However, DrRacket still indents my code as if it were Racket, although it does turn off syntax highlighting correctly. I added the with-output-to-file line to see if the drracket:indentation branch is ever executed, but apparently it isn't. How does Scribble manage to get DrRacket to indent it in a non-sexp way? Thanks! Yuhao Dong -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
RE: [racket-users] DrRacket stubbornly indents code as if it were Racket
I'm clearly referring to the mechanism in which a #lang can tell DrRacket to use a different indenting mode in Racket mode, not anything to do with text mode. From: gust...@oma.org.ar Date: Tue, 16 Jun 2015 10:22:43 -0300 Subject: Re: [racket-users] DrRacket stubbornly indents code as if it were Racket To: yd2d...@uwaterloo.ca CC: racket-users@googlegroups.com You can select the text mode in the menu EditModes(near the bottom)Text mode It disables indentation, but it may disable too many features. For example it disables also parens matching :( . And it also disables background syntax expansion, but you can still use the check syntax button manually. (Perhaps you can create a no-indent mode, I didn't look at the code.) Gustavo On Tue, Jun 16, 2015 at 1:20 AM, Yuhao Dong yd2d...@uwaterloo.ca wrote: Greetings Racketeers, I'm trying to make my own #lang that has a non-sexp syntax, like Scribble. However, the problem is the DrRacket always tries to indent my code as if it were Racket, which is extremely unusable and annoying. Since changing DrRacket's indenting behaviors seems undocumented, I looked at how Scribble did it, and then I put what I thought must be correct code here: https://github.com/quantum1423/mir/blob/master/lang/reader.rkt However, DrRacket still indents my code as if it were Racket, although it does turn off syntax highlighting correctly. I added the with-output-to-file line to see if the drracket:indentation branch is ever executed, but apparently it isn't. How does Scribble manage to get DrRacket to indent it in a non-sexp way? Thanks! Yuhao Dong -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] DrRacket stubbornly indents code as if it were Racket
You will need to find where drracket parses the first line and then install the mode that you want. I do not know whether a language per se can access this line. But we are moving toward #lang precisely for that purpose. I am sure Robby will welcome proposal on how to change this and even patches (he's currently in a different time zone). -- Matthias On Jun 16, 2015, at 10:04 AM, Yuhao Dong yd2d...@uwaterloo.ca wrote: I'm clearly referring to the mechanism in which a #lang can tell DrRacket to use a different indenting mode in Racket mode, not anything to do with text mode. From: gust...@oma.org.ar Date: Tue, 16 Jun 2015 10:22:43 -0300 Subject: Re: [racket-users] DrRacket stubbornly indents code as if it were Racket To: yd2d...@uwaterloo.ca CC: racket-users@googlegroups.com You can select the text mode in the menu EditModes(near the bottom)Text mode It disables indentation, but it may disable too many features. For example it disables also parens matching :( . And it also disables background syntax expansion, but you can still use the check syntax button manually. (Perhaps you can create a no-indent mode, I didn't look at the code.) Gustavo On Tue, Jun 16, 2015 at 1:20 AM, Yuhao Dong yd2d...@uwaterloo.ca wrote: Greetings Racketeers, I'm trying to make my own #lang that has a non-sexp syntax, like Scribble. However, the problem is the DrRacket always tries to indent my code as if it were Racket, which is extremely unusable and annoying. Since changing DrRacket's indenting behaviors seems undocumented, I looked at how Scribble did it, and then I put what I thought must be correct code here: https://github.com/quantum1423/mir/blob/master/lang/reader.rkt However, DrRacket still indents my code as if it were Racket, although it does turn off syntax highlighting correctly. I added the with-output-to-file line to see if the drracket:indentation branch is ever executed, but apparently it isn't. How does Scribble manage to get DrRacket to indent it in a non-sexp way? Thanks! Yuhao Dong -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email toracket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email toracket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] DrRacket stubbornly indents code as if it were Racket
Greetings Racketeers, I'm trying to make my own #lang that has a non-sexp syntax, like Scribble. However, the problem is the DrRacket always tries to indent my code as if it were Racket, which is extremely unusable and annoying. Since changing DrRacket's indenting behaviors seems undocumented, I looked at how Scribble did it, and then I put what I thought must be correct code here: https://github.com/quantum1423/mir/blob/master/lang/reader.rkt However, DrRacket still indents my code as if it were Racket, although it does turn off syntax highlighting correctly. I added the with-output-to-file line to see if the drracket:indentation branch is ever executed, but apparently it isn't. How does Scribble manage to get DrRacket to indent it in a non-sexp way? Thanks!Yuhao Dong -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.