I am creating a dired-mode
buffer with:
(dired (directory-files-recursively default-directory ""))
This gives me absolute paths for each file, which is great. I am still unsure how the default-directory
in the resulting new dired-mode
buffer is chosen.
Example, my dired- heading is: /Users/HOME/Desktop/0.r_d_w_1/Chase Checking/2015:
. The file list, however, was recursively generated from /Users/HOME/Desktop/0.r_d_w_1/
with many sub-directories -- i.e., not just "Chase Checking/2015".
The problem that I am trying to solve is that wdired-get-filename
assumes that the filenames are relative. When wdired-get-filename
gets the NEW filename (i.e., after the wdired-mode
buffer has been edited), it is incorrect. What happens is that the absolute path of the NEW filename is concatenated to the end of the default-directory
. The problematic code looks like this: (concat (dired-current-directory) file)
, where FILE is the absolute path.
I would like to make wdired-get-filename
play nice with absolute paths in addition to the default behavior which uses the default-directory
and the modified relative-name for the NEW filename.
My initial thinking was to come up with a test to see if the the filename is absolute or relative, and then only concatenate if the latter. However, I would certainly be amenable to a better solution.