emacs 2025-05-31

Today I spent 8 hours typing by hand 70% of the https://github.com/magnars/emacsd-reboot/tree/main config of @magnars & @christian767. It is oriented towards clojure development and it is very good. I’ll continue to use it for the next week. I wrote some of my findings here for people who are interested: https://x.com/ovstoica/status/1928868679107891637

πŸ’― 1
❀️ 6
πŸŽ‰ 3

Curious about what you mean by in-buffer completions? Like automatic stuff? We've very consciously catered to as few interruptions and distractions as possible, so almost everything is user initiated.

Yes. That is what I meant. I’m used to always having completions there but I’ll give no auto completions a shot to see. Also, I love that somebody finally taught the REPL some respect πŸ˜„

πŸ˜„ 3

It's interesting to see your take on the config. πŸ˜„ Hope it suits you well!

🀘 1

The reboot config is full of nuggets! ❀️ The significant-other functionality is really nice, but is there a reason for not using ff-find-other-file? (just curious)

I would say the main reason is that it doesn't work. πŸ˜… At least for me.

Lol, that's a fair point πŸ˜„

I just tried it. It didn't do anything πŸ˜…

I got it working in my typescript setup. The mode-local ff-other-file-alist var must be configured, and I used this to get it working bidirectionally:

(defvar my/ts-other-file-alist
  '(("\\.test\\.ts$" (".ts" ".tsx"))
    ("\\.test\\.tsx$" (".tsx" ".ts"))
    ("\\.ts$" (".test.ts"))
    ("\\.tsx$" (".test.tsx" ".test.ts"))))

Looks a lot like the configuration of significant-other, I must say. πŸ˜…

πŸ˜… 1

Have you tried kaocha-runner.el yet? That's possibly my favourite part of the config! It's increased the value of good test coverage in code for me tenfold.

Oh yes πŸ₯° I've been asking about it here: https://clojurians.slack.com/archives/C06JZ4X334N/p1748769704586799

❀️ 1

Having worked full time with Christian and Magnar for half a year, I'd say they've discovered a really nice way to develop software that I hope other people copy!

❀️ 1

I haven’t yet tested it but it seems that the kaocha runner setup will run the tests from the SO file when you load the file in the REPL which is such a good idea!

It does! The "gigabrain move" here in my opinion is to add a test run as a hook to the "eval buffer" key binding. This gives you test runs for free whenever you want to load changes to the files you're editing.

Also what I want to see is a demo of the i18n multi file edit. I’ll come back with one of my tries in some time

Another awesome piece from it is hippie expand and the logic for it. I was not using it before adopting the config, and now I can’t stop using it lol. It is so good! Actually I’m using dabbrev-expand so maybe I should remap M-/ to hippie-expand

Got 'ff-find-other-file` working for clojure with the following config:

(setq ff-other-file-alist
        '(("_test\\.clj"
           (lambda (f)
             (list (s-with f
                     (s-replace "/test/" "/src/")
                     (s-replace "_test.clj" ".clj")))))
          ("\\.clj"
           (lambda (f)
             (list (s-with f
                     (s-replace "/src/" "/test/")
                     (s-replace ".clj" "_test.clj")))))))
Copied the s- stuff from the reboot config, as the elisp regexes are just completely unreadable to me πŸ˜…

Ok, so scratch that. I thought the lambdas would work here, but ff-find-other-file requires the function to be fboundp (which means that it needs to be bound to a var, right? excuse my elisp shortcomings). But this works,, but unnecessarily verbose:

(defun clj/test->src (f)
  (list (s-with f
          (s-replace "/test/" "/src/")
          (s-replace "_test.clj" ".clj"))))

(defun clj/src->test (f)
  (list (s-with f
          (s-replace "/src/" "/test/")
          (s-replace ".clj" "_test.clj"))))

(defun my/setup-clojure-mode ()
  ;; ...
  (setq ff-other-file-alist
        '(("_test\\.clj" clj/test->src)
          ("\\.clj" clj/src->test))))
Sorry for the spamming here, but if it is possible to use lambdas here somehow, then please let me know. Otherwise, a convenience function like with-significant-others would be useful (and then, why not copy the entire thing πŸ˜„)

Ok, so scratch that ... again. It works, but ff-find-other-file does not expose any functions for just resolving the file name. All the functionality - locating the file and opening the buffer - is baked into the same function. Which means that I can't do the really cool stuff that you do with autorunning with kaocha. Once again, sorry for the spamming.