Created
May 7, 2015 12:50
-
-
Save dsjt/b87210618caead2c9418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'recentf) | |
(require 'dired-open) | |
;;;###autoload | |
(defun my-add-recentf-in-dired () | |
"Add a file to the recentf list when you try to open the file using dired-open.el." | |
(interactive) | |
(let ((file (dired-get-filename))) | |
(when file | |
(recentf-add-file file))) | |
nil) | |
(add-hook 'dired-open-functions 'my-add-recentf-in-dired) | |
(add-to-list 'recentf-used-hooks '(dired-open-functions my-add-recentf-in-dired)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment