To understand the logic behind Emacs Lisp, it is important to remember that there is an emphasis on providing data structures and features specific to making a versatile text editor over implementing a general-purpose programming language.
Here follows a simple example of an Emacs extension written in Emacs Lisp.