help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several beginner-questions


From: Vijay Lakshminarayanan
Subject: Re: Several beginner-questions
Date: Fri, 29 Jul 2011 23:37:15 +0530

On Fri, Jul 29, 2011 at 11:38 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> If I set it to t, TAB does nothing. If I set it to nil, then it works as
>> expected when I am in the middle of a line. However, if I am at the beginning
>> of the line, I need to press it twice --- the first TAB is swallowed, the
>> second TAB prints spaces.
>
> It's not swallowed.  Emacs doesn't indent empty lines when you type
> TAB.  This is done by the newline-and-indent command, by default bound
> to the C-j (a.k.a. Linefeed) key.  If you don't have such a key on
> your keyboard (most modern keyboards don't), bind that command to the
> Return key, like this:
>
>     (global-set-key "\C-m" 'newline-and-indent)
>

I personally swap C-m and C-j.  From my .emacs:

(defun swap-cj-cm ()
  (local-set-key (kbd "C-m") 'newline-and-indent)
  (local-set-key (kbd "C-j") 'newline))

(global-set-key (kbd "C-m") 'newline-and-indent)
(global-set-key (kbd "C-j") 'newline)

I use the function in some mode hooks that rudely set their own
keybindings for C-m/C-j but for the most part, I swap the meanings of
C-m and C-j to reflect my common usage.

Hope it helps.

-- 
Cheers
~vijay

btw, am I the only one who feels that gnus is /way/ too simple and
should be more complicated?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]