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

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

Re: Understanding Emacs and Tabs


From: Kai Großjohann
Subject: Re: Understanding Emacs and Tabs
Date: Sat, 17 May 2003 22:02:39 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

address@hidden (Eric Pement) writes:

> address@hidden (Kai Großjohann) wrote in message news:<address@hidden>...
>> address@hidden (Eric Pement) writes:
>> 
>> > Hi! I've just posted a web page entitled "Understanding GNU Emacs
>> > and Tabs", which I hope to be of help to other users
> [ ... ] 
>
>> I wish it explained better about syntax-driven indentation.  The key
>> issue, I think, is that syntax-driven indentation can usually be
>> configured to the user's liking.  And once that has happened, it is a
>> useful time-saver.
>
>    That's something that I need to learn more about, but I haven't
> got enough experience to understand it well enough to explain it
> to others. My main experience is with web programming languages
> (HTML, XML, Perl, PHP, JavaScript, etc.).

Hm, okay.  Indentation of HTML and XML is a thorny issue, because
there are at least three different modes out there and each of them
handles indentation differently.

The key thing to remember about syntax-driven indentation is that it
works differently in each mode, because the syntax is different in
each mode.

>> Another detail that might be useful is the variable
>> c-tab-always-indent.
>
>    I will try to work it in there, but my thought was that perhaps
> this variable is used only for C programming? 

For Perl, there are also two modes, perl-mode and cperl-mode, and
cperl-mode has a variable cperl-tab-always-indent.  Not sure about
perl-mode.

So there are some modes which have similar variables.

> I use Emacs more frequently for HTML, outline-mode, plain text, so I
> assumed that maybe c-tab-always-indent was not used that often.

I see.  Well, C programmers will have a different opinion :-)

> My more frequent frustrations happen when I'm editing my .emacs file
> (Lisp-mode) and the TAB key doesn't seem to work like I expect. So
> I've developed a habit of just using the spacebar to do all my
> indentation.

What do you expect from the TAB key?  And what does it do?

FWIW, I use TAB for syntax driven indentation in all modes, and I use
M-i to advance to the next tab stop.  For me, tab-stop-list contains
multiples of 8, so M-i conveniently inserts a tab character if
indent-tabs-mode is t.

Then if in some modes TAB in the middle of a line does not indent, I
try to find out how to make it so.  And if that is not possible, I
just use TAB at the beginning of the line in those modes.

-- 
This line is not blank.


reply via email to

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