Elisp: Enable Undo in Buffer

By Xah Lee. Date: . Last updated: .

Enable Undo in 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.

buffer-enable-undo

enable undo.

(with-output-to-temp-buffer outputBuffer
  ;; something
  (switch-to-buffer outputBuffer)
  (buffer-enable-undo))
buffer-disable-undo

disable undo.

2014-05-30 Thanks to jcs at http://irreal.org/blog/?p=2729

Reference