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 <uya31ubq5.fsf@ecf.teradyne.com>

--HG--
branch : adriana
parent 939c7fabe8fb
%title%
Customization Links
%author%
john s jacobs anderson
%main%
<h1>Customization Links</h1>
<p>Additions are welcome! Please mail
<a href="mailto:webmaster@xemacs.org">webmaster@xemacs.org</a>
with any links.
<h3>Tutorials</h3>
<ul>
<li><a href="ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tutorials/tutorials_toc.html">Kai Grossjohann's Emacs Tutorials</a>: A Companion to the FAQ and the Emacs Manual.
<a href="Links/tutorials_toc.html">[local mirror]</a>
</ul>
<h3>Changing the look of XEmacs</h3>
<ul>
<li><a href="http://socha.net/XEmacs/">Robin S. Socha's XEmacs Settings</a>
: large, well-commented dot file collection and screen shots
<li><a href="http://petaxp.rug.ac.be/~erik/xemacs/">Erik
Sundermann's XEmacs Customization Page</a>: good
'starter' .emacs customization page.
<li><a href="http://home.fnal.gov/~cgw/xemacs/">Charles G
Waldman's customization page</a>: extensive selection of
pixmap backgrounds and instructions on how to use them.
</ul>
<h3>Elisp add ons</h3>
<ul>
<li><a href="http://members.tripod.com/gchen2/xemacs/">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="http://members.tripod.com/gchen2/xemacs/mmm.gif">mmm screenshot</a>]
<li><a href="http://www.thepentagon.com/azundris/hacks/lisp/">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="http://www.sfu.ca/~stephent/eicq/">eicq</a>: an
ICQ client for XEmacs.
[<a href="http://www.sfu.ca/~stephent/eicq/download/eicq.tar.gz">download</a>]
[<a href="http://www.sfu.ca/~stephent/eicq/eicq.gif">screen shot</a>]
<li><a href="http://www.anc.ed.ac.uk/~stephen/emacs/ell.html">Emacs Lisp List</a>:
<em>Big</em> list of elisp add ons.
<li><a href="http://meltin.net/hacks/emacs/">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="http://www.acemake.com/hagbard/emacs.html">Hagbard's World lisp files</a>:
several small add ons, including a 5x5 game and
utilities to make URL quoting easier.
<li><a href="http://www.fmi.uni-passau.de/~wedler/x-symbol/">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.
<br>[
<a href="http://www.fmi.uni-passau.de/~wedler/x-symbol/x-symbol-pkg.tar.gz">
download binary package]</a> (source available at site)
</ul>
<h3>Package customization with XEmacs</h3>
<ul>
<li><a href="http://superdave.socom.com/gnus/">.gnus file repository</a>:
Is your news reader doing as much as it should? The
answer is available at this site.
<li><a href="http://linux01.gwdg.de/~steufel/steffi-xemacs.html">Gnus
installation tutorial</a> (in German)
<li><a href="http://socha.net/Gnus/">Robin S. Socha's Gnus settings</a>
: some .gnus files, a Gnus tutorial, and lots of
information on making Gnus and XEmacs play nicely
together.
</ul>
<br><br>
%title%
Links
%author%
john s jacobs anderson
%main%
<!-- IMPORTANT NOTE TO WEB MAINTAINERS: This is basically a
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:
<ul>
<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>
</ul>
%title%
Installation Links
%author%
john s jacobs anderson
%main%
<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="mailto:webmaster@xemacs.org">webmaster@xemacs.org</a>
with any contributions.
<h3>Getting Started</h3>
<ul>
<li><a href="ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tutorials/tutorials_toc.html">
A Collection of Tutorials on Emacs: A Companion to the FAQ and the Emacs Manual
</a>
</ul>
<h3>Package Installations</h3>
<ul>
<li><a href="http://www.fmi.uni-passau.de/~wedler/x-symbol/man/x-symbol_2.html">
Installing a binary package</a>: From the
<a href="http://www.fmi.uni-passau.de/~wedler/x-symbol/">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.
</ul>
<br><br>
%title%
Troubleshooting Links
%author%
john s jacobs anderson
%main%
<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:
<ul>
<li><a href="http://www.emacs.org/FAQ/faq_toc.html">FSF/GNU Emacs FAQ</a>
<li><a href="http://www.ccs.neu.edu/software/contrib/gnus/">Gnus FAQ</a>
<li><a href="http://www.wonderworks.com/vm/FAQ.html">VM FAQ</a>
</ul>
<p>Additions are welcome! Please email
<a href="mailto:webmaster@xemacs.org">webmaster@xemacs.org</a>
with any contributions.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from tutorials.texi on 8 October 1999 -->
<TITLE>A Collection of Tutorials on Emacs - Indentation</TITLE>
</HEAD>
<BODY>
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>.
<P><HR><P>
<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>
<P>
<A NAME="IDX1"></A>
<P>
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>
<P>
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>
<P>
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.
<P>
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:
<PRE>
(setq-default tab-width 4)
</PRE>
<P>
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>
<P>
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.
<P>
Use the following line to tell Emacs to never use tab characters for
indentation:
<PRE>
(setq-default indent-tabs-mode nil)
</PRE>
<P>
Use <CODE>t</CODE> rather than <CODE>nil</CODE> to tell Emacs to use tab characters
where appropriate.
<P>
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.)
<P>
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>
<P>
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:
<PRE>
(setq tab-stop-list '(4 8 12 16))
</PRE>
<P>
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).
<P>
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>).
<P>
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>
<P>
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.
<P>
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.
<P>
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.
<P>
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.
<P>
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.
<P>
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.
<BLOCKQUOTE>
<P>
CCC Can people provide info for other modes?
</BLOCKQUOTE>
<H3><A NAME="SEC8" HREF="tutorials_toc.html#TOC8">Relative indentation.</A></H3>
<P>
This means indent to a spot indicated by the previous non-blank line.
Below, the spots relative indentation moves to are indicated with a
caret.
<PRE>
This is a line to show relative indentation.
^ ^ ^ ^ ^ ^ ^ ^
</PRE>
<P>
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
<CODE>indent-relative</CODE>.
<H2><A NAME="SEC9" HREF="tutorials_toc.html#TOC9">Usage scenarios.</A></H2>
<P>
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
options.
<H3><A NAME="SEC10" HREF="tutorials_toc.html#TOC10">I want to turn off syntax driven indentation!</A></H3>
<P>
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...
<P>
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.
<P>
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>
<P>
This section provides background information referred to in the
above.
<H3><A NAME="SEC12" HREF="tutorials_toc.html#TOC12">Mode hooks.</A></H3>
<P>
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.
<P>
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!
<P>
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:
<PRE>
(defun my-c++-indent-setup ()
(setq c-basic-offset 3)
(setq indent-tabs-mode nil))
</PRE>
<P>
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.
<P>
So, all that's left is to add this function to the mode hook for C++
mode. Easy:
<PRE>
(add-hook 'c++-mode-hook 'my-c++-indent-setup)
</PRE>
<P>
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>
<UL>
<LI>
file local variables for tab-width (Per Abrahamsen)
</UL>
<P><HR><P>
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>.
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from tutorials.texi on 8 October 1999 -->
<TITLE>A Collection of Tutorials on Emacs - Key bindings</TITLE>
</HEAD>
<BODY>
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>.
<P><HR><P>
<H1><A NAME="SEC14" HREF="tutorials_toc.html#TOC14">Key bindings</A></H1>
<P>
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>
<P>
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.
<P>
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>
<P>
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:
<UL>
<LI>
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
modes.
<LI>
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
useful.
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.
</UL>