×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

查您的Emacs 的help

本文发表在 rolia.net 枫下论坛Inserting Special Characters in Emacs

There are some characters that you cannot normally type into an Emacs buffer. For example, in a text file, you can specify a page break by inserting the formfeed character, ASCII C-l or octal code 014; when you print a file with formfeeds, the current page is ejected at this character and printing is resumed on a new page.

However, C-l has meaning as an Emacs command. To insert a character like this, use the quoted-insert function, C-q. It takes either a literal keystroke to insert, or the octal code of the character to insert. It inserts that character at point.

To insert a formfeed character at point by specifying its actual keystroke (C-l), type:
C-q C-l

To insert a formfeed character at point by specifying its octal character code, type:
C-q 014 [RET]

The preceding examples both do the same thing: they insert a formfeed character at point.

An interesting use of C-q is to underline text. To do this, insert a literal C-h character followed by an underscore (`_') after each character you want to underline.

To underline the character before point, type:
C-q C-h _

You can then use ul to output the text to the screen (see Underlining Text).

Another kind of special character insert you might want to make is for accented characters and other characters used in various languages.

To insert an accented character, use ISO Accents mode. When this mode is active, you can type a special accent character followed by the character to be accented, and the proper accented character will be inserted at point.

The following table shows the special accent characters and the key combinations to use. PREFIX... PLUS THIS LETTER YIELDS THIS RESULT
" a ä
" e ë
" i ï
" o ö
" u ü
" s ß
' a á
' e é
' i í
' o ó
' u ú
` a à
` e è
` i ì
` o ò
` u ù
~ a ã
~ c ç
~ d &dtilde;
~ n ñ
~ t &ttilde;
~ u ũ
~ < <<
~ > >>
~ ! &iexc;
~ ? &iques;
^ a &acirc;
^ e ê
^ i &icirc;
^ o &ocirc;
^ u &ucirc;
/ a &aring;
/ e &aelig;
/ o &oslash;
When a buffer contains accented characters, it can no longer be saved as plain ASCII text, but must instead be saved as text in the ISO-8859-1 character set (see Viewing a Character Chart). When you save a buffer, Emacs will notify you that it must do this.

To type the line `Emacs ist spa@ss'! in the current buffer, type:
M-x iso-accents-mode [RET]
Emacs ist spa"ss!

In the event that you want to type the literal key combinations that make up an accented character in a buffer where you have ISO Accents mode on, type the prefix character twice.
To type the text `'o' (and not the accent character ó) in a buffer while ISO Accents mode is on, type:
''o

NOTE: GNU Emacs has recently added a number of internationalization functions. A complete discussion of their use is out of the scope of this book; for more information on this topic, see `International Character Set Support' in The GNU Emacs Manual.更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 在linux底下,如何输入和让系统认识、打印一个特殊字符(我想打印 register 那个字符,就是一个R外面套个圈的),谢谢
    • Did you try latex
      • what's latex?
        • like word, but in unix style. It can be used to create PS or PDF file. check it at google.
      • I just want to know how to input it in VI or somewhere else. I prefer not using any other software? thanks
        • #1425285
        • basic answer is not using vi, if you have to use vi, try ctrl-v following the speciel character
    • DOS下管用的:按住alt键,再按右边小键盘上的数字(对应的ascii吗)
      • Already tried. Not working.
        • I tell you how...
          as soon as you repost this question in "灌水区"
    • 查您的Emacs 的help
      本文发表在 rolia.net 枫下论坛Inserting Special Characters in Emacs

      There are some characters that you cannot normally type into an Emacs buffer. For example, in a text file, you can specify a page break by inserting the formfeed character, ASCII C-l or octal code 014; when you print a file with formfeeds, the current page is ejected at this character and printing is resumed on a new page.

      However, C-l has meaning as an Emacs command. To insert a character like this, use the quoted-insert function, C-q. It takes either a literal keystroke to insert, or the octal code of the character to insert. It inserts that character at point.

      To insert a formfeed character at point by specifying its actual keystroke (C-l), type:
      C-q C-l

      To insert a formfeed character at point by specifying its octal character code, type:
      C-q 014 [RET]

      The preceding examples both do the same thing: they insert a formfeed character at point.

      An interesting use of C-q is to underline text. To do this, insert a literal C-h character followed by an underscore (`_') after each character you want to underline.

      To underline the character before point, type:
      C-q C-h _

      You can then use ul to output the text to the screen (see Underlining Text).

      Another kind of special character insert you might want to make is for accented characters and other characters used in various languages.

      To insert an accented character, use ISO Accents mode. When this mode is active, you can type a special accent character followed by the character to be accented, and the proper accented character will be inserted at point.

      The following table shows the special accent characters and the key combinations to use. PREFIX... PLUS THIS LETTER YIELDS THIS RESULT
      " a &auml;
      " e &euml;
      " i &iuml;
      " o &ouml;
      " u ü
      " s &szlig;
      ' a á
      ' e é
      ' i í
      ' o ó
      ' u ú
      ` a à
      ` e è
      ` i ì
      ` o ò
      ` u ù
      ~ a &atilde;
      ~ c &ccedil;
      ~ d &dtilde;
      ~ n &ntilde;
      ~ t &ttilde;
      ~ u &utilde;
      ~ < <<
      ~ > >>
      ~ ! &iexc;
      ~ ? &iques;
      ^ a &acirc;
      ^ e ê
      ^ i &icirc;
      ^ o &ocirc;
      ^ u &ucirc;
      / a &aring;
      / e &aelig;
      / o &oslash;
      When a buffer contains accented characters, it can no longer be saved as plain ASCII text, but must instead be saved as text in the ISO-8859-1 character set (see Viewing a Character Chart). When you save a buffer, Emacs will notify you that it must do this.

      To type the line `Emacs ist spa@ss'! in the current buffer, type:
      M-x iso-accents-mode [RET]
      Emacs ist spa"ss!

      In the event that you want to type the literal key combinations that make up an accented character in a buffer where you have ISO Accents mode on, type the prefix character twice.
      To type the text `'o' (and not the accent character ó) in a buffer while ISO Accents mode is on, type:
      ''o

      NOTE: GNU Emacs has recently added a number of internationalization functions. A complete discussion of their use is out of the scope of this book; for more information on this topic, see `International Character Set Support' in The GNU Emacs Manual.更多精彩文章及讨论,请光临枫下论坛 rolia.net