Emacs Lisp is what you turn to if you want to automate some kind of editing in your document where going through the UI is just too tedious or slow.
Here's an example: I had to do some refactoring in my company a while back. It involved moving around a bunch of methods to a bunch of files. To help people who would be merging our code during the transition, we left "headstone" comments in the old location telling them where the new code would be. The headstones involved commenting out the entire function (including the declaration), deleting the body of the function, and putting a comment in the body's place instead.
After a handful of these, and dozens to go, I was ready to tear my hair out from boredom. So I cobbled the following commands together and stuck them in my ~/.emacs
file. You may be able to get the gist of what they do, even without much in the way of comments.
(defun reheadstone-region (fname beg end)
(interactive "sFilename to use: \nr")
(save-excursion
(save-restriction
(narrow-to-region beg end)
;; comments around entire thing
(goto-char (point-min))
(insert "/*\n")
(goto-char (point-max))
(insert "\n*/\n")
;; zap the method body
(goto-char (point-min))
(search-forward "{")
(forward-line)
(push-mark (point))
(goto-char (point-max))
(search-backward "}")
(beginning-of-line)
(kill-region (region-beginning) (region-end))
(pop-mark)
;; new headstone body
(headstone-in fname))))
(defun headstone-in (fname)
(interactive "sFilename to use: ")
(save-excursion
(beginning-of-line)
(insert (format "\tThis method has been moved to %s." fname))))
This was a quick and dirty hack, and far from perfect in its operation no doubt. But after loading it up and binding it to a key, and directing it a bit by selecting the region surrounding the function I wanted to headstone before executing the command, I was doing a whole series of tedious edits with practically no effort at all. Plus, I got the rush of pleasure from the instant gratification that this code afforded me. My coworkers were wondering why I looked so cheerful as I breezed my way home for the day, especially after looking so grumpy at lunchtime.
That's the sort of thing Emacs Lisp can do for you. I suppose you could argue that this is no different from "developing Emacs itself", since these commands hardly look any different from Emacs's built-in commands from the UI point of view, but the psychological effect is very different. I'm extending the editor with very specific commands in very specific ways to achieve tasks for my project that would be difficult or impossible without a full scripting language and editor API at my disposal. From my point of view (and I've come to this view lately), an Emacs user without some basic facility with Emacs Lisp has not yet become a power user.