You are on page 1of 70

1.

GNU
{ GNU Emacs
{ GNU EMACS
Emacs
{ Emacs
{ Emacs
{ Ctrl-h
{ Emacs info
Emacs
{ Emacs Shell
{
{
{ ,
{ Emacs
{ Emacs
{ Emacs
Emacs
{ Emacs
{ Emacs
{ EMACS
{ Emacs
Emacs
{
{ Emacs
{ Yanking
{
{
{ Undo
Emacs
{
{
{ Regular Expression
Emacs
{ Registers and Bookmarks
{
{

{ Emacs
{ EMACS Mule

2.

3.

4.

5.

6.

7.

8.
9.

Introduction
EMACS EMACS EMACS
EMACS editor
EMACS EMACS EMACS on-line
help EMACS EMACS
EMACS editor
EMACS EMACS
GNU
GNU Richard Stallman 1975 MIT Free Software Foundation (FSF
GNU ``Gnu's Not Unix''
UNIX GNU free UNIX
GNU UNIX UNIX
UNIX GNU GNU UNIX
UNIX GNU UNIX

Stallman FSF free free


FSF free

Stallman free

Stallman GNU
GNU ``free'' GNU
GNU public archives
anonymous FTPUUNET GNU GNU

GNU
GNU GNU
GNU GNU
GNU
Stallman GNU free free
GNU EMACS text editor
debuggeryacc-compatible parser generator linker
utilities shell kernel compiler
GNU
GNU UNIX UNIX
GNU UNIX
C LISP

GNU Emacs
GNU EMACS GNU EMACS Editor MACros
Richard Stallman 1975 MIT EMACS editor GNU EMACS
19.28 GNU EMACS 19.28 GNU EMACS
GNU free ``anonymous ftp'' prep.ai.mit.edu
site GNU EMACS GNU EMACS public domain

GNU EMACS
EMACS platfrom UNIX GNU
EMACSUnipress EMACS CCA EMACS GNU EMACS
GNU EMACS EMACS FreEMACSMicroEMACS
Epsilon VMS
GNU EMACS C LISP
function GNU EMACS
EMACS complie
EMACS EMACS
EMACS
FSF
EMACS FSF FSF
GNU EMACS

GNU EMACS
GNU EMACS editor
EMACS

EMACS
EMACS
EMACS
EMACS ``bourne-shell-like''
shell EMACS shell EMACS shell
EMACS e-mail EMACS ftp host
login host EMACS telnet relogin EMACS
news EMACS calendar
EMACS ``Diary''
``Diary'' ;EMACS EMACS
EMACS EMACS
debugger EMACS
EMACS
EMACS EMACS
EMACS EMACS
logout EMACS

z
z
z
z
z
z
z

display editor
real-time editor
advanced editor
Self-documenting
Customizable
Extensible
support X window enviornment

EMACS display

EMACS real-time

EMACS

z
z
z
z

filling of text

characterswordslines sentences
paragraphspages expression comments

EMACS Self-documenting `` Ctrl-h''


`` Ctrl-h'' EMACS
EMACS Customizable EMACS
GNU EMACS Customization EMACS
Extensible GNU EMACS LISP
dependency EMACS
EMACS EMACS X
menusmouse bottons EMACS text-only
X
shell shell
text-only EMACS EMACS

Emacs
EMACS EMACS EMACS
EMACS on-line help
EMACS
Emacs
EMACS EMACS EMACS
``emacs'' EMACS``Ctrl-x Ctrl-c''
EMACS ``Ctrl-x Ctrl-c'' Ctrl
``x'' ``Ctrl-c'' Ctrl
``c'' EMACS
EMACS
EMACS ``Ctrl-g'' ``Ctrlg''
EMACS
z
z

Ctrl
Meta

EMACS Meta
Meta ESC EMACS
Hotkey Hotkey Ctrl
``Ctrl-x Ctrl-c'' Hotkey
EMACS ``save-buffers-kill-emacs'' Meta
Ctrl-x Ctrl-c
``ESC-x save-buffers-kill-emacs''
Meta EMACS completion completion
EMACS completion
EMACS completion EMACS
EMACS
completion
z
z
z
z

EMACS

EMACS
completion
completion EMACS
EMACS

completion

z
z
z

TAB
SPACE puncutation
? completions

completion TAB
SPACE ? ``M-x au TAB''
`` TAB
Possible completions are:
auto-fill-mode
auto-raise-mode

auto-lower-mode
auto-save-mode

``M-x au SPACE'' ``M-x auto-''


SPACE
Possible completions are:
auto-fill-mode
auto-raise-mode

auto-lower-mode
auto-save-mode

TAB SPACE
``M-x auto-f TAB''
``M-x auto-fill-mode'' ``M-x auto-f SPACE''
``M-x auto-fill-'' ``M-x auto-fill-mode''
SPACE ``SPACE'' ``puncutation''
TAB
``puncutation''
? EMACS
``M-x au ?''

Possible completions are:


auto-fill-mode
auto-raise-mode

auto-lower-mode
auto-save-mode

``M-x au ?'' completion


? TAB SPACE

``Ctrl-v'' ``Meta-v''

Emacs
EMACS EMACS tutorial EMACS
``Ctrl-h t'' (help-with-tutorial) EMACS

EMACS

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

EMACS Ctrl Meta


viewing screenfuls
basic cursor control
Ctrl-g
EMACS window multiple windows
inserting and deleting
undo
EMACS
EMACS buffers
extending the command set
EMACS mode line echo area
searching
recursive editing levels
getting more help
leaving EMACS
EMACS

EMACS EMACS
EMACS EMACS
EMACS
EMACS
EMACS

Ctrl-h
EMACS
EMACS ``Ctrl-h''

z
z

Ctrl-h
Ctrl-h Ctrl-h

Ctrl-h (help-command) C-hType ? for further


options- ``Ctrl-h'' prefix key
``?''
``Ctrl-h''Ctrl-h (felp-for-help) type one of the
options listed or Space to scroll EMACS
Space
a b c f C-f i k C-k l m n p s t v w C-c C-d C-n C-p C-w.
``Ctrl-h'' ``a''
``Ctrl-h a''
EMACS EMACS
z
z
z
z
z
z

Ctrl-h c
Ctrl-h k
Ctrl-h w
Ctrl-h a
Ctrl-h v
Ctrl-h i

``Ctrl-h c'' ``Ctrl-h k'' Hotkey

`` Ctrl-h c'' Hotkey ``Ctrl-h k''


Hotkey
Hotkey Hotkey
``Ctrl-x Ctrl-c''
``Ctrl-h c RET'' (RET Enter
Enter)
Describe key briefly: - ``:'' ``Ctrl-x Ctrl-c''
Describe key briefly: - C-x C-c runs the command save-buffers-kill-emacs''
``Ctrl-h k RET'' Describe key: - ``:'' ``Ctrl-x Ctrl-c''
EMACS save-buffers-kill-emacs: Offer to save each buffer,
then kill this emacs process. With prefix arg, silently save all file-visiting buffers, then kill.
Hotkey `` Ctrl-h w''w
(where-is) `` Ctrl-h c'' `` Ctrl-h k'' `` Ctrl-h w'' EMACS
Hotkey ``Ctrl-h w''
where is command:
``:'' ``save-buffers-kill-emacs''
save-buffers-kill-emacs is on C-x C-c Hotkey
``Ctrl-h w'' EMACS completion
``save-buffers-kill-emacs'' s
EMACS completion s s
``Ctrl-h w'' EMACS

`` Ctrl-h a'' ``Ctrl-h a'' command-apropos (regexp):


`` regular expression'' 6.3 regular
expression RET EMACS regular
expression `` Ctrl-h w''
1. `` Ctrl-h a'' , `` Ctrl-h w''
`` Ctrl-h a''
2.
3. `` Ctrl-h a'' completion `` Ctrl-h w'' completion
4.
`` Ctrl-h a''

EMACS
`` Ctrl-h i'' `` Ctrl-h i'' ``Info program''
EMACS Info
GNU
info info mode ``Ctrl-h i''
EMACS info




z Ctrl-x 1 delete-other-windows

z
z

z
z
z
z

( Hotkey

Ctrl-x o other-window

Ctrl-v scroll-up

Meta-v scroll-down)

Emacs info
info EMACS
info info
info EMACS
info EMACS root
info info program info program
z Ctrl-h i
z ESC-x info
info Hypertext ``Ctrl-h
i'' ``ESC-x info'' info tree info
-*- Text -*- This is the file .../info/dir, which contains the topmost node
of the Info hierarchy. The first time you invoke Info you start off looking at that node, which is
(dir)Top. ? File: dir Node: Top This is the top of the INFO tree This (the Directory node) gives
a menu of major topics. Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
gives a primer for first-timers, "mTexinfo" visits Texinfo topic, etc. --- PLEASE ADD
DOCUMENTATION TO THIS TREE. (See INFO topic first.) --- * Menu: The list of major
topics begins on the next line. * Info: (info). Documentation browsing system. * Emacs:
(emacs). The extensible self-documenting text editor. * VIP: (vip). A VI-emulation for Emacs.
* Texinfo: (texi.info). With one source file, make either a printed manual (through TeX) or an
Info file (through texinfo). Full documentation in this menu item. * Termcap: (termcap). The
termcap library, which enables application programs to handle all types of character-display
terminals. * Regex: (regex). The GNU regular expression library. * Cpp: (cpp.info). C preprocessor. * Gcc: (gcc.info). GNU C Compiler --- an ANSI C Compiler developed by FSF. *
Gzip: (gzip.info). GNU zip program --- an compress package developed by FSF. * Ispell:
(ispell.info). A spelling checker. * Libg++: (libg++.info). G++ libraries. * Gmake:
(make.info). A make utility developed by FSF. * Bison: (bison.info). GNU Yacc. * Gawk:
(gawk.info). GNU awk --- pattern scanning and processing language. * Gdb: (gdb.info). GNU
debugger. * Info-stnd: (info-stnd.info). Stand along GNU info. * Makeinfo: (makeinfo.info).
Program for producing *.info file from *.texi file. * Graphics: (graphics.info). A set programs
for producing plot files and display them on Tektronix 4010, PostScript, and X window
system compatible output devices. * m4: (m4.info). m4 is macro processor, in the sense that it
copies its input to the output, expending macros as it goes. GNU m4 is mostly compatible with
system V, Release 3 version. * Hyperbole: (hypb.info). GNU Emacs-based everyday
information management system. Use {C-h h d d} for a demo. Include Smart Key contextsensitive mouse or keyboard key support, a powerful rolodex, and extensible hypertext
facilities including hyper-links in mail and news messages. * Standards Coding Style:
(standards.info). GNU Coding Style. header
node
1. File
2. node

3. Next
4. Prev
5. up
info
info
z
z

z
z

z
z
z
z
z
z

h
info info info
info info ``h''

info .
d
``Ctrl-h i'' info ``d''

?
info ``?''
q
info ``q'' info
m Texinfo< Return >
info Menu Item
1. ``m''
2. completion

3. RET
Menu Item

Menu Item
Menu ``RET'' info Menu
info
z n
z
z p
z
z u
z
z m
z
Menu
Menu
{ ``mTexinfo''
{ menu info

1. m m menu
2. Texinfo m minibuffer
3. menu item: Texinfo
``*''
info Texinfo Info Emacs
VIP Forms GNUS CL Gcc Cpp Makeinfo Info-stnd
Texi Hyperbole Octave

{
{

4. RET
5. RET

``RET''
``* Menu:''
``*'' Menu Item
``RET''

Menu Menu
Menu Menu
Menu Menu Menu
`` Menu:'' * Menu: The list of major topics begins on the
next line. `` *''
item Menu Item * Info: (info). Documentation browsing
system.
1.
2.
3.
4.

5.
6.

7.
8.
z
z

z
z
z
z
z
z

*
Menu Item ``*''
Subtopic:
``*'' Subtopic ``:'' info
Subtopic Subtopic ``Info''
``m'' Menu Item Texinfo
Subtopic
node name
Subtopic :
Subtopic
Subtopic ``:'' ``* Info::''
node description

l
last l

b
b
SPC
SPC
Ctrl-g
Ctrl-g

Emacs
EMACS
EMACS EMACS
EMACS
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.

EMACS Shell
EMACS Directory EditorDired
EMACS
EMACS host
EMACS
EMACS CalendarDiary
EMACS Man Page
EMACS MailRmail
EMACS GNUS
EMACS version control
EMACS Outline
EMACS
EMACS
EMACS game

EMACS
EMACS EMACS

EMACS
mode EMACS major mode
minor mode

EMACS EMACS

Emacs Shell
EMACS shell shell command mode

shell mode shell shell mode


shell shell
command mode shell command mode
EMACS ``*Shell command
output*'' shell .shell mode
subshell
shell command mode shell command mode
shell
shell shell command mode
shell
EMACS shell
GNU EMACS ``GNU Emacs
Manual''
1. shell command mode
2.
{ ESC-!shell-command
{ shell command mode
{ ESC- shell-command-on-region
{ shell command mode shell
{ ((region)
)
{ Ctrl-u ESC-! Ctrl-u ESC- ESC Ctrl-u shell

3. shell mode
4. ESC-x shell\indexESC-x shell shell mode

Dired Dired mode EMACS


EMACS
EMACS Dired
1. Dired
2. Dired
3. (a) Dired delete EMACS
~ #
(b)
(c)
(d) mode
(e) giduid
(f)
(g)

(h) EMACS LISP file


(i) hard links symbolic links
(j)
4.
5.
6.
7.

Dired shell
UNIX diff

find

Dired, PC PCTOOLS

Dired
``ESC-x dired'' minibuffer

Dired (directory):
``:'' RET
Dired
read-only mode line %%
Ctrl-x Ctrl-q

Dired
z
z

Dired
Dired flag

{ d
{ d D

{ u
{ u D
{ x
{ d
x
``yes'' ``no''

Dired

-#
#auto-save file

{ ~
{ ~backup file
{ %d regexp RET
{ regular expression
{ x
Dired
{

z
z

fdired-find-file
f
Dired
Ctrl-x Ctrl-f
{ odired-find-file-other-window
{ f o
Dired

{ Ctrl-odired-display-file
{ o Ctrl-o
Dired

{ vdired-view-file
{

Dired
{ mdired-mark
{ ``*''

{ *dired-mark-exectables
{ executable files ``*
unmark
{ @dired-mark-symlinks
{ symbolic files ``*
symbolic files (unmark
{ /dired-mark-directories
{ ``.'' ``..'' ``*
unmark
{ ESC-DEL markchardired-unmark-all-files
{ character markchar
``y''
``n'' !

{ c old newdired-change-marks
{ old new
{ %m regexp RETdired-mark-files-regexp
{ regular expression
Dired
{
{

z
z

1. n
n
n
2.
3.
4.

5.
6. Dired
minibuffer
7.
Dired

C new RET dired-do-copy


new
new
{ R new RET dired-do-rename
{ new
new
Dired
{ H new RET dired-do-hardlink
{ hard links new hard links
new
{ S new RET dired-do-symlink
{ symbolic links new symbolic links
new
{ M midespec RET dired-do-chmod
{ modepermission bits chmod

{ G newgroup RET dired-do-chgrp
{ group newgroup
{ O newowner RET dired-do-chown
{ owner owner
{ P command RET dired-do-print
{ minibuffer command
{ Z dired-do-compress
{

{ L dired-do-load
{ EMACS Lisp
{ B dired-do-byte-compile
{ byte compile EMACS Lisp
Dired ftp EMACS EMACS
ftp Dired Dired

{
{

EMACS
host EMACS host ftp
ftp host ftp
host login host
ftp ftp
Remote Editing ``anonymous ftp''
ftp remote editing `` Ctrl-x Ctrlf'' EMACS ftp host
Find file:/host:filename host host filename host
Find file:/user1@gate.sinica.edu.tw :.login host
``gate.sinica.edu.tw'' ``user1'' ``.login''

EMACS
EMACS EMACS
EMACS
EMACS
EMACS
.c C EMACS C
EMACS LISPSCHEMECC++
FORTRANMAKEFILEAWK PERLICON MUDDLE
EMACS EMACS UNIX shell
EMACS ``ESC-x compile'' EMACS
make ESC-x compile
compile command: make -k ``compile command :''
UNIX shell
Debugger EMACS
EMACS debugger gdbdbxxdb sdb
debugger debugger
z

ESC-x gdb RET file RET

z
z

ESC-x dbx RET file RET

z
z

ESC-x xdb RET file RET

z
z

ESC-x sdb RET file RET

Emacs
EMACS EMACS

1. ESC-x print-buffer
2. EMACS shell pr
shell lpr
3. ESC-x lpr-buffer
4. pr lpr
5. ESC-x print-region
6. ESC-x print-buffer
7. ESC-x lpr-region
8. ESC-x lpr-buffer

Emacs
EMACS EMACS

EMACS
mail rmail
EMACS
EMACS

RMAIL EMACS RMAIL EMACS

1. EMACS
RMAIL
2. RMAIL

3.
EMACS RMAIL
RMAIL RMAIL


EMACS

z ESC-x mail
z ESC -x rmail (
Emacs
EMACS

z
z

z
z

z
z

z
z

The Calendar and the Diary


EMACS CalendAr Diary
Calendar ESC-x calendar Diary
calendar
Reading Man Page from EMACS
manual page ESC-x manual-entry RET
unix-command-name RET
Reading News with GNUS
GNU EMACS
GNUS. EMACS GNUS ``.newsrc''
(subscribe newsgroups
GNUS newsgroups
newsgroup newsgroup GNUS
newsgroups EMACS GNUS
ESC-x gnus RET
version control
source filesEMACS
version control (source file
multipe versions
version control
EMACS VC
RCS SCCS version control RCS
EMACS RCS RCS SCCS EMACS
RCS SCCS version control EMACS VC
version control version control
SCCS RCS
EMACS shell mode EMACS version control
EMACS VC

{
{
{
{
{
{

version control
version control
version control

version control
version header version control

version control EMACS shell


RCS SCCS help version control
EMACS VC
z
z

Outline Mode
editor EMACS EMACS
outline mode

EMACS
EMACS

Emacs
EMACS EMACS
EMACS EMACS EMACS
EMACS text-only X window System textonly EMACS

Emacs
EMACS shell
``emacs'' EMACS
$ emacs RET
EMACS initialize

1. EMACS
2. EMACS EMACS
EMACS EMACS
3. EMACS )

4.
5. EMACS
EMACS emacs EMACS

``emacs''

Emacs
EMACS EMACS EMACS
EMACSsuspending EMACS EMACS
killing EMACS) EMACS
Hotkey Hotkey
EMACS Meta-x ESC-x
Ctrl-z suspend-emacs
EMACS shell
EMACS ''%emacs'' EMACS
z Ctrl-x Ctrl-csave-buffers-kill-emacs
z EMACS EMACS EMACS shell
emacs EMACS
EMACS parent process shell
EMACS kill ring
undo history ( kill ring undo
history Ctrl-z (suspend-emacs)
EMACS shell ``%emacs'' EMACS
shell EMACS
EMACS
z
z

EMACS ``Ctrl-x Ctrl-c''(save-buffers-kill-emacs)


``ESC-x save-buffers-kill-emacs'' EMACS
1. EMACS
2.
3. EMACS
subprocess EMACS
subprocess
EMACS EMACS
EMACS subprocess
EMACS echo area
echo area
echo area
y, n, !, ., q, C-r or C-h

1. y
2. echo area

3. n
4. echo area

5. !
6. echo area

7. .
8. echo area

9. q
10.
11. C-r
12.

13. C-h

EMACS
text-only EMACS EMACS
frame text-only X Window

text-only frame window EMACS



EMACS
minibuffer echo area

minibuffer echo area mode line
EMACS frame


mode line mode lineminibuffer echo

area
mode line mode
line : --ch-Emacs: buf major minor --pos-------------
z rl-h
z
{

--

{
{

**

{
{

%% read-only

{
{

%* read-only

{
z
z
z
z

z
z

buf

major minor
mode
(major mode minor mode EMACS

pos

{ All
{ All
{ Top
{ Top
{ Bot
{

nn%
{

mode line echo area minibuffer frame


mode line echo area minibuffer
Echoing
EMACS Echoing `` Ctrle'' echo area

echo area

minibuffer echo area


argument minibuffer echo area
minibuffer echo area ``'' echo
area ``'' ``''
minibuffer
``Ctrl-x Ctrl-f'' echo area Find
file: ``Find file'' echo area ``''
``'' minibuffer minibuffer

minibuffer minibuffer minibuffer


minibuffer
`` Ctrl-x o other-window)
minibuffer minibuffer
`` Ctrl-gkeyboard-quit) minibuffer ``Ctrl-g''
{


minibuffer `` Ctrl-x o''
minibuffer
minibuffer
minibuffer

Emacs
EMACS
buffer EMACS


EMACS EMACS

EMACSkill EMACS EMACS


`` auto save''
EMACS
EMACS
EMACS
`` Ctrl-x Ctrl-s''

EMACS

EMACS

EMACS
``#'' ``emacs.doc''
#emacs.doc# EMACS
EMACS
``emacs.doc'' EMACS EMACS
``#emacs.doc#'' EMACS ``emacs.doc''
EMACS
#emacs.doc# ``emacs.doc''


`` Meta-x recovery-file''

1. ``Ctrl-x Ctrl-f RET''
2. Find file: ~/ filename
3. Find file: echo area
4. Auto save file is newer: consider M-x recovery-file
5. ``Meta-x recovery-file RET''
6. echo area
RET ``Ctrl-g''

EMACS


EMACS ``~''

``emacs.doc'' ``emacs.doc~''

z auto-save-visited-file-name
z
z delete-auto-save-file
z
z auto-save-interval
z
z auto-save-timeout
z
EMACS `` Meta-x setvariable ESC-x set-variable''

EMACS EMACS
``non-nil'' ``t'' ``nil''

EMACS `` Ctrl-h
v''(describe-variable) ``auto-save-visitedfile-name''
`` auto-save-interval''
1. `` Ctrl-h v'' auto-save-visited-file-name
2. `` Meta-x set-variable''
3. `` Ctrl-h v'' auto-save-visited-file-name
auto-save-visited-file-name
1. ``Ctrl-h v RET''
2.
1. echo area Describe variable
2. Describe variable: auto-save-visited-file-name
3.
4. auto-save-visited-file-name's value is nil Documentation: *Non-nil
says auto-save a buffer in the file it is visiting, when
practical. Normally auto-save files are written under other names.
3.
4.
1.
2.
3.
4.
5.
6.
7.

``Meta-x set-variable''
echo area Set varaible:
Set variable: auto-save-visited-file-name RET
echo area Set auto-save-visisted-file-name to value
``'' minibuffer
nil t

8.
5. ``Ctrl-h v''


auto-save-interval
1.
2.
1.
2.
3.
4.

``Ctrl-h v RET''
echo area Describe variable
Describe variable: auto-save-interval

auto-save-interval's value is 300 Documentation:


*Number of keyboard input characters between auto-saves.
Zero means disable autosaving due to number of characters typed.

3.
4.
1.
2.
3.
4.

``Meta-x set-variable''

echo area Set varaible :


Set variable: auto-save-interval RET
echo area Set auto-save-interval to value
``'' minibuffer
300
5. ``Ctrl-h v''
EMACS EMACS
EMACS
``.emacs'' (.emacs EMACS
EMACS EMACS
EMACS EMACS .emacs

.emacs ``auto-save-visited-file-name'' ``auto-saveinterval'' (setq auto-save-visited-file-name t) (setq autosave-interval 350) EMACS


EMACS
z Ctrl-x b buffer RET switch-to-buffer

completion echo area Switch to
buffer: (default filename)
minibuffer
z Ctrl-x k buffername RET kill-buffer minibuffer
RET
completion
z Ctrl-x Ctrl-b list-buffer EMACS
``Ctrl-x Ctrl-b''
MR Buffer
Size Mode File
-- --------------.* chap4.tex
17460
LaTeX
/home/usr/hsko/work/chap4.tex
*% RMAIL
8788
RMAIL
/home/usr/hsko/RMAIL
* *Buffer List* Buffer
241
Menu
lisp
*scratch*
0
Interaction
diary
928
Fundamental
/home/usr/hsko/diary

% *man ls*
*Help*

15420
64

Man
Fundamental

MR
``*''

``.*''
``.'' ``.*''

``%''
``%'' read-only
``%*''
read-only
Buffer

Buffer

Buffer ``*''

Size

{
{

Mode

{
{

File
Buffer ``*''

{
z
z

Meta-x buffer-menu
Dired\indexdired

`` Meta-x buffer-menu''
`` Ctrl-x list-buffer'' `` Meta-x buffer-menu''
echo area
Command: d, s, x, u; f, o, 1, 2, m, v; ~, %; q to quit; ? for help.
``?''

{ d
{ MR D

D `` x''
{ s
{ MR S

S
{ x
{ D S

{ u
{

{
{

EMACS textonly EMACS frame frame


EMACS
EMACS selected window
current buffer.point
EMACS EMACS point

point point
EMACS point location.
point
point
point
point EMACS
point mode line
EMACS

z Ctrl-x 2split-window-vertically)
z


{ Ctrl-x ^ enlarge-window
frame
frame
{ Ctrl-u n Ctrl-x ^ enlarge-window nn Ctrl-x ^
n
z Ctrl-x 3split-window-horizontally
z

{ Ctrl-x enlarge-window-horizontally
{ frame
frame

{ Ctrl-u n Ctrl-x enlarge-window-horizontally nn Ctrl-u


n
z Using Other Windows and Deleting Windows
z
{
{

{
{

{
{

Ctrl-x oother-window
`` o'' ``
o'' ``0''
Ctrl-x 0delete-window
`` 0''
`` 0''
Ctrl-x 1delete-other-window)





message

z Ctrl-lrecenter
z
z
z

Ctrl-vscroll-up
{
point
{ Ctrl-u n Ctrl-v n
{ n n point
point point

{ Meta-vscroll-down
{ point

{ Ctrl-u n Ctrl-v n
{ n n point
point point

{ Meta < beginning-of-buffer


{ (beginning-of-buffer) point

{ Meta >end-of-buffer
point
{ Ctrl-ESC-vscroll-other-window
{
`` Ctrl-ESC-v'' `` Ctrl-ESC-v''


A
B A `` Ctrl-ESC-v''
B `` Ctrl-ESC-v''

z
z

Ctrl-x <scroll-left)

{ Ctrl-x >scroll-right
{

z
z

{
{

{
{
{

Ctrl-p previous-line
Ctrl-p

Ctrl-u n Ctrl-p
n
Ctrl-n next-line Ctrl-n

{
{


Ctrl-u n Ctrl-n
n

Emacs
EMACS EMACS
editor

EMACS
EMACS "Ctrl-x Ctrl-f"
minibuffer completion
``Ctrl-x Ctrl-f'' mininbuffer EMACS

1.
2.
3.
EMACS
visiting file

``Ctrl-x Ctrl-f'' echo area


echo area

z
{

echo area
echo area ``/'' ,``/''
``/'' ``
absolute file name Find file:
~/work/emacs/emacs.tex ~/work/doc/text.tex
Find
file:~/work/emacs/emacs.tex//~/work/doc/text.tex
EMACS
.

5.2.5

EMACS
FTP EMACS FTP
EMACS
FTP /host:filename

host filename/ :
minibuffer / host
``:'' ``:''
Find
file:~/work/emacs.tex//hsko@gate.sinica.edu.tw:~/work/text.tex
{

``Ctrl-x Ctrl-f'' echo area

RET EMACS

``Ctrl-x Ctrl-f''
``Ctrl-x d''dired
echo area
RET
Dired
Dired 3.2

" Meta-x pwd" " Meta-x pwd"
EMACS echo area
EMACS EMACS
EMACS
EMACS mode line
EMACS
``/user/work/emacs.tex''
``emacs.tex''

EMACS `` Ctrl-x i''
``Ctrl-x i'' `` i'' insert

EMACS
z Ctrl-x Ctrl-ffind-file
z Ctrl-x iinsert-file
z Meta-x pwd



EMACS EMACS
z

EMACS

z
{
{

{
{

{
{

Ctrl-x Ctrl-ssave-buffer


echo area No
changes need to be saved
Ctrl-x Ctrl-wwrite-file

``Ctrlx Ctrl-w'' echo area
RET

Ctrl-x ssave-some-buffers
echo
area y, n, !, ., q,
C-r or C-h

1. y
2. echo area

z
z

3. n
4. echo area

5. !
6. echo area

7. .
8. echo area

9. q
10.
11. C-r
12.

13. C-h
14.
EMACS
Ctrl-x Ctrl-csave-buffers-kill-emacs
EMACS
``save-some-buufers'' EMACS

Emacs

EMACS





EMACS
EMACS
z
z

insertoverwrite

{ ASCII Character
{ Special Character 200
{
pointcursor move point
{

z
z

point character

{
{

point word

{
{
{

point

point line

{
{

point

{
{

point page

{
{

point

{
{

point

{
z
z

point

z
{

character

{
{

word

{
{

{
{

region

{
{

yank

move and copy


EMACS

z

Emacs
EMACS point
insert mode point
overwrite mode insert mode
overwrite mode
z
z
z

food point
point d
food point
point d

d insert mode
t footd
d overwrite mode
t foot

EMACS insert mode overwrite


mode `` Meta-x overwrite-mode RET''
insert mode `` Meta-x overwrite-mode RET''
overwrite mode mode line ``Ovwrt''
overwrite `` Meta-x overwritemode'' insert mode overwrite mode
insert mode overwrite mode
overwrite mode insert mode
EMACS overwrite mode
overwrite
`` Ctrl-x i'' EMACS insert mode

insert overwrite EMACS


200
`` Ctrl-q''
formfeed ASCII Ctrl-L octal code 014 ``Ctrl-q Ctrll'' C ^L
EMACS EMACS
z RET
RET

z RET
EMACS ``\''
``~
EMACS
RET RET
RET EMACS
EMACS

z RET EMACS
EMACS ``$'' ``$''
EMACS
``\''
``truncate-lines'' 4.4
4.4
truncate-line



RET EMACS
EMACS

``RET'' newline RET
EMACS Hotkey Ctrl-j (tex-terminate-paragraph)

point

EMACS point
point point
point
character
wordlinepage

character

z
{
{
{
{
{
{

Ctrl-fforward-char

Ctrl-u n Ctrl-f
(Ctrl-u n Meta-x forward-char) n
Ctrl-bbackward-char

Ctrl-u n Ctrl-b Ctrl-u n Meta-x backward-char


n
word
{
{

z
z

Meta-fforward-word
{
{ Ctrl-u n Meta-f Ctrl-u n Meta-x forward-word
{ n
{ Meta-b backward-word
{
{ Ctrl-u n Meta-b Ctrl-u n Meta-x backward-word
{ n

z
z

Ctrl-a beginning-of-line
{
{ Ctrl-e end-of-line
{
line
{

z
z

Ctrl-n next-line

Ctrl-n

{ Ctrl-u n Ctrl-n(Ctrl-u n Meta-x next-line) n


{ Ctrl-p previous-line)
{
`` Ctrl-p'' echo area
Beginning of buffer
{ Ctrl-u n Ctrl-p Ctrl-u n Meta-x previous-line
n

z
z

Ctrl-vscroll-up

point EMACS

{ Ctrl-u n Ctrl-v
{ n n point
point
point
{ Meta-vscroll-down
{
point
{ Ctrl-u n Ctrl-v
{ n n point
point point

{ Ctrl-x <scroll-left
{ Ctrl-x >scroll-right

z
z

Meta <beginning-of-buffer)
point
{ Meta >end-of-buffer
{ point
z
z `` Ctrl-q'' (quoted-insert)

{ Ctrl-x [ backward-page
{ point ^L ^L point
^L F ^L ^L
^L
{ Ctrl-x ] forward-page
{ point ^L ^L point
^L F ^L ^L
^L
{ Ctrl-x Ctrl-p mark-page
{
mark region5.4 Ctrl-x Ctrl-p
Ctrl-w numeric
arguments5.3
EMACS


z Meta-x goto-char RET
z RET echo area ``

``Goto char:'' 100
100
z Meta-x goto-line RET RET echo area
``
``Goto line:'' 100
10
{
{

point Ctrl-u n
EMACS numeric argument
EMACS
z
z
{
{
{

Ctrl-u n command
Meta- n command

n command
Meta ESC Meta

n
Ctrl-u 5 Ctrl-f Meta-5 Ctrl-f

5
n
Ctrl-u -5 Ctrl-f Meta-5 Ctrl-f
5

{
{
{
{

Ctrl-u Ctrl-u
Ctrl-u
Ctrl-u 16

{
{

Ctrl-u Ctrl-f
4
Ctrl-u Ctrl-u Ctrl-f
16

z
z

{
{
{

Ctrl-u n char
Meta- n char
n

Ctrl-u n
Ctrl-u
{
Ctrl-u 10 r Meta-10 r 10 r
Ctrl-u r Meta-4 r 4 r

z
z

Ctrl-u n Ctrl-u n Meta- n Ctrl-u n


{ Ctrl-u n n n
n Ctrl-u
Ctrl-u nn
{ Ctrl-u 5 Ctrl-u 4 Meta-5 Ctrl-u 4 5
4 Ctrl-u 5 4 54
EMACS

EMACS numeric arguments

numeric arguments
{

point
EMACS point point point

point
z
z

Meta-x what-page
point ^L
point point 200
Page 1, line 200

z
z

z
z

z
z

z
z

z
z

Ctrl-x l count-lines-page
`` Meta-x what-page'' point
Ctrl-x l
point
echo area
Page has 23 lines20 + 4 echo area
point
point point
point
.
point
Meta-x what-line
point point 200 echo area

Ctrl-x =


``a'' echo area
Char: a (0141) point=23905 of 38784 (62) column 19

Meta-=
region
5.3 Region has 200
lines, 2000 characters
Meta-x line-number-mode

EMACS line
`` Meta-x line-number-mode'' mode
line point
EMACS ``.emacs''
(setq line-number-mode t)
EMACS mode line
EMACS


5.4

EMACS killing
deletion EMACS killing
kill-ring kill-ring
kill-ring ,variable EMACS
kill-ring killring kill-ring EMACS killing-ring
killing-ring

EMACS killing-ring
kill-ring
kill-ring

EMACS deletion
kill-ring
deletion
Ctrl-x uundo) `` Ctrl-x u
Ctrl-x u Ctrl-x
u `` Ctrl-x u'' 5.5

kill-ring deletion EMACS


kill-ring
Ctrl-d DEL Meta-\ Meta-SPC Ctrl-x Ctrl-o


5.4

EMACS
deletion killing
z deletion
z
{

character

Ctrl-ddelete-char
point
DELdelete-backward-char
point Ctrl-d

spaces tabs

{
{

Meta-\delete-horizontal-space
space tab
space tab
EMACS Meta-\
space tab
space tab space
tab Meta-\ point space
tab abc def g f g
Meta-\ abc defg
Meta-SPCjust-one-space
point space tab space
tab `` Meta-SPC''
abc def g f g
`` Meta-SPC abc def g
killing

z
z

word
Meta-dkill-word
point
point point
point
point point
This is a test. test
t This is a . This

is a test. test e
This is a t.
numeric argument
Meta-DELbackward-kill-word
point
point point
point
point point
This is a test. test t
This is test. This
is a test. test e
This is a est. numeric argument

Ctrl-kkill-line
point
point

Ctrl-k Ctrl-k

Ctrl-x Ctrl-odelete-blank-lines

RET
RET
point
Ctrl-k

{
{

*Ctrl-w (Kill-region) EMACS


mark\
,
EMACS killing kill-ring kill-ring
killing

1. ``Ctrl-h v'' echo area


2. Describe variable: EMACS
``kill-ring''

EMACS

Yanking
kill ring yank yank yank
killing yank killing yank
killing kill-ring
`` Ctrl-y'' yank killing-ring
yank killing

kill-ring
yank yank kill-ring
yank
kill-ring `` Meta-y'' (yank-pop) ``
Meta-y'' `` Ctrl-y'' `` Meta-y''
`` Ctrl-y''
`` Meta-y'' kill-ring ``
Ctrl-y'' yank
`` Meta-y'' `` Ctrl-y'' `` Meta-y''
kill-ring

`` Ctrl-x Ctrl-p'' `` Ctrl-w''


EMACS mark point
region)
point point

point
point point point point


z Ctrl-@ set-mark-command
z Ctrl-SPC set-mark-command

1. mark
2. `` Ctrl-@'' `` Ctrl-SPC''
3.
point
Hotkey Hotkey EMACS
EMACS Hotkey Hotkey
`` Ctrl-@''
`` Ctrl-SPC''
`` Ctrl-2''
EMACS Hotkey
Hotkey
`` ESC-x set-mark-command''
EMACS command
EMACS point text-only
point `` Ctrl-x
Ctrl-x''

exchange-point-and-mark
point point `` Ctrl-x
Ctrl-x'' point


z Ctrl-wkill-region
z Ctrl-x r scopy-to-register
z Ctrl-x Ctrl-pmark-page
z Ctrl-x Ctrl-ldowncase-region
z Ctrl-x Ctrl-uupcase-region
z Meta-x fill-region
z Meta-x print-region


Copy
kill-ring
yank\indexyank yank ``Ctrl-x y''

`` Ctrl-x k'' kill-ring
point `` Ctrl-y'' yank

yank yank
yank kill-ring

`` Ctrl-k'' ``
Ctrl-k'' numeric
argument


`` Ctrl-w'' `` Ctrl-y''
yank `` Meta-w'' killring `` Ctrl-y'' yank

z , yank
kill-ring
z

1. `` Ctrl-k'' numeric argument


2. Ctrl-y kill ring yank
3.
yank
yank

1. Ctrl-@
2. point
3. Ctrl-w
4.
5. Ctrl-y kill ring yank

1.
2.
3.
4.
5.
6.

Ctrl-@ (mark)
point
Meta-w kill-ring
)
Ctrl-y kill-ring
yank


A point B
1111111111A22222222222 3333333333333333333333 4444444444444444444444
55555B5555555555555555 point Y 00000Y0000000000000000
0000000000000000000000 0000000000000000000000
Y 1111111111B5555555555555555
00000A22222222222 3333333333333333333333 4444444444444444444444
55555Y0000000000000000 0000000000000000000000 0000000000000000000000
Y
1111111111A22222222222 3333333333333333333333 4444444444444444444444
55555B5555555555555555 00000A22222222222 3333333333333333333333
4444444444444444444444 55555Y0000000000000000 0000000000000000000000
0000000000000000000000 EMACS
insert-mode overwrite-mode

mark point

point point
point
point point


EMACS
rectangle region
Rectangle) Region



EMACS rectangle
point

kill-ring



Ctrl-x r d

Ctrl-x r k) yank ( Ctrl-x r y (yank-rectangle)



yank

Ctrlx r o(open-rectangle) margin
Meta-x clear-rectangle

yank
z yank
1. Ctrl-@
2. point
3. Ctrl-x r kkill-rectangle
4. yank
5. point yank
6. Ctrl-x r yyank-rectangle
7.
z
z

1.
2.
3.
4.

Ctrl-@
point
Ctrl-x r ddelete-rectangle

undo

1.
2.
3.
4.

Ctrl-@
point
Ctrl-x r oopen-rectangle

overwrite mode

z
z

1. Ctrl-@
2. point
3. Meta-x clear-rectangle
4.

``.emacs''

1. Ctrl-@
2. point
3. Meta-x string-rectangle RET echo area
4. String rectangle: minibuffer

Ctrl-@ point

Undo
EMACS EMACS
undo undo

Ctrl-x uundo
Ctrl-\_ undo
Hotkey undo Hotkey
`` Ctrl-\_'' undo
`` Ctrl-x u'' `` Ctrl-\_''
EMACS undo undo
undo undo
undo
undo
undo undo undo
undo
undo undo echo area
no furter undo information undo
redo undo
1.
2.
3. undo redo
z
z

> This is a test.


z

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

DEL
This is a DEL DEL DEL DEL
``i''
This is a DEL DEL DEL DEL
Meta-d
This a DEL DEL DEL DEL Meta-d
Ctrl-x u
This is a ``Meta-d'' Ctrl-x u
DEL DEL DEL
DEL Meta-d Ctrl-x u
Ctrl-f
This is a DEL DEL DEL DEL Meta-d Ctrl-x u
Ctrl-f
Ctrl-x u undo
This a Ctrl-x u Ctrl-x u
Ctrl-f undo Meta-d
DEL DEL DEL DEL Meta-d Ctrl-x u Ctrl-f Ctrl-x u

undo
undo
undo undo
undo undo
undo

Emacs
EMACS EMACS EMACS
search string

EMACS
EMACS EMACS
Incremental Search EMACS Incremental Search}
Nonincremental Search EMACS minibuffer
minibuffer lower case
EMACS
minibuffer minibuffer abc EMACS
abc AbcaBc abCABcaBCABC minibuffer

ABC abcAbcaBc abC ABcABC
minibuffer upper case minibuffer
ABC abc AbcaBc abCABcaBCABC
ABC minibuffer EMACS
minibuffer case
sensitive EMACS case sensitive

minibuffer
abc AbcaBc abCABcaBCABC minibuffer abc search
stringabc AbcaBc abCABcaBCABC
minibuffer
minibuffer abc AbcaBc abCABcaBCABC
{ minibuffer Abc search stringAbc
{ minibuffer aBc search stringaBc
{ minibuffer ABc search stringABc
{ minibuffer ABC search stringABC

minibuffer
minibuffer abc abc
EMACS ``case-fold-search'' ``nil''
EMACS t
case sensitive case sensitive
minibuffer} abc abc
EMACS
incremental searchnoincremental search
minibuffer
incremental search
incremental search minibuffer

minibuffer


echo area ``Failing I-search:''
EMACS incremental search
forward search)
backward search

z
z
z
z

Ctrl-s isearch-forward

Ctrl-r isearch-backward

Ctrl-s Ctrl-r EMACS


echo area ``I-search:'' ``I-serach backward:''


``RET'' ``DEL'' ``Ctrl-g''

z
z

z
z

RET
minibuffer RET


`` Ctrl-g''
Ctrl-g
``Ctrl-g''
``Ctrl-g'' minibuffer

``Ctrl-g''
minibuffer ``Ctrl-g''

``Ctrl-g''
``Ctrl-g'' minibuffer
``Ctrl-g''

z
z

DEL
minibuffer DELdelete-backward-char
DEL

minibuffer
DEL

``Ctrl-s'' minibuffer
``I-search:'' Ctrl-r ``I-search backward:''

z
z
z

z
z

`` Ctrl-s''
`` Ctrl-s''
echo area ``Failing I-search:''
`` Ctrl-s'' echo area

``Failing I-search''
`` Ctrl-s''
`` Ctrl-s'' `` Ctrlr''

EMACS EMACS
search ring
kill-ring
4.4
EMACS buffer and windows
`` serach-ring''

`` search-ring'' ring

`` Ctrl-h v'' `` search-ring''


search-ring's value is ("kill" "Ctrl" "tex" "Ctrl-h" "text" "search")
Documentation:
List of search string sequences.
`` search-ring''
kill Ctrl tex Ctrl-h text search
``kill''
``Ctrl'' ``search''
`` search-ring''

Ctrl-s Ctrl-r

z
{
{

{
{

ESC-p
echo area I-search: ``ESC-p'' ``Ctrl''
``ESC-p''
ESC-n\indexESC-n
echo area I-search: ESC-n ``search''
``ESC-n''

search-ring

echo area

I-search: minibuffer
minibuffer

z
z

z
z

z
z

Ctrl-y
minibuffer `` Ctrl-y''

Ctrl-w
word `` Ctrl-w'' ``
Ctrl-w'' word minibuffer
minibuffer
minibuffer
ESC-y(yank-pop)
kill-ring `` Ctrl-s'' `` Ctrl-r'' ``
ESC-y'' kill-ring minibuffer

incremental search
nonincremental search nonincremental search

nonincremental search incremental search


`` Ctrl-s'' `` Ctrl-r'' incremental search echo area
``I-search:'' ``I-search backward:'' RET
nonincremental search.echo area
echo area ``Search:''
``Search backward:'' incremental search
nonincremental search minibuffer
RET nonincremental serach
nonincremental search ``Search:''
``Search backward:'' ``Ctrl-w''
Words Search minibuffer

nonincremental serach

nonincremental string

Ctrl-r RET string RET


Ctrl-s RET string RET
nonincremental word
{

z
z

{
{

Ctrl-r RET Ctrl-w words RET


Ctrl-s RET Ctrl-w words RET

incremental search nonincremental search


regular expressionRegexp
regular expression
regular expression
regular expression

regular expression 6.3

Regexp incremental search

ESC-Ctrl-sisearch-forward-regexp)
{ Regexp ``ESC'' ``Ctrls'' echo area Regexp I-search: Regexp
Regexp
Regexp ``Ctrl-s''

Regexp search-ring
Regexp search ring `` ESCp'' `` ESC-n'' Regexp search-ring
{ ESC-Ctrl-risearch-backward-regexp
{ Regexp ``
Ctrl-r'' `` ESC-p'' `` ESC-n'' search-ring
nonincremental search
Regexp nonincremental search
{

z
z
z

ESC-x re-search-forward
ESC-x re-search-backward

{
{

Replacement

1.
2.
replacement
EMACS replacement

EMACS replacement

Regexp
z

z
{
{


Unconditional Replacement
{
{
query replacement

z
{
{

{
{

minibuffer

Regexp
Regexp Regexp


Regexp

replacement
z
z

Unconditional Replace

{ ESC-x replace-string RET string RET newstring RET


{ string newstring

1. ``ESC-x replace-string'' RET


2. echo area
Replace string:
``Replace string:'' minibuffer
RET

z
z

3. RET echo area


4. Replace string string with: minibuffer
RET string newstring
5. echo area ``done''
{ ESC-x replace-Regexp RET Regexp RETnewstring RET

``Regexp''
``string'' echo area
string Regexp
Query Replace
Query Replace
Regexp
{ ESC-x query-replace RET string RET newstring RET
{ query replace unconditional replace


1. ESC-x query-replace RET
2. Query replace: Regexp RET
3. Query replace Regexp with: newstring RET
4. Query replacing Regexp with newstring:(? for help)

5. query replace unconditional replace


``?''
``?'' Query replacing
Regexp with string.
Type Space or `y' to replace one match, Delete or `n' to skip to next,
RET or `q' to exit, Period to replace one match and exit,
Comma to replace but not move point immediately,
C-r to enter recursive edit (M-C-c to get out again),
C-w to delete match and recursive edit,
C-l to clear the screen, redisplay, and offer same replacement again,
! to replace all remaining matches with no more questions,
^ to move point back to previous match.
query replace

{
{

1. Space y
2. Space y
query replace
``Space'' ``y''

3. Delete n
4. Delete n

5.
Period
6.
``.''
query replace
7. !
8. `` !'' query replace unconditional replace
unconditional replace ``!''

9. RET `` q''
10. query-replace
RET ``q''
ESC-x query-replace-Regexp RET Regexp RET newstring RET
`` ESC-x query-replace RET string RET newstring RET''

case sensitive
unconditional replace
query replace query-replace
unconditional replace
`` ESC-x query-replace RET string RET newstring RET''

string newstring

z
z

string newstring

{
{

string abc newstring xyz abc Abc aBc
abC ABc AbC aBC ABC xyz Xyz xyz xyz Xyz Xyz xyz XYZ

newstring string

z
{


newstring

newstring

string abc newstring Xyz


abc Abc aBc abC ABc AbC aBC ABC Xyz Xyz Xyz
Xyz Xyz Xyz Xyz XYZ
{ string abc newstring xYz
{ abc Abc aBc abC ABc AbC aBC ABC xYz XYz xYz
xYz XYz XYz xYz XYZ
{ string abc newstring xyZ
{ abc Abc aBc abC ABc AbC aBC ABC xyZ XyZ xyZ
xyZ XyZ XyZ xyZ XYZ
{ string abc newstring XYz
{ abc Abc aBc abC ABc AbC aBC ABC XYz XYz
XYz XYz XYz XYz XYz XYZ
{ string abc newstring xYZ
{ abc Abc aBc abC ABc AbC aBC ABC xYZ XYZ
xYZ xYZ XYZ XYZ xYZ XYZ
{ string abc newstring XYZ
{ abc Abc aBc abC ABc AbC aBC ABC XYZ XYZ
XYZ XYZ XYZ XYZ XYZ XYZ
string newstring
newstring

{ string Abc newstring xyz


{ abc Abc aBc abC ABc AbC aBC ABC xyz xyz xyz
xyz xyz xyz xyz xyz
{ string aBc newstring xyz
{ abc Abc aBc abC ABc AbC aBC ABC xyz xyz xyz
xyz xyz xyz xyz xyz
{
{

{
{

{
{

{
{

{
{

{
{

{
{

string ABc newstring xyz


abc Abc aBc abC ABc AbC aBC ABC xyz xyz xyz
xyz xyz xyz xyz xyz
string ABC newstring xyz
abc Abc aBc abC ABc AbC aBC ABC xyz xyz xyz
xyz xyz xyz xyz xyz
string aBC newstring Xyz
abc Abc aBc abC ABc AbC aBC ABC Xyz Xyz Xyz
Xyz Xyz Xyz Xyz Xyz
string Abc newstring xYz
abc Abc aBc abC ABc AbC aBC ABC xYz xYz xYz
xYz xYz xYz xYz xYz
string aBc newstring XYz
abc Abc aBc abC ABc AbC aBC ABC XYz XYz XYz
XYz XYz XYz XYz XYz
string ABC newstring XYZ
abc Abc aBc abC ABc AbC aBC ABC XYZ XYZ
XYZ XYZ XYZ XYZ XYZ XYZ

Regular Expression
Regular Expression
Regular Expression Regexp
pattern
character Regexp
pattern Regexp
Regexp
Regexp Regexp
Regexp

Regexp EMACS
Regexp

read_i.c read_c.c read_f read.c


read.c
Regexp

LISP ``;'' LaTex ``''


H
LISP ``;''
``;'' ``;'' Regexp

Regexp C
``.c'' C++ ``.C'' FORTRAN ``.f''
FORTRAN C ``.c''

``filename.f'' ``filename.c'' Regexp

Regexp
Regexp
94019
Regexp EMACS UNIX UNIX
Regexp Regexp
UNIX Regexp EMACS ed ex vi sed awk
grep egrep Regexp

Regexp
Regexp Regexp Regexp
Regexp
EMACS Regexp $ ^ . * + ? [] \ ``a''
``a'' ``a.'' ``a*'' ``a?'' ``a+''
``a''
\ Regexp
Regexp 94019 Regexp

z
z

z
z

z
z

.
. newline ``a.b''
``a'' ``b''
newline ``a.b'' aababb
acbaxba1ba2b
``a^b''

postfix character *+ ?
{ *
{ *
``ab*'' aababbabbbabbb ab...b b
{ +
{ +
``ab+'' ababbabbbabbb ab...b b
{ ?
{ ?
``ab?'' ``a'' ``ab''
character set
[...]
{ [...]
{ [a@!d13]
a@!1 3
[a-g] [abcdefg]

{ [...] >
{

[...] *
c[ab]d ``cad'' ``cbd'' c[ab]*d ``c'' ``d''
[ab]* [ab]* cdcad
cbdcaabdcabbaar
[...] +
c[ab]+d ``c'' ``d'' [ab]+

[ab]+ cadcbdcaabdcabbaad
[...] ?
c[ab]?d ``c'' ``d'' [ab]?
[ab]? cdcadcbd
{
{ Regexp

``^'' ``-''
1. ``^''
2. ``^''
[a-zA-Z] [^a-zA-Z]

3. ``-''
4. ``-''
``-'' [abcdefg] [a-g] [a-z]
[0-9]
[0-9][0-9]
Regexp

z
z

``^'' Regexp
{ Regexp ``^'' Regexp ``^
The'' ``The''
{ ``$'' Regexp
{ Regexp Regexp ``$''
xxxx+$ ``x''
``\''
\ Regexp

{ \
^ \^ ^
{
{ | ( ) d ' ` b B< > w W sc Sc \
| ()d<
>
\|
Regexp \| Regexp
,the\| it Regexp
the itThetHethETHetHETHEiTIT
EMACS case
sensitive 6.1 \|
Regexp Regexp
read get file
`` readfile\| getfile
Regexp

Regexp
\(...\) Regexp
``\(read\| get\)file'' readfile getfile
\(...\) *+? *
+?
\(...\)
``ba\(na\)* banabanana bana.......na na
{

z
z

1. \ d
2. Regexp egexp
Regexp
.c .f ESC-x replace-Regexp
RET \(file[0-9]\)\.c RET \1\.f file1.c file2.c file3.c ......
file9.c file1.f file2.f file3.f ........ file9.f
3. \<
4. \> \< b[a-z]g\> beg big bag

Emacs
EMACS
register bookmark EMACS
register bookmark

Registers and Bookmarks


EMACS register ( point loaction
register EMACS register
register
register register
bookmark bookmark register

z
z

z
z

bookmark character register

bookmark EMACS register


EMACS
register bookmark register
register

register
z point
z

Ctrl-x r SPC rpoint-to-register register


register
1.
2. ``|Ctrl-x r|'' ``SPACE''
3. echo area Point to register
4. character register
register

{ Ctrl-x r j rjump-to-register
{ register r r
register r

1. ``Ctrl-x r SPC r'' register r


2. ``Ctrl-x r j'' echo area ``Jump to register:''
3. ``Jump to register:'' register r
register r

register

register
`` Ctrl-x Ctrl-f''
`` Ctrl-x Ctrl-f''
{

z
z

z
z

EMACS
register register
register register
1. register register
``.emacs'' register
``.emacs''
2. register
3.
1. ``.emacs''
2. ``.emacs'' ``set-register'' register
``chap7.tex''
``a'' register ``.emacs'' (setregister ?a '(file . "\~/report/emacs/basic/chap7.tex"))
3. ``.emacs'' EMACS
EMACS EMACS
``.emacs'' EMACS ,
`` Ctrl-x r j r'' register r
register r
4.
1. ``Ctrl-x r j RET '' echo area
2. ``Jump to register:''
3. ``Jump to register:''
4. register ``a''
chap7.tex
register
register linear text
rectangle text register
register

5.4 ``Move Text and Copy Text''

{ register
{

1. register
2. 5.3 Ctrl-@
Ctrl-SPC
3. `` Ctrl-x r s r''
4. register r
5. register r
6. `` Ctrl-x r i r'' r
register EMACS
register ``.emacs''
register ``a'' register register ``.'' ``''
(set-register ?a "register") (set-register ?. "")
{

register

1.
2.
3.
4.

register

`` Ctrl-x r r r''
register r

5. register r
6. `` Ctrl-x r i r'' r
register
register
register

register bookmark bookmark


bookmark register
register bookmark
register
bookmark EMACS
bookmark bookmark
bookmark
1. `` Ctrl-x r m bookmark ''
2. (mark bookmark `` Ctrl-x r m''
echo area ``Set bookmark (visited-filename) :''
RET bookmark
bookmark
3. `` Ctrl-x r b bookmark RET''
4. ``Ctrl-x r b'' echo area
``Jump to bookmark (bookmark-name) :''
`:'
bookmark
bookmark
``~/.emacs-bkmrks''\index.emacs-bkmrks
EMACS Fixing Typos

EMACS EMACS EMACS


UNIX UNIX UNIX
(spelling checker program) spell ispell
ispell UNIX ispell
spell `` which'' `` find'' shell UNIX
which find
man page
EMACS ispell EMACS
UNIX ispell ispell ftp
(Ispell is available via anonymous ftp from ftp.cs.ucla.edu in the
directory /pub/ispell.)
ispell
ispell
ispell echo area

ispell

ispell ispell (standard


dictionary) private dictionary


ESC-x ispell-change-dictionary
``ispell-dictionary''
`` Ctrl-h v''
4.4 ispell-dictionary's value is nil Documentation: If non-nil, a dictionary to use
instead of the default one. This is passed to the ispell process using the "-d" switch and is
used as key in ispell-dictionary-alist (which see). You should set this variable before your
first call to ispell (e.g. in your .emacs), or use the M-x ispell-change-dictionary command
to change it, as changing this variable only takes effect in a newly started ispell process.
ispell
z
z

z
z
z
z

{ ispell

{ ispell
{ ESC-\$
{ region ispell
{ ESC-x ispell-region\index{ESC-x ispell-region

{ buffer ispell
{ ESC-x ispell-buffer
ispell
ESC-x ispell-message
ispell echo area

ispell
{
{ echo area
word is correct
{
{

ispell
ispell

SPC

digit
ispell

dictionory
`` (0)dictionary ''
`0'
r new RET

new

R new RET
``query-replace''

a

EMACS /i> EMACS

A
``A'' ``a''

i
ispell

``i'' ispell


ispell
``i''
ispell
EMACS EMACS
echo area
"m'' `` i''

EMACS UNIX
ispell ftp
ispell EMACS ispell

Transposing Text

Ctrl-t transpose-chars
character
{ ESC-ttranspose-words
{ word punctuation
transposing,text text,transposing
text transposing,
{ Ctrl-x Ctrl-ttranspose-lines

Case Conversion
{

z
z

{
{

{
{

{
{

ESC-l
ESC-l

ESC-u
ESC-l

ESC-c
capital

EMACS

EMACS
ASCII EMACS

EMACS
EMACS

z Ctrl-c > picture-movement-right


z
z

Ctrl-c < picture-movement-left

z
z

Ctrl-c . picture-movement-down )

z
z

Ctrl-c ^ picture-movement-up)

z
z

Ctrl-c \ picture-movement-se

z
z

Ctrl-c / picture-movement-sw

z
z

Ctrl-c ' picture-movement-ne

z
z

Ctrl-c ` picture-movement-nw


(rignt) C-c ^ . (nw) .
(ne) C-c ` . C-c ' . . . . . . . . . ... C-c < ................... C-c > (left) ... (right) . . . . . . . . . C-c / .
C-c \ (sw) . (se) . C-c . (down)
>
< ^

/

`` ESC-x edit-picture''
mode line
`` Ctrl-c Ctrl-c

mode line

Keystrokes

Text Mode

RET

Ctrl-d

Picture Mode

``Ctrl-o''

"Ctrl-c Ctrl-d"

SPACE

Text Modetext Mode


Ctrl-k

Ctrl-k
Text Mode

TABs

TAB

TAB
TABs

Ctrl-n

Ctrl-p

Ctrl-f

Ctrl-b




5.4

z
z
{
{

{
{
{
{
{
{
{
{

Ctrl-x r ddelete-rectangle
yank
undo
Ctrl-x r kkill-rectangle
`` Ctrl-c Ctrl-k''
Ctrl-x r y yank-rectangle
`` Ctrl-c Ctrl-y''
Ctrl-x r o open-rectangle

Ctrl-x r r r copy-rectangle-to-register
register


Ctrl-x r i r insert-register
{ register
{ ESC-x clear-rectangle
{
{ ESC-x string-rectangle RET string RET
{ string

z
z

{
{

{
{

Ctrl-c Ctrl-kpicture-clear-rectangle
`` Ctrl-x r k"

Ctrl-c Ctrl-ypicture-yank-rectangle) `` Ctrl-x r y''


Ctrl-c Ctrl-w r picture-clear-rectangle-to-register
register
`` Ctrl-x r r r
Ctrl-c Ctrl-x r picture-yank-rectangle-from-register register r

EMACS EMACS EMACS


Mule

Emacs .emacs
EMACS 8
8 EMACS
Shell script
file
z
z

C Shell/TC Shell .cshrc


UNIX
{ Sun OS
{ setenv LC_CTYPE ISO_8859_1
{ HP-UX
{ setenv LC_CTYPE american.iso88591
{ 8 8
{ stty cs8 -istrip -parenb
Bourne Shell/Korn Shell .profile UNIX

{ Sun Solaris
{ LC_CTYPE=ISO_8859_1 export LC_CTYPE
{ HP-UX
{ LC_CTYPE=american.iso88591 export LC_CTYPE
{ 8 8
{ stty cs8 -istrip -parenb

Shell script file EMACS


EMACS ``.emacs''
:
(set-input-mode (car (current-input-mode))
(nth 1 (current-input-mode))
0)
(standard-display-8bit 160 255)
EMACS

byte byte

EMACS byte
byte EMACS
byte byte
byte
EMACS
EMACS
byte character
Ctrl-d
Ctrl-d

EMACS
Mule Mule

EMACS Mule
Mule "The MULtilingual Enhancement of GNU Emacs"
EMACS EMACS
Mule Mule Mule 2.0 1994 8 6
Mule EMACS EMACS ``emacs''
Mule Mule ``.emacs'' Mule
EMACS ``.emacs'' ``.emacs''
Mule ``anonymous ftp''
etlport.etl.go.jp [192.31.197.99]: /pub/mule
ftp.mei.co.jp [132.182.49.2]: /public/free/gnu/emacs/mule
sh.wide.ad.jp [133.4.11.11]: /JAPAN/mule/mule-1.0
ftp.funet.fi [128.214.6.100]: /pub/gnu/emacs/mule
cs.huji.ac.il [132.65.16.10]: /pub/gnu/mule
Mule ``MULtilingual Enhancement to GNU Emacs'' 7
bits ASCII ASCII Characters ISO Latin-1 8bits
GBBig516 bits ISO2022 TIS620
VISCII VSCII BIG-5 Mule

Mule
terminal emulator Mule cxtermexterm kterm emulator
Mule EMACS EMACS
Mule Mule EMACS

Mule (text-only
X-window )
Mule Mule Mule
Mule ``.emacs'' (setdefault-file-coding-system *big5*) (set-display-coding-system *big5*) (set-file-coding-systemfor-read *big5*) (quail-mode 1) (quail-use-package "zozy") Emacs
% ``.emacs'' (cond ( (boundp 'muleversion) ;; mule ;; mule (set-default-file-coding-system *big5*) (setdisplay-coding-system *big5*) (set-file-coding-system-for-read *big5*) (quail-mode 1) (quailuse-package "zozy") ;; mule ) ;; emacs ( t ;; emacs (setinput-mode (car (current-input-mode)) (nth 1 (current-input-mode)) 0) (standard-display-8bit
160 255) ) ;; emacs ) Mule

1. Ctrl-x - Ctrl-k - Shift-m RET


2. ``Ctrl-x'' ``Ctrl-k'' ``Shift-m'' RET echo area

Quail Package
3.
4.
{ cj
{ zozy
{ pinyin
{ etzy
{ punct-b5
echo area "Quail Package:"

5. Ctrl-] self-insert-command
6. ``Ctrl-]''

Mule EMACS Mule


Mule
EMACS EMACS
EMACS Mule Mule
EMACS EMACS Mule
EMACS
EMACS
EMACS EMACS

Conclusion
Emacs Emacs
Emacs Emacs
Emacs
Emacs Emacs

Emacs
Emacs
Emacs
Emacs Emacs
Emacs
Emacs
Emacs
Emacs
Emacs

Emacs

Emacs
Emacs Emacs

Emacs
``Ctrl-h'' ``Ctrl-h'' Emacs

Powered by xiaoguos publishing studio


QQ:8204136

You might also like