Fork me on GitHub
#emacs
<
2021-11-04
>
Marius14:11:20

Hi there, I’m a Clojure and Emacs beginner and use config from here (https://www.braveclojure.com/basic-emacs/). Today I was hunting down a bug in an example I am coding and it turned out to be a typo in the word ’message”. What surprises me is that there is no check / no linter to highlight those unresolved symbols and prevent those typos in first place. Is this a matter of configuration or generally not possible?

practicalli-johnny19:11:28

The Emacs config in brave Clojure is really outdated by a number of years.

kimim10:11:02

You can use clj-kondo and lsp-mode

dpsutton14:11:33

clj-kondo would most likely have caught that. do you have that linter enabled?

dpsutton14:11:19

both shadow-cljs and figwheel should have given a UI toast showing that compiler error as well

Marius14:11:27

I’m not sure if clj-kondo is enabled, most likely not - I just copied that Emacs config.

borkdude14:11:36

@mail990 Try out flycheck-clj-kondo for the most basic clj-kondo setup in emacs

borkdude14:11:58

For more advanced features (navigation etc) move on to clojure-lsp which automatically enables clj-kondo

Marius14:11:12

You’re right, now I looked at the shadow-cljs build and there is a warning… my bad, I just ignored the terminal output 🙂

ericdallo14:11:10

in case you want a more IDE-ish experience: https://clojure-lsp.io/features/ #lsp

borkdude14:11:20

I already mentioned that @ericdallo :)

thanks 1
ericdallo14:11:13

I just linked the webpage and the channel 😅

Marius14:11:40

Wow, thats all very helpful, thanks a lot! I definitely have to spend more time to learn Emacs as well… like “learn to use the tools before building”

ericdallo14:11:09

Since you are starting, maybe this guide may help you as well: https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/

borkdude14:11:37

@mail990 I can assure you it's worth the time.

Marius14:11:43

I’m sure it is, but it is also just too tempting to fall back into the old known tools like VS Code or IntelliJ … have… to…. resist….

💪 1
borkdude14:11:57

VS Code + Calva is also very nice. But I'll try to respect the religion of this channel.

😂 3
🙏 3
borkdude14:11:43

As a nice fact: VS Code + Calva also use clj-kondo + clojure-lsp so what you learn here will also be useful on the heathen side of things

☝️ 1
1
ericdallo14:11:41

the same for CoC/neovim if using LSP ☝️ metal

Marius14:11:53

Just too much choice and religion for a beginner…

dpsutton15:11:52

religion is not helpful for a beginner. There is no need to use emacs if you are already familiar with other tools. I think emacs is fantastic but it really takes a while to really understand why. And it isn’t necessarily worth it for everyone. I also consider vs code the modern day successor to emacs

1
🙏 1
📿 1
mpenet15:11:08

it's risky to state "vscode the modern day successor to emacs" in #emacs 🙂

😁 3
borkdude15:11:52

I remember I learned emacs because that was the only viable option for clojure pretty much in the early 2010s. I also played around with CounterClockwise in Eclipse. I don't regret learning emacs one bit. But it has a higher learning curve than other options right now.

mpenet15:11:06

yeah it's a long term investment

mpenet15:11:40

had to learn at uni in end of 90s (to work with Java no less), used it almost exclusively ever since.

mpenet15:11:04

vscode does some things better, emacs others.

cp4n15:11:40

It's also fun to use ( although that is quite subjective on what one's idea of fun is 🙂 )

mpenet15:11:49

I hate elisp with a passion personally

mpenet15:11:56

yet, it works, so

borkdude15:11:59

It matches how I think. Like in Clojure, I use functions and M-x foo is a lot like using a function to me. I tried vim as well, but it matches less how I think, I just can't get used to it. It's very personal.

mpenet15:11:42

I wish there was a fennel dynamic module or something of the sort that would allow me to write modes in something else than elisp

dpsutton15:11:55

I learned emacs in a compilers class in university since it had modes for sml and some other goodies

dpsutton15:11:18

i’m quite jealous of the lua integration for neovim and agree emacs lisp is quite clunky

dpsutton15:11:19

the reason i think that vs code is the successor to emacs is based on the community and scriptability. It’s an extensible editor with literally a million users who tinker, create packages, etc. It has achieved what emacs set out to do

mpenet15:11:51

there were plenty good alternatives, some lasted more than others, the fact emacs is still around says something I think. it's also much more than a code editor

mpenet15:11:33

that said it's good vscode is creating all this innovation around it. it inspires a lot of good features

pez15:11:25

More than a code editor goes for VS Code as well, to some extent. Not as OS-y as Emacs, of course.

Marius15:11:31

I’ve installed lsp-mode from MELPA stable, but when launching it (after restarting Emacs) with M-x lsp I get the following error:

lsp--path-to-uri: Symbol's function definition is void: -compose

ericdallo15:11:22

TLDR: update dash.el package, I really suggest you use lsp-mode from melpa unstable

ericdallo15:11:01

lsp-mode receives a lot of fixes and improvements all the time, stick to the unstable I think it is the best option

Marius19:11:03

ok, thanks, I’ll give it a try

dpsutton15:11:28

emacs has its own resistance to change as well. from licensing, to product vision, to even supporting features on osx that are not possible in x server.

Casey15:11:59

I came to emacs because of clojure (like many), but the reason I'm still here even though I have years of vimming and Intellij, is that if you want vim editing + proper lisp structural editing, emacs+evil is the only place you can get it AFAICT. Intellij/Cursive and vscode/calva are severely handicapped when you enable the vim plugins. I haven't tried the vim tools (fireplace) in years, maybe I should give it a go. But I find emacs delivers the IDE-like experience better than I could ever get vim to over decades. If I somehow manage to boot up emacs without my config, I'm totally hopeless because I don't actually know any core emacs bindings except m-x

fedreg15:11:08

I had the same experience but just a heads up that the Clojure Vvm plugins have gotten really good in the past couple of years.. They all pull in CIDER now. I personally use conjure but fireplace and iced are both really solid. (Conjure is neovim only) I go back and forth between emacs and vim all the time… Use vim for most tasks and emacs when I need a bit more help. Usually have both open and just keep the bindings the same to make it easy.

Casey20:11:26

I'll have to try them out. I also spend almost all day in vim and emacs. Vim when I'm doing small edits all over the place over many projects and emacs when diving into one project. that said I've grown to really like the emacs tooling around project management, managing many buffers, searching, sidebars, etc (not to mention the time investment in learning it). I regularly copy bindings between my emacs and vim configs heh. I haven't dove into the neovim rabbitwhole yet. Wait, so cider we know and love is is used by non-emacs editors too?

fedreg01:11:05

Ya, the awesome cider team did a lot of work to generalize a lot of the tooling so other editors could use As a result, several Vim plugins as well as the VS code plugin all are now viable Clojure environments

metal 1
kimim10:11:19

I am still using emacs own key bindings

mpenet15:11:35

@dpsutton what are the features not possible on x?

mpenet15:11:24

that said emacs is about to have proper wayland support, so that might come to osx in another form eventually

dpsutton15:11:33

there’s a patch set that gets applied for osx that will not be accepted into core because it adds some niceties like smooth scrolling and maybe subpixel stuff. until x has these capabilities RMS prevents it from being merged so that it doesn’t promote a non-free operating system

kimim10:11:56

Interesting 😄

David Vujic17:11:41

I also began my emacs journey through clojure and the Clojure for the Brave & True https://www.braveclojure.com/clojure-for-the-brave-and-true/. I started learning clojure less than two years ago, and there were a lot of really nice editor alternatives out there - but I went for emacs anyway. Much because of the author Daniel Higginbotham recommending it - even though when he wrote it, there probably wasn’t that many of them to choose from. I haven’t regret choosing emacs, even though it made the learning curve quite a lot more :snow_capped_mountain: 😆 These days, I write JavaScript, TypeScript, Clojure and Python code using Emacs. I still accidentally try to “Yank” and “Kill” text meant to be cut & copied from browsers, notes and other non-emacs stuff. picard-facepalm

emacs 1
kimim10:11:24

For other applications, I am using a small autohotkey scripts to bind M-W and C-Y to C-c and C-v

👍 1
nice 1
emacs 1
kimim10:11:55

https://github.com/kimim/kimim-emacs-everywhere you could fork and adjust to your habit, if you use windows.