@adrian has joined the channel
@spdegabrielle is there an easy way to configure all drracket preferences entirely with a #lang <something>
program? something a person could stick in their “dotfiles” repo
@notjack on osx it is ~/Library/Preferences/org.racket-lang.prefs.rktd
not exactly valid scheme tho
esp not valid racket, as there is no hashlang
that’s a big old hash meant for read
I presume?
I’d like a program I could write rather than plain data
minus a quote mark? I guess?
I would like to find the code that creates that, so you could write a program that actually saves off your differences
though the existence of that file means I could probably write a lang that makes a program that sets that file when run
Check out share/pkgs/drracket/drracket/tool-lib.rkt
tool-lib is for making DrRacket Plugins
@notjack @spdegabrielle @zenspider That file is generally accessed through the framework
collection.
Its kind of…err…disgusting. :confused:
(Not because its badly written per se, just that its way outgrown what it was originally designed to do. :wink: )
But…if you do want to set it without permanently changing it for the user, that is possible.
Umm…let me dig up some old code for you (if I can find it)
(define (tabify-file file)
(parameterize* ([preferences:low-level-put-preferences
(λ _ (void))]
[preferences:low-level-get-preference
(λ _ #f)])
(define t (load-file file))
(define untabbed (send t get-text))
(define tabbed
(let ()
(match-define (list table rx1 rx2 rx3 rx4)
(preferences:get 'framework:tabify))
(hash-remove! table 'big-bang)
(preferences:set 'framework:tabify
(list table rx1 rx2 rx3 rx4))
(send t tabify-all)
(send t get-text)))
(define lambda-tabbed
(let ()
(match-define (list table rx1 rx2 rx3 rx4)
(preferences:get 'framework:tabify))
(hash-set! table 'big-bang 'lambda)
(preferences:set 'framework:tabify
(list table rx1 rx2 rx3 rx4))
(send t tabify-all)
(send t get-text)))
(values untabbed tabbed lambda-tabbed)))
In this case, its just setting the indentation preferences.
(For a given text%
object.
The whole sample is here: https://gist.github.com/LeifAndersen/c5cd6946c8b92ed7e4393acf04e2fd4f
@notjack @spdegabrielle @zenspider hope that helps. :slightly_smiling_face:
I recognize that code… :slightly_smiling_face: