Live data from Hacker News

Ask HN: Resources to grok Emacs and use it well?

news.ycombinator.com

71–80 of 179 posts

Re: Ask HN: Resources to grok Emacs and use it well?

#71
post #10

I started using Emacs in earnest a few years ago, especially Org-Mode. At first, I tried every customization I came across and loaded up my init file with all the cool mods. But when things went wrong, I had no clue how to fix them. So after about a year I started over, resetting my config and using Emacs customization over custom elisp writing to get a working init file. It helped me learn a lot . This is the path I…

I learnt from the same professor! His youtube series is well done.

Re: Ask HN: Resources to grok Emacs and use it well?

#72
It's far from a comprehensive resource, but the thing that got me started with emacs many years ago was Steve Yegge's post Effective Emacs:

https://sites.google.com/site/steveyegge2/effective-emacs

Note some of the advice, such as how to swap Ctrl and Caps-Lock on specific OSes, maybe be outdated now.

That and the built in tutorial - there should be a link on the screen when you start up emacs, or `C-h t` - should be enough to get you started.

Re: Ask HN: Resources to grok Emacs and use it well?

#73
post #41

The biggest difference between Emacs and any other editor is that instead of thinking about Emacs as an editor you need to think of Emacs as a programable workflow enabler. Using Emacs without learning Elisp is like carrying a bike on your shoulders instead of riding it. Once you get to the place where you can confidently write Elisp to solve your problems, you will miss Emacs deeply when you have to use any other ap…

It's interesting to me that the top two comments (at the time of writing this) are fundamentally opposite advice. Yours, to customize Emacs, vs. the second, to basically not customize it at all.

I think the advice here is to be able to write your own customizations, but be careful about installing EVERYTHING that you read about.

I occasionally try cool-and-new Emacs things that are mentioned on HN or elsewhere, but drop most of them. The reality is that a lot of these things are completely crazy and don't help; they are complicated, but don't reduce the overall complexity of the system. If you are new to Emacs, every one of these things is a potential stumbling block that leads to dropping Emacs. (The reason to use Emacs over the cleaner and newer editors is the raw text editing efficiency. The new editors are behind here, and munging text should be the editor's primary concern.)

But, I have also written many of my own extensions that have served me well for decades. I wrote "eproject" back when Emacs didn't have built-in project support. I have kind of ignored it as an open-source project (there are probably 8 million Github issues open that don't interest me), but I use it every day because it works perfectly... for me, the author. I have also written a couple of other neat extensions that have served me well; many years ago I was a fan of "takahashi method" presentations, and wrote an editor/viewer for these. It is unlikely that anyone else would ever use it, but it worked for me at the time. Having that flexibility in your toolkit is great... but it is not necessary for day-to-day editing. (I learned Elisp when I was converting a client's set of static HTML files [actually JSP] to a CMS. I needed to extract certain metadata from the filename and HTML tags into flat files, and then replace the static content with markers that would load that content from the CMS. Almost all of the pages followed a certain format, but there was enough variance that a good chunk of them required manual intervention. So I wrote a Lisp program that highlighted the relevant areas and let you edit them, then did the actual extraction and replacement. It took a couple days to write, but I did the actual extraction in half a day with no errors, so I think it was worth it. If you were using something less flexible, you wouldn't have written that, and would have had to clean up a bunch of mistakes from your non-interactive batch job, or just spend three days manually cutting and pasting thousands of chunks of HTML.)

As for extensions that have "stuck" for me; lsp-mode is the big one. A lot of languages have good language servers, and jumping to documentation and autocompleting symbols is pretty enjoyable. Depends on the language you use; I'm happy with gopls and the Typescript language server. I've never gotten clangd to work on an existing project, however. Minimalism is the name of the game; I use lsp, but nothing fancy. It underlines errors in the code, provides completion (with company-mode), and I setup keybinds to jump to definitions and documentation. I basically ignore lsp-ui-mode completely, because it's too much clutter.

Pre-LSP(+) code formatting hooks have also stuck. I cannot live without gofmt-on-save and don't use a programming language without an autoformatter (prettier is great for Javascript and friends, YAML, and JSON). Clang-format serves me well for C/C++/Protocol Buffers (but most open source projects don't follow their own style rules, so you have to turn it off if you're just making a small edit to their project). Emacs has good modes for all three of these things, go-mode and goimports, prettier-mode, and clang-format-mode. Could not live without them; formatting code is a silly thing to spend any mental energy on, and computers do a much better job than I could.

(+) I say pre-LSP here because the Language Server Protocol does do reformatting. I have not played with it. I'm happy with the static tools that existed before LSP, and haven't found a reason to try something new. YMMV.

Re: Ask HN: Resources to grok Emacs and use it well?

#74
post #17

Emacs user here, it's been my go-to editor for about 40 years. I have a few customizations, not many. My .emacs file is 63 lines long, doesn't include any other files, and mostly just tweaks some key bindings and turns off features that I don't like. The only modes I use are built-in ones (e.g., C-mode, auto-wrapping text mode, etc.). I can't write elisp without a reference manual, and I think that's okay. I suggest:…

