Earlier quoted context omitted.
You can also use the M-x comment-region and M-x uncomment region to comment stuff. If you use it a lot, just bind them to a convenient key stroke.
Don't forget M-; is comment-dwim which usually does... what you mean (uncomments the region if it looks commented, comments it otherwise)
The single most useful Emacs feature
101–110 of 112 posts
Re: The single most useful Emacs feature
#102hi-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…
Re: The single most useful Emacs feature
#103Earlier quoted context omitted.
Have you tried ack? http://betterthangrep.com/ There are some ack-modes for emacs, too, eg. https://github.com/nschum/full-ack
I haven't, but I don't have a problem with grep, so much as I find there's exactly enough friction with Emacs grep integration to prevent me from ever taking advantage of it.
Ack solves this by using Perl regular expressions and a built-in include/exclude list, which is annoying because you'll have to tell Emacs to tell Ack which one to use.
eproject-grep abstracts away having to type any commands or enter an include/exclude list (since the whole point of eproject is to maintain that information), but you'll still have to guess whether it's going to use grep or egrep and type the regular expression right.
multi-occur will use Emacs regular expressions, but only on open buffers.
So I guess the solution is to use eproject to open the correct buffers, and then use multi-occur on them. I will implement that and see if I like it. Perhaps you might too.
Re: The single most useful Emacs feature
#104Earlier quoted context omitted.
Out of curiosity, do you use usually emacs for J2EE code? I am an emacs user, but have been doing some J2EE stuff for the last few months, and have been getting really annoyed by the IDE's lately, and I was wondering if it was a wise choice to go with emacs for Java too.
For Java work, I use Emacs and command line tools.
Re: The single most useful Emacs feature
#105record and play macro (someone had to mention) C-x ( C-x ) C-x e M-x 99 C-x e (play macro 99 times)
Actually, that would be M-9 M-9 C-x e or C-u 99 C-x e.
Re: The single most useful Emacs feature
#106For newcomers, C-g is a delight (it certainly was for me). Especially with the arcane reputation of Emacs, it was awfully reassuring to know how to get out of whatever unfamiliar function I'd fat-fingered myself into.
ESC ESC ESC is a much better "get me out of here!" command to remember.
Re: The single most useful Emacs feature
#107This is not really a feature , as such, but it is a classic work-around for one emacs' many silly defaults: ; Ask for y/n on all queries that normally ask for yes/no. (fset 'yes-or-no-p 'y-or-n-p)
Re: The single most useful Emacs feature
#108Earlier quoted context omitted.
The register 0-9 store the last ten deletes (yanks?) in Vim. This serves the same purpose as the kill ring.
Oh yes. The only thing I wish vi had was a key that let you traverse these so you don't have to remember exactly how many yanks ago you yanked something.
Re: The single most useful Emacs feature
#109The kill ring. I would marry the kill ring and have its babies. Why have other editors not adopted this? Have they?
I wish the Windows Clipboard would implement a version of the kill ring. I really, really hate not having previous cuts and copies available. As a rather clumsy work-around I keep an emacs scratch file open on my task bar and copy stuff I might need more than once to it.
Re: The single most useful Emacs feature
#110For newcomers, C-g is a delight (it certainly was for me). Especially with the arcane reputation of Emacs, it was awfully reassuring to know how to get out of whatever unfamiliar function I'd fat-fingered myself into.
Well, it won't get you out of recursive edits. I remember visiting a coworker's machine before telling him about those, and the modeline was something like [[[[[[[[[[(CPerl)]]]]]]]]]]. ESC ESC ESC is a much better "get me out of here!" command to remember.