1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>css-mode documentation</TITLE>
<META NAME="Author" CONTENT="Lars Marius Garshol">
<META NAME="Generator" CONTENT="Homemade">
<META NAME="Description" CONTENT="Documentation of a major mode for editing CSS stylesheets
in Emacs.">
<META NAME="Keywords" CONTENT="Emacs, major mode, CSS, cascading style sheets, html
">
<!--
<LINK REL=stylesheet HREF="/visuals/standard.css" TYPE="text/css"
MEDIA=screen>
-->
</HEAD>
<BODY>
<H1>css-mode documentation</H1>
<H2>Installation</H2>
<P>
CSS-mode is easily installed; just insert this in your .emacs file:
</P>
<PRE><CODE>
(autoload 'css-mode "css-mode")
(setq auto-mode-alist
(cons '("\\.css\\'" . css-mode) auto-mode-alist))
</CODE></PRE>
<H2>Features</H2>
<H3>Font-lock</H3>
<P>
The most important feature is probably the font-locking support, which
works just like all other major modes with font-lock support.
</P>
<H3>Indentation help</H3>
<P>
css-mode has now been extended to support two indentation styles:
old-style and c-style. The default is old-style, but if you want
c-style, put this in your .emacs: <BR> <CODE>(setq
cssm-indent-function #'cssm-c-style-indenter)</CODE>
</P>
<P>
The amount of indentation is controlled by the cssm-indent-level
variable.
</P>
<P>
It is also possible to write your own indentation function, if you
don't like the two I've provided. To do this, write a function that
accepts three parameters:
</P>
<DL>
<DT>position
<DD>This will be one of the symbols <TT>inside-atmedia</TT>, <TT>inside-rule</TT>,
<TT>inside-rule-and-atmedia</TT>, <TT>inside-comment</TT> or <TT>outside</TT>.
<DT>column
<DD>This will be the column number of the first previous <TT>/*</TT>, <TT>{</TT> or <TT>}</TT>.
<DT>first-char-on-line
<DD>This will be the first character on the line to be indented. Usually used to see if the line to
be indented starts with a <TT>}</TT>, in which case it ends a block and should be
indented differently.
</DL>
<P>
The function must return the column number that the line is to be
indented to. If anyone writes an indentation function I'd be glad to
include it in future css-mode releases.
</P>
<H3>Typing help</H3>
<P>
So far, there are three kinds of typing assistance: short-cuts, mirror
mode and completion. Right now there are only two such short-cuts:
</P>
<DL>
<DT>css-insert-comment
<DD>This inserts a comment and is bound to "C-c C-c".
<DT>css-insert-url
<DD>This inserts an empty URL specification and is bound to "C-c C-u".
</DL>
<P>
Mirror mode is a sort of minor mode (it hasn't been made a proper
minor mode, but it is conceptually similar) that changes the way some
keys work. If you type a {, the matching bracket is automatically
inserted. Other keys that are mirrored are " and (.
</P>
<P>
If you don't like this mode there are three ways to turn it off:
</P>
<OL>
<LI>Edit the css-mode.el file and set the variable css-mirror-mode to nil.
<LI>Make your css-mode-hook call the function css-leave-mirror-mode.
<LI>Give the command css-leave-mirror-mode while in a CSS-mode buffer.
</OL>
<P>
Completion lets you use "M-TAB" to complete the CSS property you are
currently typing in the normal manner of TAB completion.
</P>
<HR>
<ADDRESS>
Last update 12.Oct.99 22:56, by Lars M. Garshol.
</ADDRESS>
</DIV>
</BODY>
</HTML>
|