14

Sometimes I launch dired, then rename a file, or add a new file, and dired doesn't see the changes until I relaunch Emacs. Is there a way to configure dired to refresh itself more quickly, either through polling or file system hooks?

mcandre
  • 3,098

2 Answers2

18

Add a hook.

;; Auto-refresh dired on file change
(add-hook 'dired-mode-hook 'auto-revert-mode)
mcandre
  • 3,098
0

(setq dired-do-revert-buffer t)

Automatically revert Dired buffers after ‘dired-do’ operations. This option controls whether to refresh the directory listing in a Dired buffer that is the destination of one of these operations: ‘dired-do-copy’, ‘dired-do-rename’, ‘dired-do-symlink’, ‘dired-do-hardlink’. If the value is t, always revert the Dired buffer updated in the result of these operations. If the value is a function, it is called with the destination directory name as a single argument, and the buffer is reverted after Dired operations if the function returns non-nil.

This variable was introduced in version 28.1 of Emacs.

slk500
  • 101