Fork me on GitHub
#emacs
<
2022-04-18
>
wilkerlucio17:04:19

hello folks, I wanna start learning emacs for Clojure development, where is a good place to starting reading about doing the setup?

👋 1
lilactown18:04:35

after a cursory glance, https://practical.li/spacemacs/ seems to cover the essentials and be relatively up to date

👀 1
👆 1
nivekuil18:04:47

depends where you're coming from but I say just start with vanilla emacs and read the CIDER docs, then see what you don't like and go from there

wilkerlucio18:04:02

I like to have a modern setup (cider + lsp), I have years on Vim, currently on years on IntelliJ, but no experience with Emacs (even moving cursor still strange, rsrs)

nivekuil18:04:45

if you like vim bindings then spacemacs is good

☝️ 1
lilactown18:04:18

i never was able to get traction with Emacs until I started again with spacemacs. YMMV

lilactown18:04:29

it is very "batteries included"

ericdallo18:04:33

I highly suggest using #doom-emacs , you can enable clojure module + lsp flag and most everything should work OOTB

❤️ 1
lilactown18:04:16

I've heard of doom. what's the sell over spacemacs for clojure dev?

wilkerlucio18:04:43

curious on this one as well

nivekuil18:04:54

I understand doom to be much less opinionated than spacemacs, like you can break out of it and evolve it to be more customized easily

nivekuil18:04:19

but I have never used either :) vanilla gang

nivekuil18:04:39

the benefits of vanilla are that the defaults are so bad it forces you to learn emacs lisp

😆 3
ericdallo18:04:20

IMO doom startup speed is insane.. it pre-compiles all packages used by your config and has a great tool to manage upgrades and package updates, also it has support for emacs native-compilation which is something that is really handful

1
☝️ 3
ericdallo18:04:41

I know spaceemacs supports modules, but it seems to me doom's modules are easier to configure/customize

nivekuil18:04:41

not sure why spacemacs wouldn't support native-comp, does it only support an old emacs version? native-comp is really nice

nivekuil18:04:05

in general startup speed is irrelevant because people run emacs as a daemon and then use emacsclient which starts up instantly and doesn't lose state. very handy for programming over SSH from your phone for example.

lilactown18:04:57

i always have emacs running, but i do have general performance issues sometimes when using e.g. autocomplete

ericdallo18:04:23

