Live data from Hacker News

How to Learn Emacs (2012)

david.rothlis.net

21–30 of 47 posts

Re: How to Learn Emacs (2012)

#21
post #13

In vi (which apparently is vim by default I was told?) I know open, save, quit, go to line, go to begin/end of line, find, insert, delete line. We used emacs in college and that was the last time I used any text editor serverside besides vi. Am I missing out?

I think Emacs is appealing to those who want to quickly write customizations to their text editor.

When working on certain projects, I'll sometimes write a code snippet of elisp to handle some task I find myself doing a lot (things like "fold all fragments of this bespoke file format which includes some string"). The fact that Emacs Lisp is a "real programming language" is nice, and the way that it's very easy to inspect what a certain key command does means that you can very quickly set something up.

This lower barrier to entry is nice for people who really want to make things very close to right. Things like "set up a custom error checker based on this validator command and add highlighting to the text based on it" is as simple as setting up something in flycheck and setting up some regular expressions.

So I think it's interesting for people who like IDEs but want it to be easier to mold and understand, more than people who have a simple text editor but want "more".

Re: How to Learn Emacs (2012)

#22
post #18

This tutorial is painfully out of date, and I would argue a very bad way to learn emacs today. As an example, don't learn to use ETags unless you are going to specifically be working with a C project where other developers use them. You would be better served these days learning LSP and treesitter, which is now built-in. I would also strongly suggest using Doom Emacs, and working your way backward to a minimalist con…

> don't learn to use ETags > You would be better served these days using LSP and treesitter Could you elaborate? How do I transition from etags to treesitter? Suppose I'm working on a dynamic C or C++ project where I might need to regenerate the tags daily.

I meant to say "learning", not "using", that's my mistake.

> Suppose I'm working on a dynamic C or C++ project

Most beginners are not, that's my point. Those technologies are fine if you need them, but the vast majority of beginners are working in dynamic languages like JavaScript and Python. Any modern tutorial using Emacs for code should be about programming in those languages (and elisp).

Honestly the best way to learn to use Emacs today is probably not using it for code at all, but org-mode and plaintext editing. That way you can learn the editor and not get bogged down in creating/configuring IDE features.

Re: How to Learn Emacs (2012)

#23
post #18

This tutorial is painfully out of date, and I would argue a very bad way to learn emacs today. As an example, don't learn to use ETags unless you are going to specifically be working with a C project where other developers use them. You would be better served these days learning LSP and treesitter, which is now built-in. I would also strongly suggest using Doom Emacs, and working your way backward to a minimalist con…

> don't learn to use ETags > You would be better served these days using LSP and treesitter Could you elaborate? How do I transition from etags to treesitter? Suppose I'm working on a dynamic C or C++ project where I might need to regenerate the tags daily.

LSP refers to the Language Server Protocol, a standardized protocol designed to provide real time source code information for a given code base; tree-sitter is parser design to create a real time syntax tree for a given source file. No doubt the OP is suggesting the use of an Emacs plug-in based on those newer technologies.

Re: How to Learn Emacs (2012)

#24
post #18

This tutorial is painfully out of date, and I would argue a very bad way to learn emacs today. As an example, don't learn to use ETags unless you are going to specifically be working with a C project where other developers use them. You would be better served these days learning LSP and treesitter, which is now built-in. I would also strongly suggest using Doom Emacs, and working your way backward to a minimalist con…

> don't learn to use ETags > You would be better served these days using LSP and treesitter Could you elaborate? How do I transition from etags to treesitter? Suppose I'm working on a dynamic C or C++ project where I might need to regenerate the tags daily.

With lsp you don't need tags. You essentially have a lsp server like clangd [0] running in the background for finding references, definitions, code completion etc.

With the latest release 29.1, emacs comes with an in-built lsp client - eglot[1]. So you need to (a) Set up clangd or some other lsp server for c++. Make sure it's accessible from emacs (use something like exec-path-from-shell to get your shell paths into emacs) (b) Set up your project for clangd - this involves generating a compile_commands.json which basically lists the full compilation invocation of each and every file in your project. CMake has options to do that and likely many other build tools or maybe use something like bear[2]. (c) Enable eglot (install the package if needed on older versions of emacs) and configure appropriately.

