Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes
Accepted

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

This behavior is based on ffap-string-at-point-mode-alist. Take a look at the current value and doc string. You'll see an entry like this: (file "--:\\\\${}+<>@-Z_[:alpha:]~*?" "<@" "@>;...
glucas's user avatar
  • 20.6k
4 votes

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

Thanks to the solution posted by @Sigma. I had that solution in my config for more than 2 years, and finally sent that as a patch to emacs upstream. Commit in emacs master: e472cfe8 Here is what the ...
Kaushal Modi's user avatar
  • 25.7k
3 votes
Accepted

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

Instead of writing from scratch I found a function that does this find-file-at-point.
Prathik Rajendran M's user avatar
2 votes

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

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-...
Gastove's user avatar
  • 1,551
2 votes
Accepted

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

You can redefine ffap-file-finder. This is normally set to find-file, which doesn't do env variable expansion. So define a function like find-file that does do env variable expansion: (defun find-file-...
NickD's user avatar
  • 30.6k
2 votes
Accepted

Offer a nonexistent file in ffap

Simple Solution One can fake the file's existence with an around advice for ffap-file-exists-string: (defun ffap-accept-all (fun file &optional nomodify) "Around advice for `ffap-file-exists-...
Tobias's user avatar
  • 33.3k
1 vote

create file with ffap if it doesn't exist

Just M-x ffap does what you want, no? If so, just bind it to some key: (global-set-key `C-o` #'ffap) That puts you in a buffer for the new file (or new directory, if, as you show, you use a final ...
Drew's user avatar
  • 77.9k
1 vote
Accepted

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

This comes from ffap (find file at point), as the name might suggest. Specifically, find-file uses read-file-name to read its input, which in turn calls read-file-name-default unless overridden ...
Gilles 'SO- stop being evil''s user avatar
1 vote

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

Something to note: while find-file-at-point is great, it still asks for a confirmation. If you ever want a function that doesn't ask for confirmation Xah, provides some elisp code that automatically ...
Greth's user avatar
  • 355

Only top scored, non community-wiki answers of a minimum length are eligible