yeah, I'm one of the people that use that, but at least at Nubank, this is not common as it seems it doesn't work for MacOs (I'm not a mac user)

lilactown18:04:24

haven't tried the latest emacs yet. hoping native compilation will help

ericdallo18:04:41

native-comp and emacs 27+ helps with that for sure @U4YGF4NGM

César Olea20:04:11

@UKFSJSM38 I have emacs running as a daemon with native-comp in macOS. I can hit cmd + e and a new emacs frame pops up instantly, ready to go. Let me know if you would like any assistance. That being said, it's way easier to achieve the same in Linux.

ericdallo20:04:59

Oh, I'd love to understand what are the steps necessary to make that work, know lots of co-workers that would love to have that working

ericdallo20:04:23

I know there are multiple ways to install emacs on mac, I bet that affects if daemon will work

wilkerlucio20:04:04

@UKFSJSM38 when I installed with brew install emacs it setup the daemon by default here (the output of install talked about it, and how to restart it and etc...)

ericdallo20:04:27

but does that install what emacs version and with native-comp support?

wilkerlucio20:04:45

it did install 28, not sure about the native-comp thing

wilkerlucio20:04:10

is there a way to check if its native-comp or not?

ericdallo20:04:13

hum, interesting, at Nubank mac users install via:

brew install emacs-plus@28 --with-native-comp

wilkerlucio20:04:30

I'm currently running this one to see the result

wilkerlucio20:04:54

just finished, seems like the daemon is an option here too:

 was installed to:
  /usr/local/opt/emacs-plus@28

To link the application to default Homebrew App location:
  ln -s /usr/local/opt/emacs-plus@28/Emacs.app /Applications

To start d12frosted/emacs-plus/emacs-plus@28 now and restart at login:
  brew services start d12frosted/emacs-plus/emacs-plus@28
Or, if you don't want/need a background service you can just run:
  emacs

wilkerlucio20:04:05

with the brew services

ericdallo20:04:08

yes, I think this tells if it's native compiled: M-x

(and (fboundp 'native-comp-available-p)
            (native-comp-available-p))

César Olea20:04:00

How you do it depends on two things: 1. Whether or not you want native compilation (also known as gcc emacs) 2. Whether your are on an intel mac or not If you are only interested in running emacs as a daemon but don't need/want gcc emacs, it's just a matter of downloading emacs, say from https://emacsformacosx.com/ and then use macOS launch agent to launch emacs server at startup, here's a nice guide for it: https://briansunter.com/blog/emacs-daemon-macos/ Once you get it running, test that it's working by going to the terminal and executing /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c it should open up an emacs frame. With the emacs server started in the background you can then setup something like skhd to use a global keybinding, so that you can invoke a new emacs frame from anywhere.

César Olea20:04:27

I'm on a m1 mac, so to get gcc emacs working I used https://github.com/jimeh/build-emacs-for-macos/ and used one of the "known good commits" listed here https://github.com/jimeh/build-emacs-for-macos/issues/6

César Olea20:04:34

My version of emacs is reported as 29.0.50.

ericdallo20:04:20

tks @U02DNF3TW3E, will tell to a coworker to give a try following that and let you know if any issues!

wilkerlucio20:04:13

@UKFSJSM38 seems like running brew services start d12frosted/emacs-plus/emacs-plus@28 after installing with brew install emacs-plus@28 --with-native-comp also works

ericdallo20:04:33

awesome! good to know!

César Olea20:04:08

I tried using the emacs-plus version in brew to get gcc emacs working in a m1 mac but it wouldn't work. Everything compiles but when loading up emacs it would complain about not being able to use libgccjit. YMMV though.

wilkerlucio20:04:03

can you guys tell me the difference between the emacs and emacs-plus packages?

ericdallo20:04:23

I have no idea 😂

lilactown20:04:30

there are various ways of packaging emacs and several forks to run on different platforms, using different GUI frameworks

César Olea20:04:18

No idea honestly. For the longest time I used to run whatever https://emacsformacosx.com/ had and it was fine. Then I switched to linux and used whatever was in the repo of the distribution that I was using, until finally settled in building my own.

lilactown21:04:40

i think main emacs has come a ways in supporting native macOS GUI (cocoa) since i started using it

lread22:04:45

If you do go for doom (I’m was on spacemacs now on doom), there’s #doom-emacs And @UKFSJSM38’s https://github.com/ericdallo/dotfiles/tree/master/.doom.d.

💜 1
wilkerlucio02:04:14

going with doom-emacs for now 🙂

wilkerlucio12:04:28

for anyone taking this tour, I found this awesome playlist on learning for Emacs Doom: https://www.youtube.com/playlist?list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj

nice 4
lread15:04:41

Oh nice @wilkerlucio! I’m relatively new to the cult, so very helpful!

jmayaalv18:04:14

@wilkerlucio the way i did it was https://www.masteringemacs.org/ to understand the basic stuff

jmayaalv19:04:12

Then prelude https://prelude.emacsredux.com/ as it gives a more barbone config than doom

jmayaalv19:04:11

If you want to understand the emacs config, prelude is just simple, doom its way too complex (at least for me) or check https://github.com/lambdaisland/corgi which seems analogous to prelude

wilkerlucio20:04:34

thanks @jmayaalv, I'll start with Doom because I wanna fiddle the least with configurations at this point, just wanna get something that works, and after adjusting I may start learning more about how things work

👍 1
wilkerlucio12:04:28

for anyone taking this tour, I found this awesome playlist on learning for Emacs Doom: https://www.youtube.com/playlist?list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj

nice 4