You might want to try Dired+. It offers these commands for use with recentf:
- diredp-add-file-to-recentf
- diredp-add-this-to-recentf
- diredp-dired-recent-dirs
C-x D r
- diredp-dired-recent-dirs-other-window
C-x 4 D r
- diredp-dired-recent-files
C-x D R
- diredp-dired-recent-files-other-window
C-x 4 D R
- diredp-do-add-to-recentf
- diredp-do-remove-from-recentf
- diredp-remove-file-from-recentf
- diredp-remove-this-from-recentf
In particular, diredp-dired-recent-dirs
should do what I think you're looking for:
diredp-dired-recent-dirs
is an interactive compiled Lisp function in
dired+.el
.
It is bound to menu-bar subdir diredp-dired-recent-dirs
, C-x D r
.
(diredp-dired-recent-dirs BUFFER &optional ARG FILES)
Open Dired in BUFFER
, showing recently visited directories.
Like diredp-dired-recent-files
, but limited to recent directories.
A directory is recent if any of its files is recent.
The doc of diredp-dired-recent-files
, which the above refers to, tells you about using a prefix arg. Note that C-u
or 0
as prefix arg prompts you for the ls
switches to use, and you can specify chronological order with the switches (e.g. switch t
).
You can also just use option diredp-default-sort-arbitrary-function
to sort the entries however you want.
diredp-dired-recent-files
is an interactive compiled Lisp function in dired+.el
.
It is bound to C-x D R
.
(diredp-dired-recent-files BUFFER &optional ARG FILES)
Open Dired in BUFFER, showing recently visited files and directories.
You are prompted for BUFFER
(default: Recently Visited Files
).
With a numeric prefix arg you can enter names of recent files to
include or exclude.
No prefix arg or a plain prefix arg (C-u
, C-u C-u
, etc.) means
list all of the recently used files.
With a prefix arg:
- If 0,
-
, or plain (C-u
) then you are prompted for the ls
switches to use.
- If not plain (
C-u
) then:
- If >= 0 then the files to include are read, one by one.
- If < 0 then the files to exclude are read, one by one.
When entering files to include or exclude, use C-g
to end.
The file listing is sorted by option
diredp-default-sort-arbitrary-function
, if non-nil
. If nil
(the
default) then the listing is in reverse chronological order of opening
or writing files you access.
Use g
to revert the buffer, as usual. If you use it without a
prefix arg then the same files are relisted. A prefix arg is handled
as for C-x D R
itself.
When called from Lisp:
ARG
corresponds to the raw prefix arg.
FILES
is passed to diredp--dired-recent-files-1
. It is used only
when the command is used as part of the revert-buffer-function
.
emacs -Q
(no init file)? If not, bisect your file to find the problem. Isdired-recent
a 3rd-party library?