Windows 10, Emacs 25.1, Dired+
I use file manager Total Commander. And I set them to show different color (blue) for recent(e.g 1 hour) created/edited files/folder. It's very comfortably.
Here example:
Is it possible in Emacs in Dired+ mode?
Windows 10, Emacs 25.1, Dired+
I use file manager Total Commander. And I set them to show different color (blue) for recent(e.g 1 hour) created/edited files/folder. It's very comfortably.
Here example:
Is it possible in Emacs in Dired+ mode?
This doesn't answer your question directly, but I think it might help.
File creation date is not recorded for some file systems. But you can generally get the last-modified date.
Just use s
to sort the listing by last-modification time. The recently modified files are at the top of each directory listing in the buffer.
Highlighting the recently modified files would certainly be possible (with "recent" being defined relative to some time/date parameter/variable). But why bother? (See #2.)
More useful (I think) than highlighting a set of files would be marking them - in this case, marking the files modified more recently than some time/date. Or marking the files modified between two times/dates.
Marking lets you act in various ways on the marked files and directories. And marks are visible, just like highlighting. (I might add such a marking feature to Dired+ when I get a moment; dunno.)
Actually, you already have #4, in a fashion. Command dired-mark-sexp
, which with Dired+ is bound to both M-(
and * (
and is menu item Mark If... in menu Marks > Mark, lets you mark files and dirs according to any Lisp expression.
And it predefines some variables you can use in the expression. One of those variables is time
, which is the time string used in the Dired listing. So this would mark all files whose last-modification times match the string "10-19"
:
M-x dired-mark-sexp RET (string-match-p "10-19" time)
Alternatively, you could convert such string times to Emacs-Lisp time lists or to numbers and calculate whether the time
falls in some time range you are interested.
Or if you don't want to use the displayed time string you can use file-attributes
with predefined variable name
, to get the last-modified time directly.
Library find-dired+.el
, which enhances standard library find-dired.el
, provides command find-time-dired
. It finds files in a directory that were last modified between two times/dates. If you use Dired+ then you'll find this command as menu item Find Files By Time in menu Dir > Run ‘find’ Command.
You are prompted for the directory (default: current) and for the two times/dates - the default for the later one is the current time.
The output is shown in a Dired buffer.
You can also optionally specify directory-hierarchy depth limits, to search for files. By default, check all files under the current directory.
You can also optionally specify a list of subdirs to exclude from checking.