有时我不小心杀死了一个缓冲区并想重新打开它,就像CSt在Firefox中撤消已关闭的选项卡一样,但是Emacs中没有内置命令,defun undo-kill-buffer
在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)))))
根本不起作用。如果您知道elisp,如何解决这个问题?
如果它可以显示已关闭缓冲区的列表,并且我可以从中选择一个重新打开,那会更好。