0

How to get link to file when using find-name-dired on MS-Windows?

I am using MS-Windows and spacemacs. I am use org mode files to manage information. I also have a directories with many reference files in them.

If I want to create a link in an org-mode file to a reference file in my directory I thought that using the function find-name-dired would be great as I could use it to search file names recursively for a given pattern in reference files.

First I needed to get spacemacs configured to use GNU find. See: Using find command on windows

When GNU find.exe lists files in a buffer I find that when I try to link to a file I only get the name of the initial parent directory, not the name of the file that is currently highlighted by the cursor.

Steps

    • Open some org file
    • SPC SPC find-name-dired
    • Select top directory to search from
    • Enter pattern to search for: 2019-*
    • Buffer displays list of files or directories that match pattern
    • Use UP/DOWN arrow keys to find a file.
    • C-c l to copy link to file (Except it only gets link to directory)
    • SPC TAB to return to org file.
    • C-C C-l to list and select link
    • Link is now in org file.

If I replace steps 2-3 with SPC SPC dired-jump then remaining steps as above work.

See the screen shot as at the end of step 7. C-c l should capture the a link to the file. It does not.

How can I capture the link to the marked file?

  • Clearly the problem is not with find-name-dired or Dired, as the absolute file name is shown. Your screenshot shows C-c l, but that info is missing from your question text. Please provide a step-by-step recipe. It sounds like the problem is with C-c l (?). Maybe try M-x debug-on-entry for that command, to see where it goes wrong. (Or maybe just check its doc, with C-h f.) – Drew Nov 6 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.