Node:cons & search-fwd Review, Next:search Exercises, Previous:copy-region-as-kill, Up:Cutting & Storing Text
Here is a brief summary of some recently introduced functions.
car
cdr
car
returns the first element of a list; cdr
returns the
second and subsequent elements of a list.
For example:
(car '(1 2 3 4 5 6 7)) => 1 (cdr '(1 2 3 4 5 6 7)) => (2 3 4 5 6 7)
cons
cons
constructs a list by prepending its first argument to its
second argument.
For example:
(cons 1 '(2 3 4)) => (1 2 3 4)
nthcdr
For example:
(nthcdr 3 '(1 2 3 4 5 6 7)) => (4 5 6 7)
setcar
setcdr
setcar
changes the first element of a list; setcdr
changes the second and subsequent elements of a list.
For example:
(setq triple '(1 2 3)) (setcar triple '37) triple => (37 2 3) (setcdr triple '("foo" "bar")) triple => (37 "foo" "bar")
progn
For example:
(progn 1 2 3 4) => 4
save-restriction
search-forward
Takes four arguments:
nil
or an
error message.
kill-region
delete-region
copy-region-as-kill
kill-region
cuts the text between point and mark from the
buffer and stores that text in the kill ring, so you can get it back
by yanking.
delete-and-extract-region
removes the text between point and
mark from the buffer and throws it away. You cannot get it back.
copy-region-as-kill
copies the text between point and mark into
the kill ring, from which you can get it by yanking. The function
does not cut or remove the text from the buffer.