Emacs Lisp: Enable Undo in Buffer
How to enable undo in output/temp buffer?
when writing elisp command, sometimes your command generates a output buffer. You can enable undo in that buffer, so user who might use that buffer will have undo.
to enable, just call
(with-output-to-temp-buffer outputBuffer ;; something (switch-to-buffer outputBuffer) (buffer-enable-undo))
Thanks to jcs at irreal.org