
@radevich.alex has joined the channel

Oh, I misread your question. Thought that you just wanted a syntax highlight in terminal. Didn’t see the keyword REPL

Does anyone know of any good (inspirational?) screencasts or talks showing work flows with for example racket-mode/geiser and emacs and with DrRacket?

Greg presented racket-mode at racketcon.


Thanks, that one is good! It is the only one I saw so far together with a geiser talk

The one from RacketCon 4 is the first. At RacketCon 9 new features were presented.

John Clements has some videos using DrRacket: https://www.youtube.com/channel/UCxmd9H0WC2vieAsgJVJ_pNA

Cool, I’ll take a look! :thumbsup:

@haakonhr Although it might be obvious stuff (and it’s not a video) awhile ago I wrote https://www.greghendershott.com/2014/11/racket-workflow.html

Definitely some nice tips there. I have looked around your blog before, but I have a tendency to not go too far back in the past (although maybe I should re-consider this habit in the racket world?)

That’s part of the reason I like old articles on Racket Stories.

“Know the classics” :slightly_smiling_face:

only had that one song on American Bandstand in the 70s; just been playing State Fairs and dive bars ever since

American Bandstand - now that’s an old reference.

Was raco exe
changed in 7.6 on macOS to embed Racket inside the generated executables?

I can see a __PLTSCHEME
segment in the exe so I’m guessing so.


Sweet!

read-compiled-linklet: version mismatch expected: "7.7.0.4" found: "7.6" in: /Users/spdegabrielle/Dev/drracket/drracket/drracket/drracket/private/compiled/insulated-read-language_rkt.zo
Why do I get this error when I edit a different version of DrRacket (I’m using a nightly 7.7nnn to edit unit.rkt
in DrRacket 7.6)

The folder compiled
where DrRacket stores zo-files has no versioning. You can turn off the use of compiled files in the languages dialog under advanced.

Which option does turns it off?

The “populate’ one. But that’s turned off already I see.

Try deleting every file in compiled/

Is the goal to edit and run a part of the DrRacket 7.6 implementation using version 7.7.0.4? I expect there are multiple obstacles to that, besides starting with mismatched “.zo” files.

no I’m

im

I am nbot up to editing yet

I’m looking at unit.rkt to try identify the colorer

if I can get to a point where I make an edit I expect to run it under 7.6

Do you mean that “unit.rkt” as part of 7.6 doesn’t even open for editing in v7.7.x? I’d expect an error at the bottom of the window from background expansion, and so you won’t get various tools, but I’d expect you to be able to edit the text of the module.

(Until I get round to setting up a dev environment where I have two instance of the whole thing)

It opens fine. I was wondering if I could turn the zo check off. The error isn’t terribly unexpected

Maybe you want to disable background expansion by clicking on the dot in the lower-right corner.

I did try opening unit.rkt 7.6 from DrRacket 7.6 - probable a bad idea

I’ll do that. In the meantime - can you point me to the colorer?

I think that’s in the framework…


Ok

I’m trying to identify urls in comments (only text after ;
nothing fancy)

to make them clickable. robby suggested using the same mechanism that aspell uses at the level of the colorer.

I expect the color canvas to be in the gui framework, but I was thinking behaviour would be in unit.rkt

the behavior is in the colorer

in gui-lib/framework/private/color.rkt

I think a good start is to use techniques similar to how aspell works and just start by making the urls a different color.

Maybe even just pretend that urls are “missepelled” in the sense that you’d use all the coloring set up for misspelled words but just turn it on for urls that you find.

then after that figure out how to plumb a new color thought.

through

and then figure out how to add a callback that handles clicking on them.

That’s how I’d try breaking down the task, anyway.

It will probably help to understand the basic idea of how the colorer works.

and how the spelling works

I’m reading it now :slightly_smiling_face: gui-lib/framework/private/color.rkt

yeah, the do-colorings
method

You’ll want something that is used the way do-spelling-color
is used, but instead of looking misspelled words, looks for urls.

Oh, but you want to look in comments, not in strings.

So that’ll be different too.

thank you. Yes

in comments

anyway, good luck!

why not anywhere in the source come to think of it?

Thank you @robby !(& @mflatt)

I would probably stick with urls that are inside just one kind of thing (where by “kind of thing” I mean “thing the colorer is already treating as a single unit” like a string or a comment)

If you wanted to do something that spanned categories somehow, you’d need to do a lot more work, I guess.

I’m not sure, tho. Maybe there’s some nice way to use some lower layer to avoid the trouble of dealing with the colorer.

I see. I was hoping to avoid work.

cooperating with the color is what I see as avoiding work :slightly_smiling_face:

advice taken.

I think I found it do-spelling-color
! a beginnign anyway…

I’m interested in sub-colorings as well. I have a habit of refactoring code when reading it, and for add-coloring
in particular it’s in case I need duplicate parts of color.rkt to get at that private behaviour. So I’ve made a pull request with some of that : https://github.com/racket/gui/pull/181 , which at least might be informative even if it’s not accepted.

@gfb we are both looking at the <https://github.com/racket/drracket/issues/367|same thing>, but I think you are further along than me.

@robby if clickable hyperlinks become an official part of drracket, do you have a preference for whether add-coloring
should change versus making add-coloring
public?

I don’t think it makes sense to make add-coloring public

but I don’t know what you have in midn

mind

For overriding to extend its behavior.

Oops, I meant add-colorings.

I think it makes sense to change the colorer to support urls by changing its implementation

if you have in midn something extensible that could also make sense and might involve new, overridable methods.

I would very much like something extensible, and the existing add-colorings
seems to be an ideal interposition point. It’s called only once and the arguments are publicly meaningful.

do you promise to maintain it for all eternity? :wink:

in all seriousness, if you want to add extensibility that’s fine.

I think taking the existing set of functions that making them public may not be the best way to design for extensibility, however.

Surely it makes sense to implement urls first and then step back and see where the common parts are and think about what others might want, etc.

I mean, that may be the right move in the end, but is it the first step in this process?

Ok, I’ll just note that a better abstraction boundary is a few lines into add-colorings
, just after (define style-name (token-sym->style type))
. After that point the implementation doesn’t use anything private.

Where does raco pkg config --set
store its information?

~/Library/Racket/7.6/pkgs/config.rktd
on Mac OS

Thanks.

I’m using serve/servlet
to serve static files . It looks like the result got cached, so after I updated my static files, it still serves the old content. How do I invalidate the cache?

Ah, nvm, refresh works. I killed the web server right away after it opens up my browser. If I don’t kill it and refresh, I get the desired content

@spdegabrielle you should follow https://github.com/gfbee/gui/tree/clickable-urls , although I might not have time to continue with it for a while (I just happened to be looking at the relevant part of color.rkt recently). Right now it colors the text “http” within comments with the error color, finding those with a helper similar to do-spelling-color
(modernzed and commented), which might give you or someone else an encouraging base to continue with.