Handle Dired buffers correctly

(buffer-file-name) evaluates to nil in Dired buffers: Use
default-directory (current directory) as fallback in Dired(+) buffers.