Len commented on Emacs Lisp - An Introduction by Robert J. Chassell
I'm loving the gentleness of introduction that this book provides. It goes slowly through the code examples and shows you how to read the #EmacsLisp code.
And a spoiler: Here is my attempt for the Chapter 8 exercise: (defun test-search (string) "Search for string and left a point there if it is found." (interactive "sSearch for: ") (let ((found) (current (point)) (len (length string))) (save-excursion (while (and (< (+ len current) (point-max)) (not found)) ;; why complicate? just whole string on each position. (if (string-equal string (buffer-substring-no-properties (point) (+ (point) len))) ;; we found the string (progn (message "Found!") (setq found t) ) (progn ;; else (setq current (+ 1 current)) (forward-char) ) ) ) ) (when found ;; we found the string so we move the point. (goto-char (+ current len)) ) ) )