ff-paths

Homepage: http://people.debian.org/~psg/elisp

Author: Peter S. Galbraith

Updated:

Summary

Searches certain paths to find files

Commentary

New versions of this package (if they exist) may be found at:
  http://people.debian.org/~psg/elisp/ff-paths.el
or in the Debian package `emacs-goodies-el'.

This code allows you to use C-x C-f normally most of the time, except that
if the requested file doesn't exist, it is checked against a list of
patterns for special paths to search for a file of the same name.

Examples:
 - a file extension of .bib will cause to search the path defined in
   $BSTINPUTS or $BIBINPUTS for the file you requested.
 - a file extension of .h will cause the /usr/include/ and
   /usr/local/include/ directory trees to be searched.
 - a file extension of .sty causes a search of TEXINPUTS and of all
   directories below /usr/lib/texmf/tex/
 - a file extension of .el causes a search of the path set in the
   emacs variable load-path.
 - If the aboves searches don't return a match, the filename is searched
   for using the `locate' command (if available on your system).
 - gzip-compressed files (.gz) will also be found by ff-paths if
   the package jka-compr is present.  If you use some other package,
   simply set the ff-paths-gzipped variable to t:

If one file is found, or many files of the same name are found, then the
*completions* buffer is displayed with all possibilities, including the
non-existing path you first provided.  Selecting it creates the new
file.

This package runs as a find-file-not-found-hooks hook, and so will
happily live alongside other such file-finding mechanisms (e.g.
PC-look-for-include-file PC-try-load-many-files vc-file-not-found-hook)

The patterns to test against filenames and the associated paths to search
for these files can be modified by the user by editing the variable
ff-paths-list defined below.

I suggest that you use ffap.el by Michelangelo Grigni ,
now part of GNU Emacs.  His package will guess the filename from the
text under the editing point.  It will search for an existing file in
various places before you even get the "File: " prompt.  ff-paths will
provide itself to ffap as an additional tool to locate the file before
you ever see a prompt.  ff-paths behaves slightly differently with ffap
than it does with find-file: if the file path selected under point by
ffap does not exist, it is not shown in the completions buffer along
with existing paths.  If only one existing path is found for said file,
it is placed in the minibuffer at the ffap prompt.  Also, since using
the `locate' command is fairly aggressive, it is not used in the ffap
toolkit.

Dependencies