A veces, accidentalmente mato un búfer y quiero volver a abrirlo, al igual que CSt para deshacer la pestaña cerrada en Firefox, pero no hay un comando incorporado en Emacs, defun undo-kill-buffer
en http://www.emacswiki.org/RecentFiles :
(defun undo-kill-buffer (arg)
"Re-open the last buffer killed. With ARG, re-open the nth buffer."
(interactive "p")
(let ((recently-killed-list (copy-sequence recentf-list))
(buffer-files-list
(delq nil (mapcar (lambda (buf)
(when (buffer-file-name buf)
(expand-file-name (buffer-file-name buf)))) (buffer-list)))))
(mapc
(lambda (buf-file)
(setq recently-killed-list
(delq buf-file recently-killed-list)))
buffer-files-list)
(find-file
(if arg (nth arg recently-killed-list)
(car recently-killed-list)))))
no funciona en absoluto Si conoce elisp, ¿cómo resolver este problema?
Si puede mostrar una lista de los buffers cerrados y puedo elegir uno de ellos para reabrir, sería mejor.