Commit df8deace authored by adriana's avatar adriana

Import with [PATCH sourceforge] Initial HTML fixes, new PSGML site validation...

Import with [PATCH sourceforge] Initial HTML fixes, new PSGML site validation <>

branch : adriana
parent 939c7fabe8fb
Customization Links
john s jacobs anderson
<h1>Customization Links</h1>
<p>Additions are welcome! Please mail
<a href=""></a>
with any links.
<li><a href="">Kai Grossjohann's Emacs Tutorials</a>: A Companion to the FAQ and the Emacs Manual.
<a href="Links/tutorials_toc.html">[local mirror]</a>
<h3>Changing the look of XEmacs</h3>
<li><a href="">Robin S. Socha's XEmacs Settings</a>
: large, well-commented dot file collection and screen shots
<li><a href="">Erik
Sundermann's XEmacs Customization Page</a>: good
'starter' .emacs customization page.
<li><a href="">Charles G
Waldman's customization page</a>: extensive selection of
pixmap backgrounds and instructions on how to use them.
<h3>Elisp add ons</h3>
<li><a href="">Chen's XEmacs Lisp Hacks</a>:
several nice add ons, including <b>mmm</b>, which allows
the use of <b>m</b>ultiple <b>m</b>ajor <b>m</b>odes in
a single buffer.<br>
[<a href="">mmm screenshot</a>]
<li><a href="">ClOMO
(COBOL-mode)</a>: Major mode for COBOL-sources
(yikes!). Based on "como" by Andree Peters and Harald
Weiss; hacked for xemacs by Azundris, plus various boni
(interface to fontlock, outline-mode, LaTEX-Nassi-mode,
HTML/RXML, and stuff).
<li><a href="">eicq</a>: an
ICQ client for XEmacs.
[<a href="">download</a>]
[<a href="">screen shot</a>]
<li><a href="">Emacs Lisp List</a>:
<em>Big</em> list of elisp add ons.
<li><a href="">gnuserv</a>:
gnuserv allows you to attach to an already running
Emacs. This allows external programs to make use of
Emacs' editing capabilities. It is like GNU Emacs'
emacsserver/server.el, but has many more features.
<li><a href="">Hagbard's World lisp files</a>:
several small add ons, including a 5x5 game and
utilities to make URL quoting easier.
<li><a href="">X-Symbol</a>:
The main purpose of package x-symbol is to provide some
WYSIWYGness in an area where it greatly enhance the
readability of your LaTeX or HTML source: using "real"
characters for "tokens" like <code>\oplus</code> or
<code>&amp;#8482;</code>. It also provides input
methods for these characters, both for the beginner and
the expert (some users regard this as the main reason to
use package x-symbol). WYSIWYG super- and subscripts and
images/figures are also supported.
<a href="">
download binary package]</a> (source available at site)
<h3>Package customization with XEmacs</h3>
<li><a href="">.gnus file repository</a>:
Is your news reader doing as much as it should? The
answer is available at this site.
<li><a href="">Gnus
installation tutorial</a> (in German)
<li><a href="">Robin S. Socha's Gnus settings</a>
: some .gnus files, a Gnus tutorial, and lots of
information on making Gnus and XEmacs play nicely
john s jacobs anderson
placeholder; otherwise there wouldn't be an index page in the
Links/ directory. Please DO NOT ADD LINKS HERE -- put them on
one or more of the specific pages. Thanks, jsja -->
<h1>Links to other XEmacs sites</h1>
<p>For ease of use, links have been divided into three main categories:
<li><a href="Links/customization.html">Customization links</a>
<li><a href="Links/install.html">Installation links</a>
<li><a href="Links/troubleshooting.html">Troubleshooting links</a>
Installation Links
john s jacobs anderson
<h1>Installation Links</h1>
<p>Also see
<a href="Install/">the 'official' installation instructions</a>
as well as the
<a href="Documentation/packageGuide.html">Package Quickstart Guide</a>.
<p>Additions are welcome! Please email
<a href=""></a>
with any contributions.
<h3>Getting Started</h3>
<li><a href="">
A Collection of Tutorials on Emacs: A Companion to the FAQ and the Emacs Manual
<h3>Package Installations</h3>
<li><a href="">
Installing a binary package</a>: From the
<a href="">X-symbol</a>
package site, and written specifically for that
package. Should provide a starting point for other
packages, if you've never installed a binary package and
somehow end up instruction-less.
Troubleshooting Links
john s jacobs anderson
<h1>Troubleshooting Links</h1>
<p>See the
<a href="FAQ/xemacs-faq_3.html#SEC58">troubleshooting section</a>
of the <a href="FAQ/">FAQ</a>, and be sure to try searching
the <a href="Lists/Archive/">mailing list archives</a>.
<p>Changes in recent versions that might change old behavior
are documented in the <a href="News/">NEWS files</a>.
<p>These might also be useful:
<li><a href="">FSF/GNU Emacs FAQ</a>
<li><a href="">Gnus FAQ</a>
<li><a href="">VM FAQ</a>
<p>Additions are welcome! Please email
<a href=""></a>
with any contributions.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<!-- Created by texi2html 1.56k from tutorials.texi on 8 October 1999 -->
<TITLE>A Collection of Tutorials on Emacs - Indentation</TITLE>
Go to the first, previous, <A HREF="tutorials_2.html">next</A>, <A HREF="tutorials_3.html">last</A> section, <A HREF="tutorials_toc.html">table of contents</A>.
<H1><A NAME="SEC1" HREF="tutorials_toc.html#TOC1">Indentation</A></H1>
<H2><A NAME="SEC2" HREF="tutorials_toc.html#TOC2">Basic Concepts</A></H2>
<A NAME="IDX1"></A>
There are quite a few concepts in Emacs which relate to white space at
the beginning of a line. Enough, in fact, to be potentially quite
confusing. I'll try to clear up the confusion in this little
document. The following concepts come into play:
<H3><A NAME="SEC3" HREF="tutorials_toc.html#TOC3">The <KBD>TAB</KBD> key.</A></H3>
Contrary to popular belief, the <KBD>TAB</KBD> key does not insert a tab
character in most modes. Instead, it does syntax-driven indentation in
most programming language modes. In fundamental mode, it advances to
the next tab stop. In text mode, it does relative indentation (relative
to the previous line, that is). You can type <KBD>C-q <KBD>TAB</KBD></KBD> to
insert a tab character.
<H3><A NAME="SEC4" HREF="tutorials_toc.html#TOC4">The tab character.</A></H3>
It is possible to change the way a tab character is displayed.
<SAMP>`vi'</SAMP> users do this. For example, they can set the width of a tab
character to 4, and this enables them to hit <KBD><KBD>TAB</KBD></KBD> at the
beginning of a line to indent the body of a loop, say, by one
indentation step (of 4 characters). Normally, the width of tab is eight
characters, so a file created by a <SAMP>`vi'</SAMP> user with a tab width of 4
will look different when viewed in a program which uses the default tab
width setting.
In order to correctly view files with non-standard tab width
settings, it is possible to set the variable <CODE>tab-width</CODE>, like this:
(setq-default tab-width 4)
If you only want this in a particular mode, add <CODE>(setq tab-width
4)</CODE> to that mode's hook. (See below for an explanation of mode hooks.)
<H3><A NAME="SEC5" HREF="tutorials_toc.html#TOC5">Whether or not tab characters are used for indentation.</A></H3>
Whether by syntax-driven indentation, or relative indentation (text
mode), or advancing to the next tab stop (fundamental mode), indentation
needs to insert white space. The variable <CODE>indent-tabs-mode</CODE>
controls whether or not tab characters are used for inserting the white
space. If this variable is <CODE>t</CODE>, tab characters are used to make
the file as short as possible. For example, if <CODE>tab-width</CODE> is
equal to 4 and white space of 10 characters needs to be inserted at the
beginning of the line, Emacs will insert 2 tab characters (2 times 4
equals 8 spaces), plus two space characters. With <CODE>tab-width</CODE>
equal to the default value of 8, Emacs would insert 1 tab plus 2 spaces.
Use the following line to tell Emacs to never use tab characters for
(setq-default indent-tabs-mode nil)
Use <CODE>t</CODE> rather than <CODE>nil</CODE> to tell Emacs to use tab characters
where appropriate.
If you only want this in a particular mode, add <CODE>(setq
indent-tabs-mode nil)</CODE> to that mode's hook. (See below for an
explanation of mode hooks.)
By the way, actual tab characters are really needed in Makefiles;
thus, makefile mode overrides this setting.
<H3><A NAME="SEC6" HREF="tutorials_toc.html#TOC6">The location of the tab stops.</A></H3>
The variable <CODE>tab-stop-list</CODE> contains a list of tab stop positions,
and <KBD>M-i</KBD> moves to the next tab stop. (In fundamental mode,
<KBD><KBD>TAB</KBD></KBD> also does this.) You can define your own list with a
statement like the following:
(setq tab-stop-list '(4 8 12 16))
Whether or not actual tab characters are inserted is controlled by
the variable <CODE>indent-tabs-mode</CODE>, and the number of tab characters
inserted is controlled by <CODE>tab-width</CODE> (among others).
Obviously, if you set <CODE>tab-stop-list</CODE> to a list containing multiples
of <CODE>tab-width</CODE>, then one <KBD>M-i</KBD> will insert one tab character at all
times (if <CODE>indent-tabs-mode</CODE> isn't <CODE>nil</CODE>).
The variable <CODE>tab-stop-list</CODE> controls which spots <KBD>M-i</KBD> moves
to, and <CODE>indent-tabs-mode</CODE> controls whether tab characters (plus
maybe a few space characters) are used to move to that spot, and
<CODE>tab-width</CODE> controls how many tab characters are needed.
<H3><A NAME="SEC7" HREF="tutorials_toc.html#TOC7">Syntax driven indentation.</A></H3>
This means that the current line is indented in a way that is useful for
the syntax of the programming language used. For example, in C-like
languages, the lines between an opening and a closing brace are usually
indented two to four spaces with respect to the braces themselves. In
Pascal, the lines between <CODE>begin</CODE> and <CODE>end</CODE> would be indented
two to four spaces.
Since the syntax driven indentation depends a lot on the syntax of the
programming language at hand, the major mode provides the indentation.
And customizing each major mode works a little differently, because the
programming languages are different.
For C-like languages, there is <TT>`CC mode'</TT>. It provides major modes
for C, C++, Objective C, IDL, and Java. The indentation engine is quite
flexible, and the CC mode info file has the whole story on customizing
indentation for these major modes. I'll just mention a few things.
CC mode provides for different coding styles. Type <KBD>M-x c-set-style
<KBD>RET</KBD></KBD>, then use tab completion to have a look at them, and try them
out. If you find one you like, you can add something like
<CODE>(c-set-style "gnu")</CODE> to your mode hook. These coding styles often
refer to a basic indentation offset, determined by the variable
<CODE>c-basic-offset</CODE>. Add stuff like <CODE>(setq c-basic-offset 4)</CODE> to
the mode hook in question.
If this isn't sufficient, you can go to the line where you don't like
the indentation, and type <KBD>C-c C-o</KBD>. Follow the prompts. Hit
<KBD>TAB</KBD> to re-indent the current line. Repeat until you like the
result. You can then type <KBD>C-x <KBD>ESC</KBD> <KBD>ESC</KBD></KBD> and use
<KBD>M-n</KBD> and <KBD>M-p</KBD> to locate the right <SAMP>`c-set-offset'</SAMP>
statement to add to your hook. Please note that you can enter numbers
for the indentation level, but you can also use <CODE>+</CODE> and <CODE>-</CODE> to
stand for one basic offset to the right or left, respectively, or
<CODE>++</CODE> and <CODE>--</CODE> for twice the basic offset.
I use <TT>`CPerl'</TT> mode for editing Perl code. It also provides a style
mechanism similar to the one provided by CC mode, but it doesn't provide
an interactive command which allows one to customize indentation, like
<KBD>C-c C-o</KBD> in CC mode. Type <KBD>C-h f cperl-mode <KBD>RET</KBD></KBD> for a
list of variables affecting indentation. Choose an indentation style
which is closest to what you want, then change the remaining variables
from your mode hook. You can choose an indentation style by adding
something like <CODE>(cperl-set-style "gnu")</CODE> to your mode hook.
CCC Can people provide info for other modes?
<H3><A NAME="SEC8" HREF="tutorials_toc.html#TOC8">Relative indentation.</A></H3>
This means indent to a spot indicated by the previous non-blank line.
Below, the spots relative indentation moves to are indicated with a
This is a line to show relative indentation.
^ ^ ^ ^ ^ ^ ^ ^
I find this useful for text where it can be used to format tables or to
indent itemized lists. When in text mode, the <KBD>TAB</KBD> key performs
relative indentation by default. The command name is
<H2><A NAME="SEC9" HREF="tutorials_toc.html#TOC9">Usage scenarios.</A></H2>
In the above, I explained the concepts behind the things Emacs is
doing, but I suspect you'd like some advice on when to frob which
<H3><A NAME="SEC10" HREF="tutorials_toc.html#TOC10">I want to turn off syntax driven indentation!</A></H3>
Since <TT>`vi'</TT> doesn't have syntax driven indentation, its users usually
set the tab width to some value they like, and whenever they want to
indent a line more than the previous one, they hit <KBD>TAB</KBD>. Of course,
a file which was edited in this way will look strange when loaded into
Emacs. The variable <CODE>tab-width</CODE> was made for this, just set it to the
tab width your <TT>`vi'</TT> loving colleagues use, and you can continue to use
syntax driven indentation and your cow-orkers will wonder why you can
edit code so fast...
Perhaps you also want to set <CODE>indent-tabs-mode</CODE> to <CODE>t</CODE> (which
is the default) such that Emacs actually uses tabs with the new width.
But then, maybe you want to set it to <CODE>nil</CODE> such that Emacs uses
only spaces and the looks of your code won't depend on the tab width
setting somebody uses.
And you might need to customize your indentation to be similar to the
style used by the others, lest you need to do a lot of manual
reformatting. A consistent coding style is a good thing.
<H2><A NAME="SEC11" HREF="tutorials_toc.html#TOC11">Background information.</A></H2>
This section provides background information referred to in the
<H3><A NAME="SEC12" HREF="tutorials_toc.html#TOC12">Mode hooks.</A></H3>
A central concept in Emacs is the <EM>major mode</EM>. For each kind of
text, a major mode provides functions useful in that mode. Most (if not
all) major modes provide a so-called <EM>hook</EM> which allows you to
specify Lisp code to be run when that major mode is entered. Most of
the time, this feature is used just for setting a few variables.
A <EM>mode hook</EM> is a variable which contains a list of functions to be
executed. Thus, if you want something to happen, you have to write a
function first. Writing functions is rather simple, finding a name for
the function might be the most difficult part, in fact!
So, let's say you wish to set the variable <CODE>c-basic-offset</CODE> to 3 when
in C++ mode. Additionally, you want to use no tabs for indentation.
Here's a function which does this:
(defun my-c++-indent-setup ()
(setq c-basic-offset 3)
(setq indent-tabs-mode nil))
Pay careful attention to the nesting of the parentheses. The empty
pair of parentheses is always needed, and the parenthesis opened
before the word <CODE>defun</CODE> is closed at the very end of the function.
So, all that's left is to add this function to the mode hook for C++
mode. Easy:
(add-hook 'c++-mode-hook 'my-c++-indent-setup)
You may wish to replace the <SAMP>`my'</SAMP> prefix with something else such
that you can be sure not to reuse a function name already defined
elsewhere. I use the prefix <SAMP>`kai'</SAMP>, for example. This means I've
got to be careful when snarfing code from Kai-Uwe Rommel :-)
<H2><A NAME="SEC13" HREF="tutorials_toc.html#TOC13">TODO</A></H2>
file local variables for tab-width (Per Abrahamsen)
Go to the first, previous, <A HREF="tutorials_2.html">next</A>, <A HREF="tutorials_3.html">last</A> section, <A HREF="tutorials_toc.html">table of contents</A>.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<!-- Created by texi2html 1.56k from tutorials.texi on 8 October 1999 -->
<TITLE>A Collection of Tutorials on Emacs - Key bindings</TITLE>
Go to the <A HREF="tutorials_1.html">first</A>, <A HREF="tutorials_1.html">previous</A>, <A HREF="tutorials_3.html">next</A>, <A HREF="tutorials_3.html">last</A> section, <A HREF="tutorials_toc.html">table of contents</A>.
<H1><A NAME="SEC14" HREF="tutorials_toc.html#TOC14">Key bindings</A></H1>
Binding functions to keys is something most new users of Emacs probably
do rather soon. This subject has also been discussed to quite some
extent in the FAQ, so be sure to look there as well as the chapter on
customizing key bindings in the Emacs manual.
<H2><A NAME="SEC15" HREF="tutorials_toc.html#TOC15">Online help for key bindings</A></H2>
A key binding is an association between a key (sequence) and a Lisp
command. You can type <KBD>C-h c <VAR>x</VAR></KBD> to find out which command is
invoked by the key (sequence) <VAR>x</VAR> in the current major mode. You
can get more help about <VAR>x</VAR> with <KBD>C-h k <VAR>x</VAR></KBD>. You can type
<KBD>C-h w <VAR>f</VAR> <KBD>RET</KBD></KBD> to find out which key bindings exist for
the given function <VAR>f</VAR>. Another very useful keybinding is <KBD>C-h
b</KBD> which gives you a list of all key bindings currently in effect.
So, maybe <KBD>C-h w</KBD> tells you that the function you want already has a
key binding, so you don't need your own?
<H2><A NAME="SEC16" HREF="tutorials_toc.html#TOC16">A warning about own key bindings</A></H2>
Of course, many people prefer their own key bindings rather than the
standard ones. Since no two people work alike, it is a Good Thing that
Emacs allows you to choose your own bindings, of course. However, a few
rules should be obeyed for choosing your own key bindings:
All key bindings of the form <KBD>C-c <VAR>x</VAR></KBD> where <VAR>x</VAR> is any
letter are reserved for the user. This means that you can count on all
well-behaved packages not to clobber these bindings. Please note that
bindings for non-letters might be used by major modes. (AUC-TeX uses
<KBD>C-c ;</KBD> for <CODE>comment-region</CODE>, for instance.) The bindings
<KBD>C-c C-<VAR>x</VAR></KBD> where <VAR>x</VAR> is a letter are reserved for the major
Most control key combinations (such as <KBD>C-f</KBD>) and most meta key
combinations (such as <KBD>M-f</KBD>) are already used by Emacs. A few modes
change the meanings of a few standard key bindings, so it is advisable
to stay away from the standard key bindings in the beginning, until one
gets a feel for the kinds of standard key bindings which are most
As an example, <KBD>M-a</KBD> normally moves backward a sentence, but in C
mode it moves backward a statement.
It might be best if you get into the habit of doing <KBD>C-h b</KBD> in the
major modes you use.