spdegabrielle
2020-4-29 13:21:25

laurent.orseau
2020-4-29 13:42:57

Simplistic but fast answer: here’s a quickscript for that: #lang racket/base (require quickscript net/sendurl) (define-script open-url #:label "open-url" (λ (selection) (send-url selection) #f)) Select the url string in DrRacket, then click on Scripts > open-url and voilà.

A better version would look for the url string automatically at the position of the cursor, but I’ll let that as an exercise (happy to help though)


spdegabrielle
2020-4-29 13:55:50

nice. tyvm


laurent.orseau
2020-4-29 14:01:53

Even if you really want the (right-)click thing, making a quickscript that does the rest will help you test/debug.

To navigate the text editor to automatically select/get the full url string, you can play with the following #lang racket/base (require quickscript net/sendurl racket/class) (define-script open-url #:label "open-url" (λ (selection #:editor ed) ; look for the url in the editor: (send ed get-start-position) ; etc. (send-url the-url) #f))



spdegabrielle
2020-4-29 14:06:29

Robbie has indicated I’ll need to attack this in the colorer in https://github.com/racket/drracket/blob/master/drracket/drracket/private/unit.rkt


spdegabrielle
2020-4-29 14:07:26

I’m wondering how I edit DrRacket in https://github.com/racket/drracket/blob/master/drracket/drracket/private/unit.rkt without editing the instance of DrRacket I’m currently using.


spdegabrielle
2020-4-29 14:08:47

Forking and loading a local copy and running raco pkg install just gets me % raco pkg install Linking current directory as a package raco pkg install: package is currently installed in a wider scope package: drracket installed scope: installation given scope: user %


laurent.orseau
2020-4-29 14:12:02

Yes, if you want to the click thing, you’ll have to edit the colorer. But before you can get anything done there it’ll take some time and frustration (been there :wink: ), which is why I’d recommend going the quickscript way first, in particular because everything you’ll do in the script you’ll have to do it in the colorer too.


laurent.orseau
2020-4-29 14:12:45

@spdegabrielle Once you’re ready to put your hands in the cranks of DrRacket and the colorer, I highly recommend following this post: https://blog.racket-lang.org/2017/09/tutorial-contributing-to-racket.html


laurent.orseau
2020-4-29 14:14:10

Personally, I have a dev version of racket/DrRacket (with symlinks racket-dev and drracket-dev), and a user version. I edit code for the dev version in the user version.


spdegabrielle
2020-4-29 15:24:14

Thats what I’m trying to achieve


spdegabrielle
2020-4-29 15:24:31

currently ‘cloning’


laurent.orseau
2020-4-29 15:27:45

I first cloned racket/racket and compiled it, created the symlinks (also raco-dev). Then I followed the tutorial for cloning DrRacket


spdegabrielle
2020-4-29 15:38:18

what are the symlinks for?


laurent.orseau
2020-4-29 15:40:16

when you make it will create binaries in the build subdir. These binaries are racket, raco etc. I don’t touch these (as they may be rewritten later), but I have a racket-dev symlink to the racket binary, etc. I also have an installed nightly build of racket, which binary is also racket (but this one is installed globally).


spdegabrielle
2020-4-29 15:46:25

I’m only after an additional instance of drracket - I’m not delving into raco or racket . I’ve followed the instructions for a precompiled version of Racket(7.6 cs): > 1b. If you have a pre-compiled version of Racket … > If you have a compiled version of Racket, i.e. from https://download.racket-lang.org, the following pair of commands makes a clone of the repository for the package *&lt;PKG&gt;* in the current directory: $ raco pkg update --no-setup --catalog <https://pkgs.racket-lang.org> &lt;PKG&gt; $ raco pkg update --clone &lt;PKG&gt; at https://blog.racket-lang.org/2017/09/tutorial-contributing-to-racket.html I’m currently waiting for raco pkg update --clone drracket to complete. I’m not clear on how I can ‘run’ the cloned instance of DrRacket ?


spdegabrielle
2020-4-29 15:46:38

I’m not clear on how I can ‘run’ the cloned instance of DrRacket ?


laurent.orseau
2020-4-29 15:50:36

raco should automatically update its database, so if you run drracket it should run the cloned one


laurent.orseau
2020-4-29 15:51:18

but switching between the cloned and the base one is going to be tricky AFAICT if you have only one racket installation


laurent.orseau
2020-4-29 15:51:26

Not sure how others do it though


spdegabrielle
2020-4-29 15:58:45

I see now - I didn’t realise thats why you have two racket installations! (three including nightly?)


laurent.orseau
2020-4-29 15:59:18

I don’t have a stable one, only nightly+dev


laurent.orseau
2020-4-29 15:59:40

(although my nightly is often outdated)