Live data from Hacker News

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

news.ycombinator.com

21–30 of 179 posts

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

#21
https://emacsformacosx.com/ is a very good port to MacOS. One advantage of Emacs on MacOS is that the Command key is not part of the traditional Emacs key bindings. This port uses Option for Meta and supports most of the usual MacOS Command key shortcuts, so you can use the familiar MacOS keys as well as the official Emacs key bindings.

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

#22
Guidance here seems to fall into 2 camps - either (1) start vanilla or (2) with one of the currently favoured packagings (Doom, Spacemacs etc).

I'd say it depends on what your aim is: (1) would be the way to go if you primarily want to get fluent with emacs, or are content to use tools you already know for other work, and learn plain emacs gradually in the background. (2) would be best if you want to get productive quickly using emacs for real work, at the risk of a more occluded understanding of emacs per se.

I'd put in a word for Prelude (https://github.com/bbatsov/prelude) as a possible compromise, making emacs immediately usable but without putting many layers between you and it. Some might consider it a little old-fashioned however (no use-package etc).

I've used vanilla emacs on and off for many years for quick edits, but only recently for actual programming (using Prelude, and prompted by learning Clojure). It's taking over my computing lifestyle. I've laughed in the past at people using it for email, but found myself using mu4e lately. Scary.

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

#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 project in the idiomatic Emacs way.

I would have learned it years faster had I started there.

Beyond that, learn basic Emacs keybindings via the tutorial, as others have suggested.

I started in Emacs but installed evil-mode a few years ago and have never looked back.

I do not recommend Spacemacs. Install the tools you want as you find you want them, so that you know what's doing what, and so you have a decent chance of knowing what broke things when something stops working.

Keep your packages in version control as part of your .emacs.d repository. That keeps updates and deleted packages from screwing you.

Use "use-package" (https://github.com/jwiegley/use-package) for configuring what you install. It's written by one of the Emacs maintainers and will help you do things right by default.

I'm not the best Emacser out there, but if you're curious, my config is on my GitHub account: https://github.com/NateEag/.emacs.d

Happy hacking.

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

#24
I learned a lot about what to expect from emacs from Steve Yegge's blog posts. Even though they are quite old now they still relevant.

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

http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-...

http://steve-yegge.blogspot.com/2008/01/emergency-elisp.html

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

#25
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:…

Forgive the noise, but I second this. I haven't committed a hundred key combinations to memory. I find that knowing the twenty things I need to know (which are different for everyone), and having another twenty in my back pocket for once or twice a year has lasted me since 1992, and left me very satisfied indeed with emacs.

Also seconding. Vanilla emacs is already extremely powerful, and if you're doing real work, you'll end up having to use hosts that don't have all of your wonderful enhancements installed. It's good to know vanilla emacs.

Beyond that, add language modes for anything you need that's not already included.

If you use 'git', 'magit' is very nice.

Beyond that, helm is interesting, though very large and kind of mind-blowing.

Recommend these in your ~/.emacs.d/init.el, to avoid being that guy:

    (setq-default show-trailing-whitespace 't)
    (setq-default indicate-empty-lines 't)

    ; try not to use tab characters ever when formatting code
    (setq-default indent-tabs-mode nil)

    (setq-default require-final-newline 'ask)
    (setq-default mode-require-final-newline 'ask)

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

#26
Back when I was playing around with Emacs I found Protesilaos Stavrou's videos to be quite good for getting a feel on how to accomplish specific things with Emacs.

They are at: https://www.youtube.com/channel/UC0uTPqBCFIpZxlz_Lv1tk_g/vid...

Most of the videos are focused on practical tasks you would want to do. It's one of the few really good Emacs focused channels IMO.

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

#27
I am keen to crowdsource a study of emacs workflow practices, where we can collect, compare and analyse different development practices among emacs users. This should help other emacs users to borrow modes/keybindings/specific techniques/tricks.

* Motivation

This is inspired by an ongoing conversation about emacs with a friend and a debugging interview that I really enjoyed.

* Exchanging emacs tips with a friend

A friend of mine is pretty proficient in emacs: org-mode all the things, written >500 LoC of elisp, tried several distributions. We still regularly teach each other about existing emacs functionality and exchange messages along the lines of: - I just found that there is a function foo, which I have made a keybinding foo and can now search open a tab with a SO search with text from the clipboard - whaaat? That's super useful! - I know, right?

He works with a couple of greybeards, who also seem to be constantly finding emacs functionality that makes their lives easier, which suggests it would be beneficial for all of us to watch others in emacs.

* Interview

I was given a real git repo that I needed to load into my environment (spacemacs on Linux) to debug and fix failing tests. They sat me down during the onsite (the days when we would go to interview in person), told me to download the repo from the URL, told me how to run the tests (after activating the python venv) and watched me debug and fix failing tests - only 5 were failing from about 100. The interviewers were not proficient in emacs, but I felt that they could follow my thought process and workflow. I had only recently set up python dap-mode and felt clunky navigating in pdb through dap, so ended up print debugging.

It made me think how interesting it would be to watch other people with different backgrounds and experiences debug the same problem and how often I would learn new tricks or debugging techniques. Having a good understanding of the problem and the code allows you to focus on the activity of programming and watch out for new ways of tackling the same problem.

* What will we investigate

Furthermore, it might be interesting to see what debugging practices are statistically more succesful in tracking down the bug faster (and control them for overall years of programming experience and emacs proficiency).

If our sample is big enough we can answer questions like: Correlation between overall years of programming experience and debugging time? Who is faster at debugging: printf or gdb debugger people? Which keybindings and modes are most frequent across users? Is there a correlation between having custom elisp functions and debugging time?

* Format

I will prepare a representative repo in the most popular language (I am most comfortable in Python, happy to consider other languages, if people prefer), bury some bugs in it (that will be easy), administer the study and summarise the findings in a spreadsheet/write-up.

Following the debugging session outlined above. Every participant:

starts recording their screen

Starts a fresh emacs instance with their config and loads a emacs lisp script that we provide for printing keypresses and recording keypresses + function calls to a log file.

download the prepared repo

run tests

investigate failing tests

fix them

commit their changes

The participant ends the screen recording session before sending me

   - the video to me or youtube/dailymotion URL 
   - plaintext keylog history
   -  link to their elisp config
I appreciate logging keypresses/function calls might feel intrusive, so if you are uncomfortable doing that - don't! At the same time, if we want to share good debugging practices and general emacs tricks - I see this as the most impactful way to share techniques and elisp snippets.

I watch it, sumarise the findings and present a write-up.

Who is interested?

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

#28
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:…

There is another positive side effect of limiting customization to reasonable levels. Default Emacs shortcuts are hidden everywhere. Most importantly, bash understands them, as well as many other REPLs (erlang, ghci, julia, ...). Developing muscle memory for the default Emacs allows one to use many tools much more efficiently.

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

#29
post #3

If you're currently a vi user, I'd recommend spacemacs ( https://www.spacemacs.org/ ) to soften the learning curve. It comes batteries included (as opposed to a stock emacs install which requires a _lot_ of customization) and uses evil mode (vi keybindings) by default. You can expose yourself to more and more of the emacs way slowly. Also emacs is largely self-documenting. Learn the keys for querying documentation fi…

I was a vi user that had to ramp up quickly on a clojure project. Being new to clojure, I choose not to emacs at the same time as clojure. Spacemacs was lifesaver for me, given clojure experience in vi + plugins is subpar.
Post reply on HN