emacs

Consider also joining #cider, #lsp and #inf-clojure, where most of the tool-specific discussions are happening.
bherrmann 2020-04-13T23:12:37.058800Z

How do I tell emacs that if the file starts with "#!/usr/bin/env bb" then it should use "clojure-mode" ? (or if the file ends in .bb)

bherrmann 2020-04-13T23:21:41.059300Z

I must have typed M-x clojure-mode - like 20 times today

2020-04-13T23:24:37.059700Z

Something like this, but with a couple of tweaks, in your ~/.emacs.d/init.el should do it: (setq auto-mode-alist (cons '("\\.c$" . c++-mode) auto-mode-alist))

2020-04-13T23:24:53.060Z

Probably (setq auto-mode-alist (cons '("\\.bb$" . clojure-mode) auto-mode-alist))

2020-04-13T23:25:41.060400Z

That will do it for the file name. I do not know how to make Emacs recognize the shebang line

2020-04-13T23:26:31.061400Z

There are Emacs-specific comment lines with special syntax inside the comments that Emacs recognizes for setting mode and any other local Emacs variables you want.

dpsutton 2020-04-13T23:26:59.062300Z

@bherrmann are you using inf-clojure ? I’m working on rewriting it so hopefully it gets much better across all the different repl types

1👀
bozhidar 2020-04-14T10:09:23.072700Z

Glad to hear this! We haven’t been able to give it enough love recently. What are you planning to tackle there exactly?

dpsutton 2020-04-14T13:12:13.074800Z

I’ve almost got a draft up. I’m wanting to be able to see which capabilities each repl type has and make it easy to ensure that it works for whatever repl is being used

dpsutton 2020-04-14T13:13:07.075700Z

The defcustoms were all over the place

bozhidar 2020-04-14T13:25:31.075900Z

Yeah, it’s definitely not my finest work. 😄

bozhidar 2020-04-14T13:26:35.076100Z

I think somewhere I had suggested to have the expressions for each REPL type in some maps to avoid the crazy amount of vars we have for them now.

bozhidar 2020-04-14T13:27:41.076300Z

Probably adding some minimal support for prepl would be nice - we already have support for the socket repl and prepl is the same, but with structured output, which now is easy to parse with parseedn.

dpsutton 2020-04-14T13:39:17.076500Z

ah yes!

2020-04-13T23:27:29.062700Z

Here are Emacs docs on setting local variables inside of specially formatted comments: https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables

2020-04-16T22:27:15.085600Z

Cool, didn't know that. Love Emacs haha

bherrmann 2020-04-13T23:30:56.063300Z

I'm just using vanialla emacs (with cider installed) with a .emacs that I've dragged along with me for like 30 years.

dpsutton 2020-04-13T23:32:37.063700Z

So no connected repl running bb?

bherrmann 2020-04-13T23:33:06.064Z

 (setq auto-mode-alist (cons '("\\.bb$" . clojure-mode) auto-mode-alist))
this fixes the .bb file loading

bherrmann 2020-04-13T23:34:03.065Z

I've used cider-connect with bb, but only a little yesterday.... typically... I have a terminal where I do the running, and emacs where I do the editing.... I'm aware of the productivity gains from only evaling in emacs... but I'm new to bb... so I'm keeping it where I can watch it closely...

bherrmann 2020-04-13T23:49:35.066700Z

This seems to put emacs in the right mode....

#!/usr/bin/env bb

;; Local Variables:
;; mode: clojure
;; End:

3👍