Questions tagged [ffap]

11 questions
7
votes
4 answers

How do I disable ffap (find file at point) when the first two non-space characters in a line are '//'?

In Verilog/C/C++, comments can begin with //. Here's an example comment, //This is a comment I like to use the find-file-at-point feature. If my cursor is on the file name in `include "some_file.v". But if my cursor is on the above example…
Kaushal Modi
  • 25,203
  • 3
  • 74
  • 179
3
votes
1 answer

Offer a nonexistent file in ffap

How can I get ffap to offer a non-existent file? I'm in a buffer with point inside something that looks like some/directory/structure/a_long_file_name.ext, where a directory some/directory/structure exists but there is no file called…
3
votes
1 answer

Force ffap to ignore '<' and '>' in file names

I am using find-file-at-point and it stubbornly selects incorrect file name string in NXML mode: String where I have cursor on the file name: my-file.ext and when evaluating: (ffap-string-at-point) it selects…
danny
  • 33
  • 3
2
votes
1 answer

create file with ffap if it doesn't exist

Suppose I have a path like /path/to/file/ in the buffer. I'd like to put point over that path and invoke a command that will either open it if it exists or create it if it doesn't. Edit 1 Thanks to @Drew for pointing out that /path/to/file/ ends…
ychaouche
  • 207
  • 1
  • 7
2
votes
2 answers

How to get a string under quotes surrounding the cursor in elisp?

I am trying to write a function that opens a file under the cursor. I need to get the string between quotes that is surrounding the cursor in my elisp function so that I can use that string to call find file, how can I achieve…
2
votes
0 answers

Make helm-find-files work with `\input{file}` in latex files

If the cursor is on file of a line \input{file} in a latex file, helm-find-files doesn't recognize that I want to open file.tex, however calling ffap does. If I write \input{file.tex} it also works with helm. So how can I make helm to recognize…
student
  • 1,007
  • 9
  • 29
1
vote
1 answer

perform shell variable substitution when using find file at point (ffap)

Question: is there a way to convince ffap to perform variable substitution on environment variables before attempting to resolve the file path? I often have lines in shell scripts that read: variable="${ENV_VAR}/path/to/file" When I use ffap on…
kvantour
  • 113
  • 4
1
vote
1 answer

Don't offer non-file-name as a file name in find-file

When opening a file with find-file, the default entry in the minibuffer is the current directory. If I press Down, I see the name of the current file (if the current buffer is visiting a file). Sometimes, if I press Down, I see what seems to be a…
1
vote
2 answers

ffap.el currently ignores file path with whitespace. How can I change this behaviour?

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…
dualism
  • 304
  • 1
  • 6
1
vote
1 answer

Combine find file at point and find file in project

I'm very new to customizing Emacs, and haven't written Elisp commands before. I'm struggling to find a command and key binding that combines find-file-at-point and find-file-in-project (or similar), perhaps a: M-x…
bscipio
  • 181
  • 5
0
votes
0 answers

Make ff-find-other-file ignore include directive in C

I have a binding setup as described here, the problem is every time the cursor is on #include "file" it always tries to jump on this include. I want that no matter where there cursor is I get switched between header and the source files.
Yuki
  • 111
  • 5