1
Linux Mint 20
Emacs 27
dired, dired-recent

Steps:

1. "recentf-mode" is turn on
2. Go to directory "Download". Use "Jump to bookmark" (C-x r b). Input "Download"
3. As result in Dired mode open folder "/home/alexeij/Downloads/"
4. Go to directory "Temp". Use "Jump to bookmark" (C-x r b).  Input "Temp"
5. As result in Dired mode open folder "/home/alexeij/Temp/"
6. Go to directory "dev". Use  "Jump to bookmark" (C-x r b).  Input "dev"
7. As result in Dired mode open folder "/home/alexeij/dev/"

Nice. Now I want to see history of recent visited directories in chronological way.

So I use:

dired-recent-open

But in minibuffer show another directories.

Why?

3
  • The question is unclear to me. Is the use of bookmarks important to the recipe here? If not, please simplify it. Also: do you see the same thing if you start Emacs with emacs -Q (no init file)? If not, bisect your file to find the problem. Is dired-recent a 3rd-party library?
    – Drew
    Oct 1, 2021 at 17:39
  • @Drew Yes, this is a 3rd party library - github.com/vifon/dired-recent.el Oct 1, 2021 at 18:32
  • 1
    If you don't get an answer here for that library, you might contact its maintainer. That feature might not yet be available with that library.
    – Drew
    Oct 2, 2021 at 2:27

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.