Clear buffer-undo-list when showing xrefs

* lisp/progmodes/xref.el (xref--show-xref-buffer): Clear
buffer-undo-list and temporarily bind it to t while rendering the
buffer contents.
This commit is contained in:
Dmitry Gutov 2016-05-04 00:42:43 +03:00
parent c68a09107c
commit 6f82d8ef7d

View file

@ -687,7 +687,9 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
(defun xref--show-xref-buffer (xrefs alist)
(let ((xref-alist (xref--analyze xrefs)))
(with-current-buffer (get-buffer-create xref-buffer-name)
(let ((inhibit-read-only t))
(setq buffer-undo-list nil)
(let ((inhibit-read-only t)
(buffer-undo-list t))
(erase-buffer)
(xref--insert-xrefs xref-alist)
(xref--xref-buffer-mode)