Emacs lisp
Emacs lisp is a dialect of Lisp language family used for script language in Emacs. For the pragraming process, it has similar machanism with lisp or mit-scheme (another dialect of Lisp). Since emacs lisp (Elisp for short) functions as a script language inside Emacs, it is necessary to learn Elisp for deeper understanding of Emacs and further hacking purpose.
Inside the emacs, the lisp repl can be invoked by switching to *scratch* buffer. (C-x b
searches for the specific buffer. Default buffer will be *scratch*)
While interacting with Elisp, we can use C-x C-e
or C-j
to compile our procedure.
A useful reference provides more details and basic knowledge about Elisp.
Reverse polish notation is used for number calculations in Elisp:
|
|
setq
is used to create a new variable. insert
is able to insert the string.
|
|
Here, when we input C-x C-e
, the lisp will insert string Hello Yang
in the following of the insert
command.
|
|
defun
can define a new function in the Elisp.
|
|
switch-to-buffer-other-window
is used to create a new window with specific buffer.
|
|
progn
combines multiple expressions into one expression.
|
|
let
binds a value to a local variable.
|
|
format
is able to format a string with given format formula:
|
|
Of course, there are some interative commands like read-from-minibuffer
:
|
|
In this post, it just summaries the basic opeartions from the link mentioned in the first paragraph. More functions or data-structure operations can be discovered in the future code reading.