spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
2020-04-09T17:53:31.197800Z

Say you just saved a .dir-locals.el file, how do you get spacemacs to start using it?

aisamu 2020-04-09T17:55:21.198200Z

I recall calling hack-dir-local-variables-non-file-buffer and it did work

aisamu 2020-04-09T17:55:41.198700Z

(Might not propagate to all buffers, though)

2020-04-09T17:58:14.200700Z

No, REPL is very different from your typical LSP server. Forgetting LSP, because that's more of a protocol interface, but it comes into play because its protocol isn't designed for REPL.

2020-04-09T17:58:30.201100Z

A REPL does not sync with the source code

2020-04-09T17:59:26.202700Z

It lives as a separate entity. LSP servers and other such static analysis tools are meant to provide feedback based on the source code, and are never out of sync and shouldn't be.

2020-04-09T17:59:48.203100Z

Thanks! I'll give it a shot.

2020-04-09T18:01:03.205400Z

This is because anything trying to not only understand the code, but actually run it faces all kind of additional issues, the code can be broken and fail to evaluate for example, it can perform side effects, etc. And it might not be possible to perfectly synchronized the loaded environment of a REPL with source code as it's changing

2020-04-09T18:01:25.206100Z

Might also not be desired to do so (like when you want to keep state around in the REPL)

2020-04-09T18:02:05.206500Z

In that sense, I think both could be complimentary

2020-04-09T18:03:12.208400Z

I'll give a little example. In Cursive, auto-complete is driven by the source code. In Cider, it is driven by the REPL.

2020-04-09T18:04:32.210700Z

So in Cider, until I send a form to the REPL to be evaluated it can't auto-complete it, even if it appears in my source code. In Cursive, if I send a form to the REPL that isn't in my source code, because I typed it in the REPL input and not on a source file, or.because I've deleted it, it can't auto-complete it.

2020-04-09T18:06:22.212400Z

The "dream" editor would do both in my mind. It would understand the source code itself and provide features based on that, and it would complement those with a live REPL if one is connected and add all the send to repl evaluation and loading logic.

2020-04-09T18:07:07.213500Z

Cider + clj-kondo/joker gets pretty close to this. There's a bit more that Emacs could do from just the source code, but still it's very good.

borkdude 2020-04-09T18:08:21.213900Z

@didibus This tool uses clj-kondo to generate a TAGS file which you can then use in emacs: https://github.com/sogaiu/alc.index-defs

borkdude 2020-04-09T18:08:37.214400Z

disclaimer: I've only used this a couple of times

2020-04-09T18:19:03.214600Z

Ya, I want to change s L for clojure major leader so that instead of clearing the repl output, it clears the REPL buffer

2020-04-09T18:19:41.214800Z

I also thought of changing s l to that as well.

2020-04-09T18:22:04.215Z

s l right now runs cider-repl-clear-buffer, which only clears the repl buffer if you are inside the repl buffer. And s L does cider-find-and-clear-repl-output

2020-04-09T18:22:24.215200Z

Which can clear the repl output no matter where you are

2020-04-09T18:23:12.215400Z

clearing output and clearing buffer is different. Output clears the last output, not the whole buffer. While clearing buffer clears the whole buffer

2020-04-09T18:23:37.215600Z

My thought was to make: s l clear the buffer no matter where you are, and s L clear the output no matter where you are

2020-04-09T18:23:59.215800Z

You think I should contribute a PR to clojure layer with that change?

2020-04-09T18:26:05.217200Z

Ya, I started looking into trying to add clj-kondo auto-complete to Emacs. I'm not a fan of the etags, don't like all the files it needs to create. But I'm still learning a bit how Emacs handles auto-complete, seeing what can be done.

2020-04-09T18:28:54.217900Z

I saw there is this thing called Semantic, wondering if it can be used, anyways... Just wanted to explain a conceptual difference

practicalli-john 2020-04-09T19:58:45.218Z

Reload or revert any buffer in the same project as the .dir-locals.el file

practicalli-john 2020-04-09T20:07:17.218200Z

People don't like changes to their keybinding... but usually only tell you about it afterwards. I almost never use the REPL buffer, although it seems people do and also push a lot of text through it as well, like logs which seems a recipe for slowing down Emacs.

practicalli-john 2020-04-09T20:10:33.218400Z

Rather than changing existing keybindings, there are a few other options.

practicalli-john 2020-04-09T20:11:16.218600Z

1) config to use SPC u with each if the existing keybindings to clear the whole buffer

practicalli-john 2020-04-09T20:12:04.218800Z

2) create 2 other keybindings to clear the whole buffer

zane 2020-04-09T20:14:03.219100Z

Re-running clojure-mode (or clojurec-mode, or …) also seems to work.

practicalli-john 2020-04-09T20:15:18.219300Z

Saying that, the change to SPC m s l would have no impact and seems to make sense. Capital letters typically represent a destructive action, so changing SPC m s L to clear the whole buffer makes sense.

practicalli-john 2020-04-09T20:17:39.219500Z

So yes, a PR for changing the commands for the existing keybindings seems okay. However, I do share any changes with this channel and on the Spacemacs Gitter chat, just so people know it's coming.

practicalli-john 2020-04-09T20:18:07.219700Z

If you want, I can do a PR for this tomorrow.

2020-04-09T20:32:38.219900Z

I have the code already, I can make a PR. I needed to write a new util function, because to find buffer and clear buffer you need to call cider-find-buffer-and-clear-output with the universal arg set

2020-04-09T20:34:01.220100Z

I might just change s l to be that. Like you said, it wouldn't break anyone, just allow them to also use it if they are not currently on the REPL buffer. Though I haven't tried it with multiple repl open. I don't know how it "finds" the right one in that case

2020-04-09T20:34:51.220300Z

BTW, at first I was mad at the binding changes you had made too, but now I've come to prefer them. Much better layed out, better mnemonics, so thanks for that

2020-04-09T20:39:25.220500Z

Thanks!