When I invoke ffap on the file path that include whitespace, such as "/path/to/dir name/filename.txt", ffap.el stop searching file path before the "/path/to/dir" part.

I've checked the ffap.el, but there are many options and I couldn't find the appropriate configuration settings to change this behaviour, that trying to find proper file name beyond the whitespace character.

What is the best settings not to ignore whitespace when ffap trying to find the file name that include white space?

  • Does your buffer, like your example, include double-quotes around the filename? If not, what rules are you proposing that ffap should use for determining potential filenames? – phils Apr 26 '18 at 5:17
  • For example, consider that the buffer contains the line embedded somewhere in this text is the name of a file and your file is named in this text. (Or even where in this text.) – phils Apr 26 '18 at 5:24

There are very good odds that ffap is already doing something like what you'd like, but it's hidden from you. Try calling ffap on one of your filepaths; when it offers you only a partial result, hit C-i or TAB (one is an alias of the other). For me, I'm offered a set of completions that include the paths containing spaces.

"Use a different package" is seldom what folk hope to hear, but in this case, it might help. I use helm to view completions for most of my commands; when I call ffap on a file path with a space in the name, helm correctly shows me both a completion only up to the space, and completions past the space. This is a re-packaging of completion information already offered by ffap, but it's a lot easier to use and see.

This is not to say you should use helm -- it's excellent, but also a bit of a commitment. My main suggestion is: ffap is probably already doing what you want, but in a hard-to-use way; a better completion system could fix that.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.