eeide
2019-1-25 16:21:49

I want to install a Scribble mode for GNU Emacs. There seem to be two: https://github.com/emacs-pe/scribble-mode https://www.neilvandyke.org/scribble-emacs/ Is one preferred over the other? The former appears to be available via MELPA. A quick look at the code suggests that the latter is maybe more featureful (?).


soegaard2
2019-1-25 16:24:46

@eeide Haven’t tried them. However the file size of Neil’s mode is greater than the file size of emacs-pe.


soegaard2
2019-1-25 16:24:59

Maybe @pmatos knows more?


leif
2019-1-25 17:09:14

Is it just me or is build-path/convention-type not really useful for building paths for the system you’re not on.


leif
2019-1-25 17:09:30

For example, on unix, the following fails:

(build-path/convention-type 'windows "foo")

leif
2019-1-25 17:09:54

With the error: . . build-path/convention-type: specified convention incompatible with string path element path element: "foo" convention: 'windows


leif
2019-1-25 17:10:51

@soegaard2 Thanks anyway.


leif
2019-1-25 17:11:05

But I can make a path with (bytes->path #"foo" 'windows)


leif
2019-1-25 17:11:42

But I think I remember @mflatt saying a while back that string->path and bytes->path are not as good of a way to create paths as build-path. I could be mis-remembering though.


soegaard2
2019-1-25 17:13:06

You are. The quote is: >Roughly, strings don’t work, because they have to be converted to bytes >using the locale’s default encoding. Although strings are allowed for >the current platform’s convention on the assumption that the current >locale’s encoding is the right one, we’ve avoided building in any >assumption about the encoding for the other convention.


soegaard2
2019-1-25 17:13:45

So use byte strings with build-path/convention-type.


leif
2019-1-25 17:14:15

@soegaard2 but byte string fail to match build-path/convention-type’s contract.


soegaard2
2019-1-25 17:14:25

huh?


leif
2019-1-25 17:14:35

About the best I’ve got so far is: (build-path/convention-type 'windows (bytes->path #"C:" 'windows) (bytes->path-element #"foo" 'windows) (bytes->path-element #"bar" 'windows)) which is very ugly


leif
2019-1-25 17:15:15

@soegaard2 the contract for, say, ‘base’, in build-path is:

(or/c path-string? path-for-some-system? 'up 'same)


soegaard2
2019-1-25 17:15:16

Oh. Yeah. The example is: (define (bs->p bs) (bytes->path bs 'unix)) (build-path/convention-type 'unix (bs->p #"/") (bs->p #"foo") (bs->p #"bar"))


soegaard2
2019-1-25 17:15:42

Time to make my-build-path !


leif
2019-1-25 17:16:44

Makes sense.


leif
2019-1-25 17:17:03

I wonder if it would make sense to modify make-path/convention-type to be a little less insane.


soegaard2
2019-1-25 17:17:27

File paths are insane.


jesse
2019-1-25 17:17:46

paths drive me crazy


leif
2019-1-25 17:19:42

@soegaard2 and @jesse yes…yes they are…sigh.


leif
2019-1-25 17:20:11

Although honestly, this seems like a level up in terms of insanity to me. Like, maybe I’m missing something as to why the following wouldn’t work:


leif
2019-1-25 17:20:55

(build-path/convention-type 'windows #"C:" #"foo" #"bar")


leif
2019-1-25 17:21:26

Which seems like it should generate #<windows-path:"C:\foo\bar">


jesse
2019-1-25 17:25:28

sounds…reasonable


jesse
2019-1-25 17:25:51

(…is windows-path really a thing?)



jesse
2019-1-25 17:32:23

utf–16!


samth
2019-1-25 18:05:37

yeah that’s the same encoding that you might have known as WTF8


andreiformiga
2019-1-25 18:51:58

unicode means 16-bit wide chars, right? that’s what we thought in the 90s


samth
2019-1-25 18:53:23

@greg it appears that if I start emacs with PLTADDONDIR set, racket-mode doesn’t respect that


greg
2019-1-25 20:15:16

@samth I’m not at all familiar with PLTADDONDIR. From reading the docs, I’m not sure what racket-mode ought to do. What would be an example of something racket-mode didn’t do, that you expected?


samth
2019-1-25 20:28:25

@greg for example, it needs to look there to find the collections needed by the file I’m running


greg
2019-1-25 20:30:22

OK. I’ll see if maybe command-line Racket does this via, what’s it called, racket/init, and also see what DrR does in this regard.


samanvithasundar2020
2019-1-25 20:37:18

@samanvithasundar2020 has joined the channel


samth
2019-1-25 20:38:10

@greg DrRacket works correctly here


samth
2019-1-25 20:38:33

but it’s not doing something in racket/init, it’s much lower level


greg
2019-1-25 20:38:34

@samth It looks to me like the default value of current-library-collection-paths — which racket-mode does not set otherwise — is supposed to be result of find-library-collection-paths, and that is what is supposed to include (a subdir of) addon-dir: https://docs.racket-lang.org/reference/collects.html#(def._((quote._~23~25kernel)._find-library-collection-paths))


samth
2019-1-25 20:38:55

you just want to carry over the environment variable, I think


samth
2019-1-25 20:40:17

the alternative would be to read the environment variable and then pass it via -A on the command line


samth
2019-1-25 20:41:03

or (maybe) read the environment variable and the set current-library-collection-paths and various other things yourself but that sounds unlikely to be the right approach


greg
2019-1-25 20:42:16

I think current-library-collection-paths is supposed to default to find-library-collection-paths.


greg
2019-1-25 20:42:34

And racket-mode doesn’t do anything to fubar that, AFAICT.


greg
2019-1-25 20:42:55

Running racket-mode with (say) 6.10: Welcome to Racket v6.10. foo.rkt> (find-library-collection-paths) ;(current-library-collection-paths) gives identical result '(#<path:/Users/greg/Library/Racket/6.10/collects> #<path:/Applications/Racket_v6.10/collects>) foo.rkt> (find-system-path 'addon-dir) #<path:/Users/greg/Library/Racket/>


greg
2019-1-25 20:43:05

Does that seem correct to you?


greg
2019-1-25 20:44:36

With a build of HEAD it’s Welcome to Racket v7.2.0.2. foo.rkt> (find-library-collection-paths) ;(current-library-collection-paths) gives identical result '(#<path:/Users/greg/Library/Racket/development/collects> #<path:/Users/greg/src/racket-lang/racket/collects>) foo.rkt> (find-system-path 'addon-dir) #<path:/Users/greg/Library/Racket/>


greg
2019-1-25 20:46:18

@samth What does it look like for you? And, is (find-system-path 'addon-dir) as you expect, does it match the env var?


samth
2019-1-25 21:05:48

@greg, sorry, this was a problem with weird package/environment config stuff I did


samth
2019-1-25 21:06:05

I fixed that and racket-mode started doing the right thing


samth
2019-1-25 21:06:28

although it still does something strange


samth
2019-1-25 21:06:39

that might be about sandboxing?


samth
2019-1-25 21:07:19

but that problem is less obvious what’s going on so I’ll report more later


greg
2019-1-25 21:08:34

@samth No worries, glad to hear the immediate problem is resolved. Curious to hear more later about Stranger Things.


siddh
2019-1-25 23:07:16

@siddh has joined the channel