Skip to content

Instantly share code, notes, and snippets.

@snj14
Created February 11, 2009 16:58
Show Gist options
  • Save snj14/62120 to your computer and use it in GitHub Desktop.
Save snj14/62120 to your computer and use it in GitHub Desktop.
;; reqpen-recent-closed-file
(defvar recent-closed-files nil)
(defun collect-recent-closed-files ()
(when buffer-file-name
(push buffer-file-name recent-closed-files)))
(add-hook 'kill-buffer-hook 'collect-recent-closed-files)
(defun reopen-recent-closed-file ()
(interactive)
(when recent-closed-files
(let (path)
(while (not (setq path (pop recent-closed-files))))
(find-file path))))
(global-set-key (kbd "C-z") 'reopen-recent-closed-file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment