The best book to learn writing Emacs Lisp (for me at least), is an oldie: Writing GNU Emacs Extensions. It is from 1997 (ancient history in computing terms), but an exellent introduction.