News for hackers. Stuff that matters.
Re:Ask HN: Resources to grok Emacs and use it well? by downerending on Wednesday April 15, 2020 @06:16PM (#22883750)
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? by philsnow on Wednesday April 15, 2020 @06:57PM (#22884145)
> 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.

If you're talking about production hosts, they shouldn't really have vanilla emacs installed either. Not having your creature comforts present on production machines is a feature, like the red shell prompt / terminal background some people use, a reminder to get you to think twice and try to not do things directly in production. If you really must, just use TRAMP, it's amazing.

If, on the other hand, you're talking about using somebody else's laptop to do anything, that doesn't make sense to optimize for, at least in my experience. I prefer not to even touch other peoples' laptops/keyboards.

Re:Ask HN: Resources to grok Emacs and use it well? by downerending on Wednesday April 15, 2020 @07:32PM (#22884402)
I'm fine with not installing emacs, as long as no one ever asks me to fix their crap on those hosts. In practice, their stuff will always break, and they always will ask me to fix it. Production hosts should never be neutered. At a bare minimum, emacs-nox, strace, nmap, tcpdump, lsof. No exceptions.

Tramp is great, but not all such hosts are reachable that way.

> I prefer not to even touch other peoples' laptops/keyboards.

Me too, but that's why they call it work.

Re:Ask HN: Resources to grok Emacs and use it well? by mbrock on Thursday April 16, 2020 @01:21AM (#22886355)
Hopefully the Emacs is also configured to not leave tilde backup files everywhere!
Re:Ask HN: Resources to grok Emacs and use it well? by User23 on Wednesday April 15, 2020 @10:45PM (#22885531)
> 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.

I wonder if I'm weird, but I use a highly customized Emacs on my dev machine, but if I have to ssh into a host and edit something I just use vi there. The correct answer to vi or emacs has always been "both" for me.

Re:Ask HN: Resources to grok Emacs and use it well? by kqr on Thursday April 16, 2020 @01:12AM (#22886299)
I'm the same way, and I don't see why that would be so controversial. Vi(m) clearly has the better defaults, but Emacs is the better platform. (Then again, I'm the person who occasionally also uses ed just to keep it fresh in my memory, so there's that.)
Re:Ask HN: Resources to grok Emacs and use it well? by regularfry on Thursday April 16, 2020 @07:17AM (#22888267)
They're just optimised for different jobs. Vim for line-based editing, emacs for nested. It just so happens that editing config files on remote hosts tends to be line-based, while editing code locally involves editing nested structures. I'll happily use both on the same machine though.
Re:Ask HN: Resources to grok Emacs and use it well? by kbp on Thursday April 16, 2020 @08:01AM (#22888507)
You can also ssh in via Emacs with Tramp, and use your highly customised Emacs to edit remotely.
Re:Ask HN: Resources to grok Emacs and use it well? by fantispug on Thursday April 16, 2020 @06:42AM (#22888028)
I'm the same; I use evil-mode in emacs and find the friction of switching between them small.
Re:Ask HN: Resources to grok Emacs and use it well? by dizzystar on Thursday April 16, 2020 @05:09AM (#22887512)
for trailing whitespace:

(add-hook 'before-save-hook 'delete-trailing-whitespace)

This deletes all whitespace when you save a buffer.

Re:Ask HN: Resources to grok Emacs and use it well? by shermanmccoy on Thursday April 16, 2020 @12:08AM (#22885951)
Linux kernel developers would not want to use the third option on your list.
Re:Ask HN: Resources to grok Emacs and use it well? by downerending on Thursday April 16, 2020 @12:00PM (#22890723)
magit? Why not?
Re:Ask HN: Resources to grok Emacs and use it well? by shermanmccoy on Thursday April 16, 2020 @08:31PM (#22895066)
Some coding styles insist on tabs. I was referring to the third line of your configuration as quoted below.

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