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

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

Re: a beginner's emacs troubles


From: don provan
Subject: Re: a beginner's emacs troubles
Date: Tue, 31 Jul 2007 09:25:18 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

"f33ldead@gmail.com" <f33ldead@gmail.com> writes:

> I have something similar:
>
> #define SOMETHING      0x43
> #define SOMETHING_ELSE      0x12
> #define ANYWAY   0x56
>
> I need tabs between the defined term and it's value so that it'll be
> indented nicely. And I just can't do it. That's what I was actually
> referring to. I think it's a bad idea to decide where tabs _can_ to
> for an editor.

Yes, perfectly reasonable, but for some reason not the default
behavior. You're looking for

          (setq c-tab-always-indent nil)

This keeps tab performing the indentation feature you've been hearing
about when it's typed near the beginning of the line, but it inserts a
normal tab when typed in the middle of a line.

Also, it sounds like you'll want to hear that meta-I by default is
mapped to "tab-to-tab-stop" (i.e., what you expect tab to do), so
you might want to try playing around with the tab key set to the
indentation function and getting in the habit of using meta-I when you
really want a tab.

(It turns out that there's actually a emacs extension you can track
down that solves this problem explicitly, allowing you to line up
columns like this neatly on command. Alas, I've never felt the need to
try them, so I can't tell you what they are.)

Similarly, you mapped the enter key to newline-and-indent, but you
might be interested to know that control-J is naturally mapped to that
function. You might want to try leaving enter for the natrual
character the unindented newline and get used to using ^J for the
function you expected on Enter.

You can customize emacs all you want, of course, but I find it easier
to stick to the default mappings even when they aren't always on the
keys I expect them to be on. I do this for several reasons, but the
most convincing is that when I stick to the default mappings, 9 times
out of 10 I discover that there is, in fact, some advantage to the way
the keys are mapped out of the box.

-don provan


reply via email to

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