adrian
2018-1-3 13:11:31

@adrian has joined the channel


notjack
2018-1-3 21:51:24

@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


zenspider
2018-1-3 21:56:01

@notjack on osx it is ~/Library/Preferences/org.racket-lang.prefs.rktd


zenspider
2018-1-3 21:56:49

not exactly valid scheme tho


zenspider
2018-1-3 21:56:59

esp not valid racket, as there is no hashlang


notjack
2018-1-3 21:57:01

that’s a big old hash meant for read I presume?


notjack
2018-1-3 21:57:15

I’d like a program I could write rather than plain data


zenspider
2018-1-3 21:57:24

minus a quote mark? I guess?


zenspider
2018-1-3 21:57:52

I would like to find the code that creates that, so you could write a program that actually saves off your differences


notjack
2018-1-3 21:57:53

though the existence of that file means I could probably write a lang that makes a program that sets that file when run


zenspider
2018-1-3 22:01:42

Check out share/pkgs/drracket/drracket/tool-lib.rkt



spdegabrielle
2018-1-3 22:31:01

tool-lib is for making DrRacket Plugins


leif
2018-1-4 00:42:57

@notjack @spdegabrielle @zenspider That file is generally accessed through the framework collection.


leif
2018-1-4 00:43:08

Its kind of…err…disgusting. :confused:


leif
2018-1-4 00:43:28

(Not because its badly written per se, just that its way outgrown what it was originally designed to do. :wink: )


leif
2018-1-4 00:44:28

But…if you do want to set it without permanently changing it for the user, that is possible.


leif
2018-1-4 00:44:40

Umm…let me dig up some old code for you (if I can find it)


leif
2018-1-4 00:46:28
(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)))

leif
2018-1-4 00:46:48

In this case, its just setting the indentation preferences.


leif
2018-1-4 00:47:12

(For a given text% object.


leif
2018-1-4 00:48:22

leif
2018-1-4 00:48:34

leif
2018-1-4 00:48:35

leif
2018-1-4 00:49:20

@notjack @spdegabrielle @zenspider hope that helps. :slightly_smiling_face:


blerner
2018-1-4 02:24:49

I recognize that code… :slightly_smiling_face: