Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a very important release for LSP users, as Emacs now has a fast, C-based JSON parser that speeds up e.g. lsp-mode significantly.


Just a quick question on this, what's the best way to emulate an ide in emacs? I feel so overwhelmed by the options, and the additional tools you have to install alongside it. For example, python ide in emacs alone requires pyflakes, autopep8, jedi and so on... What's the most catchall, generic ide system where I don't have to fiddle with the config too much?


To my mind there are two camps of language support in Emacs:

1. Languages where people put a lot of effort into implementing bespoke support inside Emacs itself (as Elisp packages)

2. Languages where no one bothered to make Emacs-specific features, but are now supported quite well via LSP

Python seems to be in the #1 camp, and that seems to be what you describe.

The #2 camp, however, is superior in my experience, so I would suggest trying that instead.

I haven't worked that much with Python for a while, but at one point I used lsp-mode and pyls and it seemed pretty good: https://emacs-lsp.github.io/lsp-mode/page/lsp-pyls/

You can also choose Microsoft's Python LSP server instead: https://emacs-lsp.github.io/lsp-python-ms/


Category 1 can be further subdivided into

1.1. Languages where people have written full parsers and analysers in Emacs Lisp.

1.2. Languages where the Emacs support relies on external programs to provide intelligence.

Only very few languages (e.g. JavaScript) fall in subcategory 1.1.


Unfortunately, js2-mode's parser isn't updated to keep pace with modern language development. I've had much better results over the last year with an LSP integration, and rarely if ever go back to js2-mode these days.

Similarly, while js2-mode's built-in formatter is quite good, Prettier is both more (and more easily) configurable and more shareable - it can enforce an agreed-upon style at the codebase level without any editor-specific tooling or configuration, and the consequent absence of bikeshedding is welcome.


Yeah LSP is taking over. I don't think category 1.1 is going to last.


Surprisingly, I never got to a good C++ setup in emacs.

Something about how we used CMakeLists and had our project set out made it difficult to get autocomplete/gtags and everything to work the way I wanted.

I know it's possible, but could never get everything to play nicely together.

On the other hand, every other language I've had a brilliant experience with in emacs (using spacemacs).


This gets me basically everything that I need:

- lsp-mode (IDE smartness) - company (completion pop up) - selectrum/ivy/helm (command awesomeness) - projectile (project management) - magit (greatest Git interface you will ever use)


Could you share your selectrum/ivy/helm config or give me some tips? That's one part of Emacs config, in particular, that gives me the willies -- I can't figure out if I'm supposed to choose between ivy and helm or use them together or even really what the differences are between the two. I haven't even heard of selectrum, lol.

That's one of the hardest parts of trying to config Emacs in general -- so many packages and they all seem to do the same thing and I think I need just one but sometimes people have like, all of them installed. It's confusing!


You can find my config here:

https://github.com/ashton314/.dotfiles

I use selectrum for just about everything. The only reason I keep ivy and counsel around as for the packages counsel-rg (ripgrip with real time results) and swiper.

It is a very good question you ask. I have spent many months experimenting with these various packages. I actually wrote a blog post about switching from Helm to Ivy. I suppose I should write a follow up on about switching to Selrctrum.

If you would like to talk more one on one, please DM me via one of the channels listed on my blog:

https://ashton.wiersdorf.org/about/#contact


> greatest Git interface you will ever use

I believe the amount of people disliking magit fits on one digit


I’ll parrot “Spacemacs” along with a few other here, but here are my two main reasons why:

- Spacebar “leader” key. If you’re familiar with Vim, space is your leader key, and many functions lie behind it.

- Layers. Spacemacs has a packaging system called “layers” that are a collection of curated Emacs packages. The great thing about layers is all the wiring the layer author has done. Many packages are condensed down to a one-line config. Just add “python” to the array of installed layers in your config file and it will install a lot of what you have above. There are a few config toggles (e.g., override the language server that is used by default), but they are pretty well documented in the Spacemacs docs.

Also, use the Spacemacs develop branch! I’ve been on it for years. Master has not had many (any?) updates in a long time. If you do this make sure you are reading the docs for the develop branch when perusing layers online!


I wouldn't recommend Spacemacs. I use it, it's horrible. Fragile and very bloated, and the primary maintainer doesn't really work on it any more (it hasn't seen a release in something like 3 years).

Doom Emacs is a way better choice now IMO.


I recently switched from Spacemacs (develop branch) to Doom Emacs ... Spacemacs was just too slow (but very nice, better than Doom in some ways especially the layers in Spacemacs).

I might go back and see if I can get the native-code version of Emacs running with Spacemacs, it might speed it up.


Spacemacs has been in rolling-release mode for something like 3 years. Almost everyone using it just tracks the develop branch where features and fixes are merged daily.


Every time you start the develop branch it displays a huge message saying "Version 0.300 is almost out!" (with a description of how stable releases on master branch are the current objective) and it's been displaying that message for 3 years. There is a rolling branch, but the release branch isn't rolling. Spacemacs is usable but the project is calcifying, I wouldn't recommend anyone hitch their cart to it.

Like, I'm jumping ship as I write this. My job for the next few days is converting my config to Doom.


This is exactly the problem with these huge pre-configured "distros" like Spacemacs and Doom. It looks like you spend a lot of time fighting the opinionated setup of the distro. You might as well spend that time starting from vanilla Emacs and craft your own config.


FWIW while it feels like I'm constantly fighting Spacemacs, it hasn't felt that way with Doom so far. Spacemacs introduces a lot of unnecessary abstractions that are very difficult to perform surgery on whereas Doom seems closer to "sane defaults, but you can modify them easily".


I use Spacemacs develop branch. I agree it's great, but it breaks things often. Once the next release is finally out (0.300 ?) I'll probably switch to master to have a more stable setup.

Oh and if you are a security conscious user, you might not like the fact that Spacemacs downloads tons of code which might or might not have been reviewed by someone you can trust and might or might not have been signed...


Out of interest, what have you had broken?

I've been on develop for ages, and don't really remember many breakages, I do however only pull sporadically.


I cannot really say, very often even at launch something fails and initialization is not done properly, so for example projectile (which I use to switch projects) doesn't work. When it happens I simply revert to the previous commit that worked for me and wait a bit before pulling again


I've heard good things about doom emacs and spacemacs; might be worth giving one of those a try.


Doom Emacs is great an has more emphasis on performance and load time than Spacemacs


The main idea of Emacs is unlike other ide's it can be customized greatly to specific users, but Doom Emacs seems to be a ready made configuration. It seems to be opposite of the main idea behind Emacs, yet Doom Emacs seems to be getting popular. Is there anything i am missing.


You're missing that a default vanilla Emacs experience is pretty shitty. Besides, it's not like you're sacrificing any customizability with Doom/Prelude/Spacemacs, you're just getting a better starting point.


You can consider doom emacs a 'mod' that make it easier to manage your customized emacs config.

If anything I found doom to make it easier to stay close to the 'intended' way to customize emacs, since it heavily encourages you to use 'use-package' and 'general.el' to manage your extensions, and gives you good startup performance if you use them as intended (allowing the lazy-loading to do its work).

Although it's possible I was simply more familiar with the 'right' way to do it when I moved to Doom from Spacemacs. Either way I got the impression it felt quite close to the way to manipulate 'native' emacs (but with a lot of sensible defaults that I couldn't be bothered to figure out myself).


I went with the ‘take vanilla and adjust’ route to learn proper Emacs config-ing. Turns out, you pretty much need to implement a bunch of features on top of the 90s Emacs to get a reasonable modern editor, and there isn't a system for config snippets that are smaller than a minor mode (aside from copy-pasting from StackOverflow). I've been meaning to try Doom for some time because it seems to be an answer to just that problem.


Maybe many users don't need a very specific configuration, and a great community made configuration is good enough :)

I use Spacemacs which is also a community made emacs configuration and it's great. The fact that I could have made the customization myself does not make this configuration any worse.


Projects like Doom Emacs and Spacemacs are frameworks. They contain lots of well-made, battle-tested code. They are extensible, too: they usually provide clear points for user extensions and customizations.


I think what you're missing is that Emacs might be a good fit for things other than "the main idea of Emacs" (whatever that is)


But can Doom Emacs run Doom?



I've had generally good experiences with spacemacs. JackOfSome on YouTube has good tutorials including one on using it for Python.


I’d try eglot with pyls for python. (The pyls server is using Jedi).


Python can never have a legit IDE because of the dynamic typing and OO, but LSP/company-mode/projectile/magit should get you on par with anything else, I'd imagine.


You want to avoid fiddling, editing config files and chasing dependencies?

Drop emacs and look elsewhere.


Nice. Is it a plug-in replacement? E.g. does eglot already make use of this, too, or will it need to be updated?


I had to re-bytecode-compile lsp-mode to get it to pick up the faster JSON support (`M-x package-reinstall lsp-mode`). See `lsp-diagnose` for a quick way to check if you're good to go.


Thanks, but I'm using eglot. I might try lsp again, now that some time has passed, though.


Eglot will use the native C JSON parsing if Emacs is compiled with jansson support.


lsp-mode recommends the same on its guide for improving performance: https://emacs-lsp.github.io/lsp-mode/page/performance/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: