Live data from Hacker News

The single most useful Emacs feature

stackoverflow.com

21–30 of 112 posts

Re: The single most useful Emacs feature

#22
post #7

Good god. I've been using emacs since 1981 and this thread is teaching me things.

I've "only" been using it since 1998, but I always skim threads like this -- even lots of short articles -- because there's nearly always something new to discover! Sometimes it's hard not to gush, but it's just such an amazing and organic piece of software.

Re: The single most useful Emacs feature

#24
Too hard to pick one, it depends on the task. Maybe I'd go with M-x Occur. Other candidates are regex i-search, registers, yasnippet, kill/copy/(insert)string-rectangle, etc etc.

Also, emacsclient.

Re: The single most useful Emacs feature

#26
post #9
post #5

hi-lock-mode! Hi-lock lets you specify regexes to highlight anywhere in a file; it's like domain-specific font-lock. It's astoundingly useful in code review. For instance, given a giant blob of J2EE web handler code, I can eyeball one handler, recognize the annotation mapping the method to URL syntax, and then punch in a hi-lock regex to light up similar annotations everywhere in the file, then glance through the who…

Occur also works nicely for this use case, as you can visit each place in order with C-x `. Actually, something like eproject-grep is even nicer, because you can visit every occurrence in the project that way.

I didn't know about occur, which is awesome and thanks. The benefit of hi-lock is that I can "read" code without actually having to "read" it.

Instead, I can either set myself up to look for patterns of colors (function --- red line --- shit no blue line!), or set myself to serendipitously discover things as I actually do read code.

I have never, ever, ever, ever figured out an Emacs "grep" that I liked enough to stop using find/xargs/grep from eshell.

Re: The single most useful Emacs feature

#28
post #7

Good god. I've been using emacs since 1981 and this thread is teaching me things.

Likewise! How will I ever get any work done with all these new productivity features I'm learning about!

My favorite Emacs feature that I've learned about in the past year is Org-Mode. I use it now for just about everything.

Re: The single most useful Emacs feature

#30
post #5

hi-lock-mode! Hi-lock lets you specify regexes to highlight anywhere in a file; it's like domain-specific font-lock. It's astoundingly useful in code review. For instance, given a giant blob of J2EE web handler code, I can eyeball one handler, recognize the annotation mapping the method to URL syntax, and then punch in a hi-lock regex to light up similar annotations everywhere in the file, then glance through the who…

This vim plugin seems to do most of what you describe by wrapping the matchadd() vimscript function:

http://www.vim.org/scripts/script.php?script_id=2666

r (regex) to add matches to the set of highlighted groups.

Post reply on HN