You are on page 1of 10

Emacs :

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)

M-k () (kill)


Backspace = C-h Emacshelp
(kill), kill, delete.
emacskillkill ring, ,
. yank.
Undo: C-x u
C-_ C-x uDEC, C-/C-_
C-Shift- 
, 8, C-u 8 C-f
C-u Emacs,(argument/repeat count)
.
C-u 2 0 C-n 20
, C-u 3 C-v , .
.
C-u 1 0 C-x u UNDO 10
C-L:
C-u 0 C-l ,.
, C-u 100 M-100
C-u M-
X windows ,
C-left C-right (word).
C-up C-down  (paragraphs/Cblock)
Home = C-a
End = C-e
C-Home = M-<
C-end = M->
PgUp PgDn = M-v C-v
,
10 C-1 C-0 right-arrow
CTRL, 10, C-u 1 0 .
Mousehi-light.
menu-button
ESC, M-ESC,
disable. , 
,, no.
, , Emacs$,
,.
: Enter.
: C-d (DEL)
Yank: (killed).
kill (C-k, M-k) , ,

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 finding a file.


C-x C-f mini-buffer. , SPC
auto-complete,
. (TAB)
C-x C-f find-file
C-x C-s (save current file, save current buffer)
C-x s
C-x i 


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.

victags, tags (). 


emacs, .
, ? C main(),
main(). M-. emacstag table
. cd, enter. main,
emacsmain(){ ... }.
, 
, M-. ENTER .
emacs (, emacs),
C-u M-. .
, M-SPC , .
.
Emacspackage:
M-x dired(C-x d)
/ , 
M-x
M-x
M-x
M-x
M-x
M-x
M-x

man man page


shell command prompt, vi,elm, tin...
gnus/
rmail 
vmview mail
mh-rmail  (package mh-e)
mh-smail (package mh-e)

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

describe function. function.


SPC, emacslisp , .
describe variable function.
apropos(approximate).lisp function
, emacs.
keybinding
mode help. mode.
C-c key-binding. Emacs
, Ctrl- ,
C-c. mode.
conventionC-c <chr> user, C-c C-<chr>
package.

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]; }

(cons '(1 2) '(3 4))'((1 2) 3 4)


(setq a 1)
(1+ a); a+1
(+ 2 a) ; a+2
(* 1 2 3 4)
(current-buffer); buffer
(switch-to-buffer (other-buffer))
(set-buffer)
(buffer-size)
(setq current-pos (point))
(point-min)
(point-max)
(message "Hello") ; minibufferHello
(if (test)
(then-part)
(else-part))
(cond ((test1) BODY1)
((test2) BODY2)
(tOTHER-WISE)
(let ((var1 value); local variable
var2 ; no value
(var3 value)
...)
BODY ...)
(lambda (ARG-LIST) ...) defun, (anonymous).
:
(setq hello (lambda () (message "Hello,World")))
(funcall hello)
(goto-char (point-max))
(defvar VAR VALUE "*") VAR .
C-h v . */ 
.
M-x edit-options  (emacs,
edit-options,
.emacs.
(directory-files "./" t "\\..*")
return a list of files under directory X
(load "xxxx.el")#include <stdio.h>
(setq load-path (cons "~/emacs" load-path)) ; loadsearch path.
(autoload ...) loadevaluate , 
load.
(local-unset-key [(control c)])
(local-set-key [(control c) a] 'forward-sexp)
sexp expession, nexpression.
(expression, C, lisp
tex, html, fortran )

You might also like