Search code examples
emacsdired

Emacs thing-at-point in a dired buffer


I want to know what "thing" is at point in a dired buffer.

For instance Debug is a "directory":

drwxrwxrwx 0 10-08-2009 17:50 Debug

Makefile is a "file":

-rw-rw-rw- 15k 6-03-2009 13:02 Makefile

and this is a "header"

d:/foo/bar/Debug:

One way to find a thing is to look what face is at point. Is there another way to do it? How can I determine bounds-of-thing-at-point?

The standard (thing-at-point 'filename) does not handle spaces in a filename.


Solution

  • These functions might be helpful in concocting what you want:

    • dired-get-filename
    • dired-move-to-filename
    • dired-move-to-end-of-filename
    • file-directory-p and friends