Without doubt, the most commonly used markup language today is hypertext markup language (HTML), used for creating web pages. HTML consists of text with tags that define characteristics about the text. HTML is not hard to write, and you could use Emacs or any other editor to write the tags and the text. An HTML tag generally looks like this:
<tagname>text being tagged</tagname>
For your convenience, several modes are available for writing HTML in Emacs, including HTML mode, HTML helper mode, html menus, and a variety of SGML[1] tools including sgml mode and psgml mode. Of these tools, we've chosen to describe HTML mode, a variant of sgml mode, which is included in GNU Emacs, and HTML helper mode, which is a popular add-on. If you are writing XHTML, a stricter version of HTML that can be validated, you should consider XHTML mode, described briefly in this section, or psgml mode, covered later in the XML section of this chapter.
Serious web developers may want to investigate some of the cutting edge development going on to make Emacs even more powerful. Check out HTMLModeDeluxe (http://www.emacswiki.org/cgi-bin/wiki/HtmlModeDeluxe) and the Emacs WebDev Environment by Darren Brierton (http://www.dzr-web.com/people/darren/projects/emacs-webdev). Both of these tools support mmm mode (where mmm stands for "multiple major modes"). Using this feature, the cursor changes major mode depending on the section of the page you are editing. When you edit a script, the mode changes automatically to support that type of authoring. Both are excellent tools for building complex web pages.
In the following sections, we are not going to teach you to write HTML. (For more information on writing HTML, see HTML and XHTML: The Definitive Guide by Chuck Musciano and Bill Kennedy, O'Reilly) Rather, we're going to teach you the rudiments of using HTML mode and HTML helper mode to help you create HTML documents.
To start HTML mode, type M-x
html-mode (or simply
open an HTML
file). Most authors use a standard template when they write HTML. You
may already have one. If you don't, HTML mode is
happy to supply one for you. Simply start by typing C-c C-t (for sgml-tag) or by selecting Insert Tag from the
SGML menu. If you enter the <html>
tag that
signifies the start of an HTML document, Emacs inserts a basic
template in your buffer.
Note that Emacs automatically creates a first-level header that is equal to the title you entered. It also inserts a hyperlink so that readers can email you. Depending on your spam tolerance, you may want to delete that line. Also, Emacs is just guessing at your name and email address. You can set these explicitly by adding two lines to your .emacs file. Change Mr. Dickens' information to settings appropriate for you.
(setq user-mail-address "cdickens@great-beyond.com") (setq user-full-name "Charles Dickens")
You could approach HTML mode in a couple of ways. You could learn the key bindings for various tags, or you could simply use the sgml-tag command for everything. It depends how many bindings you want to learn. A mixed approach may be best, where you learn keystrokes for the most common tags and use sgml-tag for less common tags.
Key bindings are
intuitive in HTML mode. Like most
specialized editing modes, many functions are bound to C-c C-
something.
We've seen C-c C-t
to insert a tag. You won't be too surprised to find
that to move forward to the next tag you type C-c C-f and to move back to the previous tag
you type C-c C-b. To insert an
<href>
tag, type C-c
C-h. You see what we mean.
HTML mode is designed for
writing
HTML, not XHTML. XHTML is stricter, requiring all tags to have a
closing tag. The common <p>
tag is a salient
example. HTML authors would never use the closing tag
</p>
that XHTML requires. HTML mode inserts
a lone <p>
tag even when given a command,
such as sgml-tag, that normally
inserts a tag pair. If you want to write XHTML, use XHTML mode
instead. Emacs starts this mode itself if your file contains a
reference to an XHTML document type definition. Other than completion
of tags, XHTML mode is very similar to HTML mode described
here.[2]
Being able to hide the tags is a helpful feature. To hide HTML tags, type C-c Tab; use the same command to display the tags again. Let's say that we've inserted some of our dickens file into the dickens.html file we were just working with.
You can keep typing text, concentrating on what you're writing rather than being distracted by the markup. Emacs protects you from deleting tags when you're writing by making hidden text read-only. If you move the cursor onto a hidden tag, Emacs displays it in the minibuffer.
Of course, the whole purpose of writing HTML is to display it in a web browser. Typing C-c C-v (for browse-url-of-buffer) opens the default web browser to view the web page you're writing.
If you'd like to look at the file in a web browser each time you save, you can turn on a function called html-autoview-mode, invoked by pressing C-c C-s. When you save the file, Emacs automatically opens it in the default browser.
What if you want to include
special characters or characters from other character sets in your
web page? The short answer is that you can enter a
character's encoding explicitly. For example, to
enter a capital U with an umlaut, you can type
Ü
. Many characters can also be
represented as named entities, which are certainly easier to remember
than numbers. For example, the named entity for a capital U with an
umlaut is Ü
.
But HTML mode does provide more support than this.
We'll take the simplest case first.
Let's say you can create a character with your
keyboard; for a common case, take the ampersand, a character that
must be encoded since it has a special meaning in HTML. Type
C-c C-n & Enter. Emacs inserts
the entity for an ampersand, &
. You can
insert entities for a wide variety of keyboard characters this way.
But let's say that you are inserting characters that are not on your keyboard. For example, perhaps you are in the U.S. writing up a list of contributors from Europe and many of their names have accent marks. The ISO Latin-1 character set will handle this.
If you have a keyboard that already emits Latin-1 characters and
Latin-1 is your default coding system for keyboard input, inserting
such characters is relatively straightforward. Simply press C-c 8 to turn on a minor mode called SGML name
entity mode. Emacs says sgml name entity mode is now
on
.[3]
C-c
8 toggles this state. Type Latin-1 characters as you
normally would and Emacs inserts the named entities associated with
those characters.
For those of us with other keyboard encodings, however, there's a bit more to do. To get bindings to insert entities into your HTML file, we discuss two options. The first is ISO accents mode. This mode provides support, as the name implies, for accented text. Whether you're typing umlauts, cedillas, circumflexes, acute, or grave marks, ISO accents mode is up to the task. The other option is to use the C-x 8 prefix to insert a wide range of entities, including currency signs, mathematical symbols, and copyright signs (as well as all the accented characters ISO accents mode supports).
To use ISO accents mode
to insert
entities in your file, type C-c 8 to
turn on SGML name entity mode, then M-x
iso-accents-mode Enter to turn on that mode. In ISO
accents mode, certain characters (including /, ~, ', ", `, and ^) are
interpreted as prefixes to create accented characters. SGML name
entity mode captures these keystrokes and automatically inserts the
appropriate HTML entity. For example, typing 'a
produces the HTML entity for á,
á
. For specific key bindings, see Table 8-2.
You can also insert a wide range of entities using C-x 8 after you do some setup.[4] First enter SGML name entity mode by typing C-c 8. Next specify Latin-1 as your character set by typing C-x Enter k latin-1 Enter. You can then enter a large number of entities by typing commands prefixed with C-x 8. For example, to insert the entity for a yen symbol, type C-x 8 Y. Watch the minibuffer. The literal character will appear in the minibuffer as the entity is inserted. Both ISO accents mode and the C-x 8 prefixes allow you to type a single undo command (C-_) to translate the entity back into the literal character.
Table 8-2 provides a list of accented characters and the bindings that help insert them. Table 8-3 lists other named entities including punctuation marks and symbols.
Table 8-2. Bindings for inserting entities for accented characters[5]
C-x 8 prefix keystrokes |
ISO accents mode shortcut |
Character entity |
Character displayed in browser |
---|---|---|---|
C-x 8 " |
" |
´ |
´ |
C-x 8 ' a |
' a |
á |
á |
C-x 8 'A |
'A |
Á |
Á |
C-x 8 ' e
|
' e
|
é |
é |
C-x 8 ' E
|
' E
|
É |
É |
C-x 8 ' i
|
' i
|
í |
í |
C-x 8 ' I |
' I |
Í |
Í |
C-x 8 ' o
|
' o
|
ó |
ó |
C-x 8 ' O
|
' O
|
Ó |
Ó |
C-x 8 ' u
|
' u
|
ú |
ú |
C-x 8 ' U
|
' U
|
Ú |
Ú |
C-x 8 ' y
|
' y
|
ý |
|
C-x 8 ' Y
|
' Y
|
Ý |
|
C-x 8 ` a
|
` a
|
à |
à |
C-x 8 ` A |
` A |
À |
À |
C-x 8 ` e |
` e |
è |
è |
C-x 8 ` E |
` E |
È |
È |
C-x 8 ` i |
` i |
ì |
ì |
C-x 8 ` I |
` I |
Ì |
Ì |
C-x 8 ` o |
` o |
ò |
ò |
C-x 8 ` O |
` O |
Ò |
Ò |
C-x 8 ` u |
` u |
ù |
ù |
C-x 8 ` U |
` U |
Ù |
|
C-x 8 ^ a |
^ a |
â |
â |
C-x 8 ^ A |
^ A |
 |
 |
C-x 8 ^ e |
^ e |
ê |
ê |
C-x 8 ^ E |
^ E |
Ê |
Ê |
C-x 8 ^ i |
^ i |
î |
î |
C-x 8 ^ I |
^ I |
Î |
Î |
C-x 8 ^ o |
^ o |
ô |
ô |
C-x 8 ^ O |
^ O |
Ô |
Ô |
C-x 8 ^ u |
^ u |
û |
û |
C-x 8 ^ U |
^ U |
Û |
Û |
C-x 8 " " |
" " |
¨ |
¨ |
C-x 8 " a |
" a |
ä |
ä |
C-x 8 " A |
" A |
Ä |
Ä |
C-x 8 " e |
" e |
ë |
ë |
C-x 8 " E |
" E |
Ë |
Ë |
C-x 8 " i |
" i |
ï |
ï |
C-x 8 " I |
" I |
Ï |
Ï |
C-x 8 " o |
" o |
ö |
ö |
C-x 8 " O |
" O |
Ö |
Ö |
C-x 8 " u |
" u |
ü |
ü |
C-x 8 " U |
" U |
Ü |
Ü |
C-x 8 " s |
" s |
ß |
ß |
C-x 8 " y |
" y |
ÿ |
ÿ |
C-x 8 " Y |
" Y |
Ÿ |
Ÿ |
C-x 8 ~ ~ |
¬ |
¬ | |
C-x 8 ~ a |
~ a |
ã |
ã |
C-x 8 ~ A |
~ A |
à |
à |
C-x 8 ~ d |
~ d |
ð |
|
C-x 8 ~ D |
~ D |
Ð |
|
C-x 8 ~ n |
~ n |
ñ |
ñ |
C-x 8 ~ N |
~ N |
Ñ |
Ñ |
C-x 8 ~ o |
~ o |
õ |
õ |
C-x 8 ~ O |
~ O |
Õ |
Õ |
C-x 8 ~ t |
~ t |
þ |
|
C-x 8 ~ T |
~ T |
Þ |
|
C-x 8 / / |
÷ |
÷ | |
C-x 8 o |
/ / |
˚ |
° |
C-x 8 / a |
/ a |
å |
å |
C-x 8 / A |
/ A |
Å |
Å |
C-x 8 / e |
/ e |
æ |
æ |
C-x 8 / E |
/ E |
Æ |
Æ |
C-x 8 / o |
/ o |
ø |
ø |
C-x 8 / O |
/ O |
Ø |
Ø |
C-x 8 , , |
~~ |
¸ |
¸ |
C-x 8 , c |
~c |
ç |
ç |
C-x 8 , C |
~C |
Ç |
Ç |
[5] For instructions on making these bindings work properly, read this section carefully. |
Table 8-3. Bindings for inserting entities for punctuation and symbols
Table 8-4 lists HTML mode commands.
Table 8-4. HTML mode commands
Keystrokes |
Command name |
Action |
---|---|---|
(none) |
html-mode |
Enter HTML mode. |
C-c C-t SGML → Insert Tag |
sgml-tag |
Inserts a tag, prompting for attributes. If you enter html as the tag name, inserts a template html file. |
C-c Tab SGML → Toggle Tag Visibility |
sgml-tags-invisible |
Hides or shows the tags in the file. |
C-c C-v SGML → View Buffer Contents |
browse-url-of-buffer |
Display buffer in default browser. |
C-c C-s |
html-autoview- mode |
If this mode is on (this command toggles it), display file in browser each time it is saved in Emacs. |
C-c 8 |
sgml-name-8bit-mode |
If turned on, certain keystrokes for inserting Latin-1 characters are captured and replaced with the appropriate entities. See "Character encoding in HTML mode" for details. |
C-c C-f SGML → Forward Tag |
sgml-skip-tag-forward |
Move forward to the next tag of the same level. |
C-c C-b SGML → Backward Tag |
sgml-skip-tag-backward |
Move backward to previous tag of the same level. |
C-c Del or C-c C-d SGML → Delete Tag |
sgml-delete-tag |
With cursor on or before a tag, deletes tag or tag pair. |
C-c 1 |
html-headline-1 |
Insert an |
C-c 2 |
html-headline-2 |
Insert an |
C-c 3 |
html-headline-3 |
Insert an |
C-c 4 |
html-headline-4 |
Insert an |
C-c 5 |
html-headline-5 |
Insert an |
C-c 6 |
html-headline-6 |
Insert an |
C-c Enter |
html-paragraph |
Insert |
C-c C-c h HTML → Href Anchor |
html-href-anchor |
Insert a hyperlink. |
C-c C-c n HTML → Name Anchor |
html-name-anchor |
Insert an anchor so that a link can be created to the anchored part of the page. |
C-c C-c u HTML → Unordered List |
html-unordered-list |
Create a bulleted list. |
C-c C-c o HTML → Ordered List |
html-ordered-list |
Create a numbered list. |
C-c C-c l HTML → List Item |
html-list-item |
Add an item to a list. |
C-c C-c i HTML → Image |
html-image |
Insert |
C-c C-j HTML → Line Break |
html-line |
Insert a line break ( |
C-c C-c - HTML → Horizontal Rule |
html-horizontal-rule |
Insert a horizontal rule ( |
C-c C-c r |
html-radio-buttons |
Insert a group of radio buttons. Emacs prompts for a name for the group, then repeatedly for value, whether it should be checked, and associated text. Press C-g to complete the group. |
C-c C-c c HTML → Checkboxes |
html-checkboxes |
Insert a group of checkboxes. Emacs prompts for a name for the group, then repeatedly for value, whether it should be checked, and associated text. Press C-g to complete the group. |
C-c ? SGML → Describe Tag |
sgml-tag-help |
Provide brief verbal description of tag at cursor position. |
HTML helper mode, written by Nelson Minar and now maintained by Gian Uberto Lauri, offers great flexibility in writing HTML. You can enable various hand-holding features depending on your level of expertise and preferences.
Why would you choose HTML helper mode over Emacs's own HTML mode? Although HTML mode makes it easy to write basic HTML, it provides little support for programmatic, interactive web pages. HTML helper mode supports ASP, JSP (and JDE, the Java Development Environment, discussed in Chapter 9), and PHP, to name a few more advanced features. If you're writing HTML in Emacs, you're likely to be a developer of such pages rather than a more text-oriented author. For this reason, HTML helper mode continues to be popular among Emacs users.
Html helper mode is not part of Emacs by default. You can download it from its homepage at http://www.nongnu.org/baol-hth. Download the file into a directory such as ~/elisp, move to that directory, and then type:
% tar xvzf html-helper-mode.tar.gz
The system unpacks the tar file for you. (Of course, if you are installing on Windows, you can simply use WinZip to decompress and unpack the file.) The tar file contains several components, including:
html-helper-mode.el—the Lisp file for HTML helper mode
hhm-changelog—changes that have been made
hhm-config.el—a Lisp file that allows Emacs customization to work[6]
Before you can start HTML helper
mode, you
have to load it into Emacs. (For a complete discussion of this topic,
see "Building Your Own Lisp
Library" in Chapter 11; we
describe it briefly here.) Begin by typing M-x
load-file Enter. Emacs asks which file to load and you
enter ~/elisp/html-helper-mode.el
and press Enter, adjusting the path
to reflect the location where you installed
html-helper-mode.el. You enter the mode by
typing M-x html-helper-mode Enter.
HTML helper
appears on the mode line.
Making HTML helper mode part of your startup is easier. Put the following lines in your .emacs file:
(setq load-path (cons "~/elisp " load-path)) (autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
In the first line, insert the complete path for the directory in which html-helper-mode.el is located in quotation marks, replacing ~/elisp to the correct value for your system. The second line tells Emacs to load HTML helper mode automatically when you start Emacs.
If you want to use HTML helper mode for editing HTML files by default, add this line to .emacs as well:
(setq auto-mode-alist (cons '("\\.html?$" . html-helper-mode) auto-mode-alist))
If you edit other types of files with HTML helper mode, you may want to add lines to include all the types of files you edit. Adding more lines is the easiest way. For example, to make HTML helper mode the default for PHP files, add this line to .emacs:
(setq auto-mode-alist (cons '("\\.php$" . html-helper-mode) auto-mode-alist))
The main reason people like HTML helper mode is that it provides easy menu access to a wide variety of options. Realizing that having a crowded menu with many submenus could overwhelm new users, the authors created an option called Turn on Novice Menu. Selecting this option from the HTML menu provides a barebones menu, as shown in Figure 8-1. Novice HTML writers can use these options to create a basic HTML document without worrying about what forms, JSPs, PHP, and the like mean.
Selecting Turn on Expert Menu from the HTML menu returns the larger menu with its numerous submenus, as shown in Figure 8-2.
HTML helper mode inserts a template for you every time you create a new HTML file.
Type: C-x C-f new.html |
|
HTML helper mode inserts a template with all the basic elements needed for a valid HTML document (Windows). |
The template contains all the basic HTML elements. The entire
document is surrounded by
<html></html>
tags. Then the head and
the body are separated. Following an <hr>
tag that tells the browser to insert a horizontal line, called a
horizontal rule, the <address>
tag leaves a
place for the author to put in his or her email address. In these
days of spam, it's unlikely you'll
want to do that. (You can leave the
<address>
tag blank or delete it.)
If you do want to include an email address, enter a line like this in your .emacs file (substituting your own email address, of course):
(setq html-helper-address-string "<a href=\"mailto:cdickens@great-beyond.com "\>Charles Dickens</a>")
Normally you begin filling out the template by entering title and a
level-one header (these are often the same). You can then begin
writing paragraphs of text. Before you start typing, press M-Enter. Emacs inserts
<p></p>
and positions the cursor
between them. You can see from the ending paragraph tag that HTML
helper mode is working toward XHTML compliance.
When editing HTML files, you often spend a lot of time marking up existing text. If you preface any of the tag commands with C-u, Emacs inserts the tags around a region rather than putting them at the cursor position.[7] To demonstrate, we'll start a new HTML file and insert text from our dickens file.
Move the cursor past the |
|
Emacs inserts the dickens text file, to which we can add HTML tags. |
If you were really doing this properly, you'd type something like "A Tale of Two Cities, Chapter 1 as the title and the first-level header. But for now, you just want to see how to mark up a region of existing text. Begin by marking the Dickens paragraph as a region and type C-u M-Enter.
HTML helper mode supports completion. You type the beginning of a tag and press M-Tab (for tempo-complete-tag).[8] If there's more than one possibility, a window of possible completions appears. Let's say you are working on a bulleted list.
Note, however, that completion is sometimes case-sensitive. For example, typing <s M-Tab shows the following completions:
<select <span class= <span style = <strike> <strong> <samp>
Notice that the <script>
tag is missing. But
if you try typing <S M-Tab, the
script tag and its attributes are inserted, as in:
<SCRIPT TYPE="text/javascript"> </SCRIPT>
The distinction between upper- and lowercase shows that HTML helper mode is moving toward XHTML compliance, but hasn't quite arrived. XHTML requires that all tags be lowercase. On the positive side, note that the attribute is in quotation marks, another XHTML requirement.
Some HTML tags require you to input certain attributes. For example, when you enter a hyperlink, you have to specify the URL of the link and the text that the user will select. If you type C-c C-a l (the lowercase letter "L") to enter a link, HTML helper mode inserts:
<a href=""></a>
with the cursor on the second quotation mark so you can type in the URL. HTML helper mode offers additional help if you turn on prompting. Add this line to your .emacs file:
(setq tempo-interactive t)
Note that HTML helper mode prompts only for required attributes; if you want to input optional attributes, you have to add them by hand.
Whether you consider prompting useful or intrusive is a matter of personal taste. If you are a beginning HTML author, prompting may help you remember to enter all the necessary information for each tag. If you find you don't like it, simply delete the line you added to the .emacs file.
HTML helper mode supports entry of
only the most common character
entities. However, it does make it easy to insert these entities.
Simply type C-c before the character
in question. For example, type C-c
< to enter the escape code for a less-than sign
(<
).
Character entities are also available by selecting HTML→ Insert Character Entities.
Table 8-5 lists bindings for inserting character entities in HTML helper mode.
Table 8-5. Inserting character entities in HTML helper mode
Table 8-6 lists the key bindings for HTML helper mode. There are key bindings for advanced HTML features such as forms as well as for some of the HTML 3.0 features. Some tags would normally appear on different lines (for example, in the case of a list); in this table, they are shown on one line.
Table 8-6. HTML helper mode commands
Keystrokes |
Command name |
Action |
---|---|---|
C-u |
universal-argument |
When used before any other tag command, insert tags around a region. |
M-Tab |
tempo-complete-tag |
Complete the current tag. |
C-c C-z v HTML → Load This Buffer in Browser |
browse-url-of-file |
Display this file in the default browser. |
C-c C-z u HTML → Browse URL at Point |
browse-url-default-browser |
Load the URL at point in default browser. |
C-c M-h 1 HTML → Insert Headers → Header 1 |
tempo-template-html-header-1 |
Insert |
C-c M-h 2 HTML → Insert Headers → Header 2 |
tempo-template-html-header-2 |
Insert |
C-c M-h 3 HTML → Insert Headers → Header 3 |
tempo-template-html-header-3 |
Insert |
C-c M-h 4 HTML → Insert Headers → Header 4 |
tempo-template-html-header-4 |
Insert |
C-c M-h 5 HTML → Insert Headers → Header 5 |
tempo-template-html-header-5 |
Insert |
C-c M-h 6 HTML → Insert Headers → Header 6 |
tempo-template-html-header-6 |
Insert |
M-Enter HTML → Insert Text Elements → Paragraph |
tempo-template-html-paragraph |
Insert |
C-c C-a l HTML → Insert Hyperlinks → Hyperlink |
tempo-template-html-hyperlink |
Insert |
C-c C-a n HTML → Insert Hyperlinks → Target |
tempo-template-html-link-target |
Insert |
C-c Enter HTML → Insert Text Elements → Line Break |
tempo-template-html-line-break |
Insert a literal line break, |
C-c = HTML → Insert Text Elements → Horizontal Line |
tempo-template-html-horizontal-line |
Insert a horizontal rule, |
C-c C-z t HTML → Insert Timestamp Delimiter |
html-helper-insert-timestamp-delimiter-at-point |
Insert timestamp delimiters. |
C-c C-h t HTML → Insert Structural Elements → Title |
tempo-template-html-title |
Insert |
C-c Tab a HTML → Insert Inlined Images → Image |
tempo-template-html-image |
Insert |
C-c C-l u HTML → Insert List Elements → Unordered List |
tempo-template-html-unordered-list |
Insert |
C-c C-l o HTML → Insert List Elements → Ordered List |
tempo-template-html-ordered-list |
Insert |
C-c C-l t HTML → Insert List Elements → Definition Item |
tempo-template-html-definition-item |
Insert |
C-c C-l l HTML → Insert List Elements → List Item |
tempo-template-html-item |
Insert |
C-c C-l d HTML → Insert List Elements → Definition List |
tempo-template-html-definition-list |
Insert |
C-c C-l m HTML → Insert List Elements → Menu List |
tempo-template-html-menu-list |
Insert
|
C-c C-l r HTML → Insert List Elements → Directory List |
tempo-template-html-directorylist |
Insert
|
C-c C-l i HTML → Insert List Elements → List Item |
html-helper-smart-insert-item |
Insert |
C-c C-f z HTML → Insert Form Elements → Rest Form |
tempo-template-html-reset-form |
Insert |
C-c C-f b HTML → Insert Form Elements → Button |
tempo-template-html-button |
Insert |
C-c C-f m HTML → Insert Form Elements → Submit Form |
tempo-template-html- submit-form |
Insert |
C-c C-f s HTML → Insert Form Elements → Selections |
tempo-template-html-selections |
Insert |
C-c C-f o HTML → Insert Form Elements → Option |
tempo-template-html-option |
Insert |
C-c C-f v HTML → Insert Form Elements → Option with Value |
tempo-template-html-option-with-value |
Insert |
C-c C-f i HTML → Insert Form Elements → Image Field |
tempo-template-html-input-image-field |
Insert |
C-c C-f r HTML → Insert Form Elements → Radiobutton |
tempo-template-html-input-radiobutton |
Insert |
C-c C-f c HTML → Insert Form Elements → Checkbox |
tempo-template-html-checkbox |
Insert |
C-c C-f p HTML → Insert Form Elements → Text Area |
tempo-template-html-text-area |
Insert |
C-c C-f f HTML → Insert Form Elements → Form |
tempo-template-html-form |
Insert |
C-c C-f t `HTML → Insert Form Elements → Text Field |
tempo-template-html-text-field |
Insert |
C-c C-f h HTML → Insert Form Elements → Hidden Field |
tempo-template-html-hidden-field |
Insert |
C-c M-l s HTML → Insert Logical Styles → Strong |
tempo-template-html-strong |
Insert |
C-c M-l e HTML → Insert Logical Styles → Emphasized |
tempo-template-html-emphasized |
Insert |
C-c M-l b HTML → Insert Logical Styles → Blockquote |
tempo-template-html-blockquote |
Insert |
C-c M-l p HTML → Insert Logical Styles → Preformatted |
tempo-template-html-preformatted |
Insert |
C-c C-p s HTML → Insert Physical Styles → Strikethru |
tempo-template-html-strikethru |
Insert |
C-c C-p f HTML → Insert Physical Styles → Fixed |
tempo-template-html-fixed |
Insert |
C-c C-p u HTML → Insert Physical Styles → Underline |
tempo-template-html-underline |
Insert |
C-c C-p i HTML → Insert Physical Styles → Italic |
tempo-template-html-italic |
Insert |
C-c C-p b HTML → Insert Physical Styles → Bold |
tempo-template-html-bold |
Insert |
C-c C-p c HTML → Insert Physical Styles → Center |
tempo-template-html-center |
Insert |
C-c C-p l HTML → Insert Physical Styles → Spanning Class |
tempo-template-html-spanning-class |
Insert |
C-c C-p 5 HTML → Insert Physical Styles → Spanning Style |
tempo-template-html-spanning-style |
Insert |
C-c C-s a HTML → Insert Logical Styles → Address |
tempo-template-html-address |
Insert |
C-c M-l d HTML → Insert Logical Styles → Definition |
tempo-template-html-definition |
Insert |
C-c M-l v HTML → Insert Logical Styles → Variable |
tempo-template-html-variable |
Insert |
C-c M-l k HTML → Insert Logical Styles → Keyboard Input |
tempo-template-html-keyboard |
Insert |
C-c M-l r HTML → Insert Logical Styles → Citation |
tempo-template-html-citation |
Insert |
C-c M-l x HTML → Insert Logical Styles → Sample |
tempo-template-html-sample |
Insert |
C-c M-l c HTML → Insert Logical Styles → Code |
tempo-template-html-code |
Insert |
C-c C-h b HTML → Insert Structural Elements → Base |
tempo-template-html-base |
Insert |
C-c C-h l HTML → Insert Structural Elements → Link |
tempo-template-html-link |
Insert |
C-c C-h m HTML → Insert Structural Elements → Meta Name |
tempo-template-html-meta-name |
Insert |
C-c C-h n HTML → Insert Structural Elements → Nextid |
tempo-template-html-nextid |
Insert |
C-c C-h i HTML → Insert Structural Elements → Isindex |
tempo-template-html-isindex |
Insert |
C-c C-h B HTML → Insert Structural Elements → Body |
tempo-template-html-body |
Insert |
C-c C-h H HTML → Insert Structural Elements → Head |
tempo-template-html-head |
Insert |
C-c C-t t HTML → Insert Tables → Table |
tempo-template-html-table |
Insert |
C-c C-t p HTML → Insert Tables → html table caption |
tempo-template-html-html-table-caption |
Insert |
C-c C-t d HTML → Insert Tables → Table Data |
tempo-template-html-table-data |
Insert |
C-c C-t h HTML → Insert Tables → Table Header |
tempo-template-html-table-header |
Insert |
C-c C-t r HTML → Insert Tables → Table Row |
tempo-template-html-table-row |
Insert |
[1] SGML stands for standardized general markup language. Both XML and HTML are descendants of SGML.
[2] At this writing, there is no way to enter XHTML mode explicitly. If your file looks like an XHTML file, Emacs puts you in that mode automatically.
[3] Pay no attention to the fact that this is called SGML versus HTML name entity mode. Since HTML mode is derived from SGML mode, many commands that work with HTML have sgml in their names. Also, note that the command is called sgml-name-8bit-mode, a clear discrepancy with the minibuffer message.
[4] For some reason, perhaps the way SGML name entity mode is programmed, you can insert these entities only using key bindings. The mode fails to trap the equivalent commands and translate them into entities. For this reason, we focus on key bindings.
[6] The version we downloaded in August 2004 marked this file as alpha code, so don't be surprised if you find bugs. Visit the file to see if its status has changed.
[7] For this to work, you must invoke the command through the keyboard, either using its key binding or its command name. Using a menu option doesn't work.
[8] If M-Tab is trapped by the operating system to switch between applications (it is on Red Hat Linux), type Esc Tab instead.