Professional Documents
Culture Documents
emacs, X-windows. X ,
emacs -nw(No windows).
C-X CTRL, X, CTRL, X.
M-X META META
META, M-X ESC, X.
SunMETA.
METAALT.(ALT)
C-X M-XX.
EmacsC-<chr>M-<chr>.
, Emacs.
mini buffer
Emacs C-x C-c
C-g
Emacs, C-g. C-g.
C-p (previous line) C-n (next line)
C-f (forward) C-b (backward)
Emacs, buffer
, C-f (forward), C-b (backward)
, .
C-v (view next screen)
M-v
,,.
Emacs, ,
.
C-L
Emacspoint. point ==
(word) M-f M-b
C-f M-f, C-b M-b.
C-a C-e
M-a M-e
(M-a ,.
M-e )
M-< M->
/ C-d
DEL(Delete)
DELRubout (Rub out)
M-DEL (word)
M-d ()
C-k (kill)
emacs, C-y .
Cut & Paste. Kill delete,
killyank.
, killkill,
yank.
Kill kill ring, ring,
kill. yank kill.
, M-y .(M-yemacs, ,
,).
M-y C-y.
== C-k ,,
C-y . C-y, .
killyank.
, M-w, .
,. Mark C-SPC C-@ .
, M-w mark point
kill ring. point .
EmacsMarkhighlight, X.
X, M-w .
kill & yank cut & paste.
Bash
Emacs,buffer.
window/buffer.
,
, .
, :
C-x 0
C-x 1 (One Window),
/.
Emacs, .
, C-x 1 .
.
C-x o(other-window)
C-x 2 ()
C-x 3()
C-x 4 .
C-x 5 X, frame.
C-x 5 2 X (frame).
C-x C-b buffer (bufferemacs).
C-x b minibufferbuffer,buffer.
TAB. buffer (buffer),
*, , *scratch*
:
C-x 1 .
Emacs
emacsC-<chr> M-<chr>.
, .
Emacs2. C-x 1 C-x C-b.
C-x .
. M-x Emacs
. , .
. .
C-x C-c Emacs. Emacs,
. C-z
C-z Emacs, . ,fg %emacsfg
Emacs.
X, C-zemacsicon
mode line
emacs (buffer) (modeline) (minibuffer)
. modeline .
:
--**-XEmacs: xemacs.qs(Fundamental)----74%------, 74% .
(Fundamental)..
, C-mode, lisp-mode, tex-mode, text-mode
. . text-mode.
M-x text-mode
text-mode, . Fundamental mode
. , Emacs,
M-f M-b , .
... (Text)----70%--Major mode. minor mode, .
, M-x auto-fill-mode (Text Fill).
auto-fill, 70.
M-X fundamental-mode .
, emacs minibufferauto-completion,
M-x fund SPC, fundamental-mode,
. , .
find-file (C-x C-f). .
, minibufferM-n M-p .
**. *.
* (buffer).
emacsbufferread-only buffer, %
%%read-only.
C-x C-q read-only, .
toggle, , C-x C-q
read-only.
Search
Search . Search
, emacs.
C-s
C-r
M-x re-search-forward
M-x re-search-backward
M-x search-forward
M-x search-backward
search. C-s, C-rincreamental search,
, emacs. forward, backward.
? C-g, . Enter
-- minibuffer:Mark saved where search started
? isearchmark, point
(cursor) .
?
C-x C-x .(exchange-point-and-mark)
C-u C-SPC mark.
(C-SPCmark, argument, )
(C-u .
repeat count,
on/off, true/false, set/clear)
M-x re-search-forwardregular expression.
M-x search-forwardincreamental.
, grep:
M-x occure
searchreplace.
M-x replace SPC, .
Emacs:
Emacs $HOME/.emacs
, emacslisp, .emacs
lisp. emacslispelisp, lisp.
info page, emacs-lisp-intro, emacs lisp.
, programming, .
texinfo, . (,
)
.emacs, emacs, ?
1. vi .emacs :>
2. emacs -q emacs
Major Modes
emacs major mode
fundamental-mode
text-mode
lisp-mode /, lisp code.
c-mode/cc-mode c-modec-mode, cc-mode
c-mode. /.
emacscompile, compiler error
. debug. (dbx/gdb)
compileMakefile.
tex-modeTex/Latex.
.
<programming-language>-mode
lisp/cc-mode. interpreter,
emacs/debug.
<programming-language>-modetags, .
html-mode, texinfo-mode, sgml-mode: html, texi, sgml.
w3-mode WWW browser. x-win,...
Tags
Tags ? . emacs,
vi . emacs.
, , , tin ,
~/tin-1.3beta . .
, emacs cd:
M-x cd
, tag table.
tag table , (variable/function call)
. , emacs
. , TAGS ()
M-! etags *.[ch]
M-! external shell command. etagsemacs.
source code.
emacsnews/bbs. !
. mail folder
, quota, elmmutt.
mailling listprocmail. .
mh-e mh , . vm gnus.
rcs/sccs, emacsversion control
(minor mode.), c-x c-q check-in/check-out.
:
Emacslisp ,self-documenting.
.
,backspace, C-h (backspace
ascii) emacshelp, .
:
C-h F
C-h t
C-h n
C-h i
C-h k
Emacs FAQ
Emacs Tutorial
Emacs NEWS file,
Info system. Infognuman page,
WWW.
. , x-win
. , m (menuitem), SPC next page
l (last node: node) u (up node)
d (directory, ). BS (Backspace, back a page).
SPC, man .
describe key, lisp function.
C-h f
C-h v
C-h a
C-h b
C-h m
C-c C-h
help, emacs/elisp.
Elisp :
Emacs., Elisp ,
Elisp ., . Elisp
, lisp, , .
lisp, :
, , .
Basic data type
(string) "Hello, World"
(char)?a ;
atom & list:
(1 2 3 4)list, 4 atom .
pair:.
(apple . 2)
alist (associated list)
pair,perl/tclassociative array.
, (key, value) pair.
'((Apple . 1)
(Orange. 2)
(PineApple . 3))
vector (?)
emacs 19vector (key strok sequence)
[f1] [f2] [f1 a]
nillist, false
ttrue
Forms
.
Form , .
Form Elisp .
lisp list(evaluate),
special form, .
(defun FUNC (ARG-LIST)
BODY ...)
special form, , FUNC
, symbol, ...
(quote (LIST))
special form, lisp (LIST)symbol,
evaluate.
quote , :
'(LIST) (quote (LIST))
'Asymbol Atom, Asymbol
set /.
(set 'hello 1)
; hello = 1
; 'hello, lispevaluate hello.
, .
(setq hello 1)
setq set quote . special form,
.
Evaluation
Emacs, C-x C-e (evaluate, ).
minibuffer.
lisp-interaction-mode C-j evaluate, append buffer.
lisp list .expression.
expression .
expression, .
(C int delete_char() , int,
char)
:
(defun NAME (ARGS-LIST)
""; optional
(interactive) ; optional
BODY)
NAME. BODY expression.
C-h f.
(interactive) user/buffer.
(interactive "B") userbuffer,
. (, userkey-binding
M-x )
(interactive "BAppend to buffer: \nr")
user buffer name, Append to buffer:
function,B, buffer
r, region
\n .
(interactive "p") C-u prefix .
==4. C-u C-f
lisp :
(list 1 2 3 4) '(1 2 3 4)
(car '(1 2 3 4) 1
(cdr '(1 2 3 4) '(2 3 4)
(cons 1 '(2 3 4)) '(1 2 3 4)
(cons 1 2)(1 . 2)
(cons 0 (cons 1(cons 2 nil)))
'(0 1 2)
{list pair ,
:
pair: {Object *first, Object *second};
*(pair[i].first) == i;
pair[i].second == pair[i+1]; }