Lisp is List Processor. Lisp is a programmable programming language.
Emacs is built by Emacs Lisp, a dialect of Lisp.
something
is a variable. Like a pointer point to something defined.
`something
is "something" itself.
(+ 2 2)
the first element +
is evaluated as a function taking into the other two elements.
`(red green blue)
is just a list of elements.
;
begins a comment line.
C-x C-e
: Evaluate with cursor placed at the end of a Lisp list.C-u C-x C-e
: Append the evaluation result to the current line.q
to quit debugger.
(set 'carnivores '(lion tiger leopard))
is the same as:
(setq carnivores '(lion tiger leopard))
Define functions.
(defun FUNCTION-NAME (ARGUMENTS…)
"OPTIONAL-DOCUMENTATION…"
(interactive ARGUMENT-PASSING-INFO) ; optional
BODY…)
Local variables.
(let VARLIST BODY…)
(let ((VARIABLE VALUE)
(VARIABLE VALUE)
…)
BODY…)
(if (> 4 5) ; if-part
(message "4 falsely greater than 5!") ; then-part
(message "4 is not greater than 5!")) ; else-part
(message "This will show up in echo area")