News for hackers. Stuff that matters.
Re:Emacs My Way by dmortin on Friday December 20, 2013 @11:21AM (#6942158)
"I had to spend around two full years memorizing key chords"

Yet another user who thinks emacs is about the key cords. It's not, it's about extensibility. I changed most of the default key bindings, because they were inconvenient.

Remember: Emacs should adapt to you, not the other way around. That's what Emacs is about.

Some people even use VIM bindings in Emacs: http://www.youtube.com/watch?v=Uz_0i27wYbg

Re:Emacs My Way by klibertp on Friday December 20, 2013 @11:53AM (#6942342)
Yes, yes, yes! I came here to write exactly this: what is the point of having infinitely configurable and extensible editor if you don't configure it and extend it to your liking?

The very first thing I did after switching to Emacs was to rebind most frequently used keys to something sane. The next thing was to make the functions themselves sane - IIRC the first command I wrote was "comment-or-uncomment-region-or-line".

My emacs config is about 4k lines of my own code at this point, very little of which implements anything by itself. It's full of customize-options, hooks and defadvices, eval-when-loads and similar things, which make Emacs into my editor. If I had to learn some defaults I couldn't change I would just use some IDE or another editor.

Re:Emacs My Way by dded on Friday December 20, 2013 @02:59PM (#6943587)
> the first command I wrote was "comment-or-uncomment-region-or-line"

verilog-mode (and I imagine others) includes something like this this. C-c C-c comments region, and C-c C-u uncomments it. It handles embedded /* */-style embedded comments intelligently.

Re:Emacs My Way by klibertp on Friday December 20, 2013 @03:08PM (#6943638)
I don't want to hit different keys for commenting and uncommenting! What I want is to have one key which does all this:

1. if there is no region active and current line is not commented - comment it

2. if there is no region active and current line is commented - uncomment it

3. if there is region active and it's fully commented - uncomment that region

4 otherwise comment the full region

And it's this easy to do this:

    (defun comment-or-uncomment-region-or-line ()
      "Comments or uncomments the region or the current line if
    there's no active region."
      (interactive)
      (let (beg end)
        (if (region-active-p)
            (setq beg (region-beginning)
                  end (region-end))
          (setq beg (line-beginning-position)
                end (line-end-position)))
        (comment-or-uncomment-region beg end)))
So I see absolutely no reason for not coding this up and using it :) (Other than, heck, it really is my first ELisp function and it shows :D)
Re:Emacs My Way by ics on Saturday December 21, 2013 @03:14AM (#6946163)
Evil-nerd-commenter does the same thing, but if I didn't use email I would have the same thing in my init. It's pretty great.