Êíèãà: Learning GNU Emacs, 3rd Edition
8.3.1.1.2 Using the C-x 8 prefix
8.3.1.1.2 Using the C-x 8 prefix
You can also insert a wide range of entities using C-x 8 after you do some setup.[45] 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[46]
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 | Ç |
? |
Table 8-3. Bindings for inserting entities for punctuation and symbols
C-x 8 prefix keystrokes | Character entity | Character displayed in browser |
---|---|---|
C-x 8 1 / 2 | ½ |
? |
C-x 8 1 / 4 | ¼ |
? |
C-x 8 3 / 4 | ¾ |
? |
C-x 8 SPC | |
nonbreaking space |
C-x 8 ! | ¡ |
? |
C-x 8 $ | ¤ |
¤ |
C-x 8 + | ± |
± |
C-x 8 - | ­ |
soft hyphen |
C-x 8 . | · |
· |
C-x 8 < | « |
« |
C-x 8 = | ¯ |
? |
C-x 8 > | » |
» |
C-x 8 ? | ¿ |
? |
C-x 8 | | ¦ |
¦ |
C-x 8 c | ¢ |
? |
C-x 8 C | © |
© |
C-x 8 L | £ |
? |
C-x 8 P | ¶ |
¶ |
C-x 8 R | ® |
® |
C-x 8 S | § |
§ |
C-x 8 u | µ |
µ |
C-x 8 x | × |
? |
C-x 8 Y | ¥ |
? |
C-x 8 ^ 1 | ¹ |
? |
C-x 8 ^ 2 | ² |
? |
C-x 8 ^ 3 | ³ |
? |
C-x 8 _ a | ª |
? |
C-x 8 _ o | º |
? |
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 orC-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 <h1> . |
C-c 2 | html-headline-2 | Insert an <h2> . |
C-c 3 | html-headline-3 | Insert an <h3> . |
C-c 4 | html-headline-4 | Insert an <h4> . |
C-c 5 | html-headline-5 | Insert an <h5> . |
C-c 6 | html-headline-6 | Insert an <h6> (useful for footnote text) . |
C-c Enter | html-paragraph | Insert <p> tag. |
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 <img src=""> and position cursor for you to enter filename of image. |
C-c C-j HTML ? Line Break | html-line | Insert a line break (<br> ). |
C-c C-c - HTML ? Horizontal Rule | html-horizontal-rule | Insert a horizontal rule (<hr> ). |
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. |
- Constants
- 8.3.1.1 Character encoding in HTML mode
- 7.2.5 Using Fill Prefixes
- 8.3.1.1.1 Using ISO accents mode
- 9.8.3 Emacs Lisp Mode Differences
- 12.5 VC Command Summary
- 14.5 Completion
- 4.4.4 The Dispatcher
- About the author
- Chapter 7. The state machine
- Appendix E. Other resources and links
- Caveats using NAT