6
如何重新打开刚刚终止的缓冲区,如Firefox浏览器中的CSt?
有时我不小心杀死了一个缓冲区并想重新打开它,就像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) …