I also use projectile for project mgmt though emacs now has something in built for that too.

I can post my configs if that helps.

[0] https://clangd.llvm.org/ [1] https://github.com/joaotavora/eglot [2] https://github.com/rizsotto/Bear

Re: How to Learn Emacs (2012)

#25
post #18

Earlier quoted context omitted.

> don't learn to use ETags > You would be better served these days using LSP and treesitter Could you elaborate? How do I transition from etags to treesitter? Suppose I'm working on a dynamic C or C++ project where I might need to regenerate the tags daily.

I meant to say "learning", not "using", that's my mistake. > Suppose I'm working on a dynamic C or C++ project Most beginners are not, that's my point. Those technologies are fine if you need them, but the vast majority of beginners are working in dynamic languages like JavaScript and Python. Any modern tutorial using Emacs for code should be about programming in those languages (and elisp). Honestly the best way to…

I've been using emacs for years, and I use org to write latex documents because writing actual latex is awful, but I don't really see what drives such org mode fanaticism.

You're at a bbq and someone invites you to a ski trip in 5 months, you need to check your schedule so you whip out your laptop to check the org calendar?

I just don't get how people can function putting "everything" into org.

Re: How to Learn Emacs (2012)

#26
post #25

Earlier quoted context omitted.

I meant to say "learning", not "using", that's my mistake. > Suppose I'm working on a dynamic C or C++ project Most beginners are not, that's my point. Those technologies are fine if you need them, but the vast majority of beginners are working in dynamic languages like JavaScript and Python. Any modern tutorial using Emacs for code should be about programming in those languages (and elisp). Honestly the best way to…

I've been using emacs for years, and I use org to write latex documents because writing actual latex is awful, but I don't really see what drives such org mode fanaticism. You're at a bbq and someone invites you to a ski trip in 5 months, you need to check your schedule so you whip out your laptop to check the org calendar? I just don't get how people can function putting "everything" into org.

I don't use org-agenda or calendar or anything. I also find them inconvenient. I just use org-mode for writing and organizing documents. Lecture notes, programming exercises, book notes, README's, daily TODO lists, journaling, and writing a blog (exporting to Hugo), and of course writing my emacs config in a literate style with org-babel-tangle. It's a super versatile format with great ergonomic commands and a large community.

Re: How to Learn Emacs (2012)

#27

The install section is out of date, at least for macos homebrew. The emacs-plus package on homebrew ( https://github.com/d12frosted/homebrew-emacs-plus ) is the best for macos.

The Yamamoto ("railwaycat") fork is far superior.

Re: How to Learn Emacs (2012)

#28

My learning path was 1) use vim/nvim for a couple years 2) use Doom Emacs. I was shocked at how intuitive Doom is for me. Of course not everyone would agree but it’s worth checking out

I used 'joe' for years. I swapped C-x with C-k and I've been thrilled with Emacs ever since.

Re: How to Learn Emacs (2012)

#29
post #25

Earlier quoted context omitted.

I meant to say "learning", not "using", that's my mistake. > Suppose I'm working on a dynamic C or C++ project Most beginners are not, that's my point. Those technologies are fine if you need them, but the vast majority of beginners are working in dynamic languages like JavaScript and Python. Any modern tutorial using Emacs for code should be about programming in those languages (and elisp). Honestly the best way to…

I've been using emacs for years, and I use org to write latex documents because writing actual latex is awful, but I don't really see what drives such org mode fanaticism. You're at a bbq and someone invites you to a ski trip in 5 months, you need to check your schedule so you whip out your laptop to check the org calendar? I just don't get how people can function putting "everything" into org.

You can nicely suggest that you will check your calendar and not answer on the spot.

If you didn't have the flexibility to move your work anyway you probably should not go.

Re: How to Learn Emacs (2012)

#30
post #27

The install section is out of date, at least for macos homebrew. The emacs-plus package on homebrew ( https://github.com/d12frosted/homebrew-emacs-plus ) is the best for macos.

The Yamamoto ("railwaycat") fork is far superior.

That fork doesn’t support running as daemon, does it?
Post reply on HN