I started this way and my next step was taking advantage of the current package manager. The fact you can inject new functionality so quickly made me really fall in love with emacs. Adding additional programming modes/file format modes without any headaches has been a boon to my usage of Emacs. I'm rarely tuning settings in elisp anymore and instead just adding a feature so the file has colourization and tab stops working properly. If I do actually want to customize something since customize-mode works well enough now I can usually find the modest setting I do want to change without much hassle.

Re: Ask HN: Resources to grok Emacs and use it well?

#75
post #23

I'm a moderately experienced Emacser - been using it heavily since 2009 (first encountered it in 2003). I have written a few small extensions and contributed features and bug fixes to bigger ones. Credentials established, I cannot recommend this tutorial enough: https://david.rothlis.net/emacs/tutorial.html He walks you through most of the core of what makes Emacs great by showing you how to make a change to a projec…

Spacemacs is getting decent press here. How recently have you tried it?

I recently switched form spacemacs to my own config that works in a similar way.

I'm committed to modal editing and vim keybindings already, so spacemacs introduced me to emacs and got me to convert, but it is a 90% for everyone solution. It adds tons of stuff that mostly works, stuff which you specifically mostly don't need.

It mostly works, but coming from vim spacemacs is a big black box for the most part. I think it is a fantastic first step if you need to get something mostly working.

Going through and building up my own .emacs with the parts I wanted was the way I finally learned to grok emacs for real. It took that step to actually be able to understand what's happening when something unexpected happens. I also discovered a lot of alternatives to the spacemacs packages, well known by real emacs users, that I much prefer to the choices made by the spacemacs team.

Re: Ask HN: Resources to grok Emacs and use it well?

#76
post #17

Emacs user here, it's been my go-to editor for about 40 years. I have a few customizations, not many. My .emacs file is 63 lines long, doesn't include any other files, and mostly just tweaks some key bindings and turns off features that I don't like. The only modes I use are built-in ones (e.g., C-mode, auto-wrapping text mode, etc.). I can't write elisp without a reference manual, and I think that's okay. I suggest:…

What’s emacs --version say for you? My main complaint from using a Mac laptop for so long is that I often had to download some .el packages, that are basically unnecessary with more recent emacs updates. Other than that, I’ve also got a fairly simple .emacs file modulo a few project specific “let me make this a macro for this terrible manual process I need to do”.

Re: Ask HN: Resources to grok Emacs and use it well?

#77
post #23

I'm a moderately experienced Emacser - been using it heavily since 2009 (first encountered it in 2003). I have written a few small extensions and contributed features and bug fixes to bigger ones. Credentials established, I cannot recommend this tutorial enough: https://david.rothlis.net/emacs/tutorial.html He walks you through most of the core of what makes Emacs great by showing you how to make a change to a projec…

Spacemacs is getting decent press here. How recently have you tried it?

I object to Spacemacs not on the grounds that it works poorly, but on the grounds that if you throw all that into your config at once you will almost certainly have no idea what's causing problems or how to debug them.

Once you have a decent idea how the parts fit together, you don't really need Spacemacs, IMO.

I think the last time I tinkered with it at all was about a year and a half ago?

Re: Ask HN: Resources to grok Emacs and use it well?

#78

Earlier quoted context omitted.

you definitely can use evil mode but you will find a lot of edge cases where you have to configure something in some modes to behave sanely whereas with spacemacs they have usually done all that legwork of anything you want to use.

You also have doom which is just evil and not space centric AFAIK

Doom has good reviews AFAICT

Re: Ask HN: Resources to grok Emacs and use it well?

#79

Earlier quoted context omitted.

It's interesting to me that the top two comments (at the time of writing this) are fundamentally opposite advice. Yours, to customize Emacs, vs. the second, to basically not customize it at all.

I think the advice here is to be able to write your own customizations, but be careful about installing EVERYTHING that you read about. I occasionally try cool-and-new Emacs things that are mentioned on HN or elsewhere, but drop most of them. The reality is that a lot of these things are completely crazy and don't help; they are complicated, but don't reduce the overall complexity of the system. If you are new to Ema…

Thanks a lot for your detailed comment. The work you did with splitting the JSP files shows the power of the tool, and it’s things like these that are inspiring to know about (since I don’t know Emacs, normally I would’ve just reached out to awk or a combination of sed and awk for something like that).

Re: Ask HN: Resources to grok Emacs and use it well?

#80

Emacs is very easy to learn. Just as you learn the key combinations for video games, learning key combinations for emacs is really easy. Here are some steps to help you: 1. Go through the Emacs Tutorial. Just start emacs, put the cursor on the text 'Emacs Tutorial' and hit enter. It will only take 30 mins max. 2. Go through the first chapter in the Practical Common Lisp book here: http://gigamonkeys.com/book/lather-r…

Thanks so much for the detailed instructions and the focus on the basics and getting by step by step. It’s very comforting to read this, and it removes an inherent fear that learning to use Emacs may be way too complex.
Post reply on HN