File: ffap.el.html

Command find-file-at-point replaces find-file. With a prefix, it behaves exactly like find-file. Without a prefix, it first tries to guess a default file or URL from the text around the point
(ffap-require-prefix swaps these behaviors). This is useful for
following references in situations such as mail or news buffers, README's, MANIFEST's, and so on. Submit bugs or suggestions with M-x report-emacs-bug.

For the default installation, add this line to your init file:

(ffap-bindings) ; do default key bindings

ffap-bindings makes the following global key bindings:

C-x C-f find-file-at-point (abbreviated as ffap)
C-x C-r ffap-read-only
C-x C-v ffap-alternate-file

C-x d dired-at-point
C-x C-d ffap-list-directory

C-x 4 f ffap-other-window
C-x 4 r ffap-read-only-other-window
C-x 4 d ffap-dired-other-window

C-x 5 f ffap-other-frame
C-x 5 r ffap-read-only-other-frame
C-x 5 d ffap-dired-other-frame

C-x t f ffap-other-tab

S-mouse-3 ffap-at-mouse
C-S-mouse-3 ffap-menu

ffap-bindings also adds hooks to make the following local bindings in vm, gnus, and rmail:

M-l ffap-next, or ffap-gnus-next in gnus (l == "link")
M-m ffap-menu, or ffap-gnus-menu in gnus (m == "menu")

If you do not like these bindings, modify the variable ffap-bindings(var)/ffap-bindings(fun), or write your own.

If you use ange-ftp, it is best to load or autoload it before ffap. If you use ff-paths, load it afterwards. Try apropos C-h a ffap RET to get a list of the many option variables. In particular, if ffap is slow, try these:

(setq ffap-alist nil) ; faster, dumber prompting
(setq ffap-url-regexp nil) ; disable URL features in ffap
(setq ffap-shell-prompt-regexp nil) ; disable shell prompt stripping
(setq ffap-gopher-regexp nil) ; disable gopher bookmark matching

ffap uses browse-url to fetch URLs. Also, you can add ffap-menu-rescan to various hooks to fontify the file and URL references within a buffer.

Defined variables (48)

dired-at-point-require-prefixIf non-nil, reverse the prefix argument to ‘dired-at-point’.
ffap-alistAlist of (KEY . FUNCTION) pairs parsed by ‘ffap-file-at-point’.
ffap-at-mouse-fallbackCommand invoked by ‘ffap-at-mouse’ if nothing found at click, or nil.
ffap-bindingsList of binding forms evaluated by function ‘ffap-bindings’.
ffap-c++-pathList of directories to search for include files.
ffap-c-pathList of directories to search for include files.
ffap-compression-suffixesList of suffixes tried by ‘ffap-file-exists-string’.
ffap-directory-finderThe command called by ‘dired-at-point’ to find a directory.
ffap-dired-wildcardsA regexp matching filename wildcard characters, or nil.
ffap-file-finderThe command called by ‘find-file-at-point’ to find a file.
ffap-file-name-with-spacesIf non-nil, allow file names with spaces in ‘ffap-string-at-point’.
ffap-foo-at-bar-prefixPresumed URL prefix type of strings like "<foo.9z@bar>".
ffap-ftp-default-userUser name in FTP file names generated by ‘ffap-host-to-filename’.
ffap-ftp-regexpFile names matching this regexp are treated as remote ffap.
ffap-ftp-sans-slash-regexpStrings matching this are coerced to FTP file names by ffap.
ffap-gopher-regexpRegexp matching a key in a gopher bookmark.
ffap-highlightIf non-nil, ffap highlights the current buffer substring.
ffap-highlight-overlayOverlay used by function ‘ffap-highlight’.
ffap-kpathsea-depthBound on depth of subdirectory search in ‘ffap-kpathsea-expand-path’.
ffap-latex-guess-rulesList of rules for guessing a filename.
ffap-lax-urlIf non-nil, allow lax URL matching.
ffap-machine-p-knownWhat ‘ffap-machine-p’ does with hostnames that have a known domain.
ffap-machine-p-localWhat ‘ffap-machine-p’ does with hostnames that have no domain.
ffap-machine-p-unknownWhat ‘ffap-machine-p’ does with hostnames that have an unknown domain.
ffap-max-region-lengthMaximum active region length.
ffap-menu-alistBuffer local cache of menu presented by ‘ffap-menu’.
ffap-menu-regexpIf non-nil, regexp overriding ‘ffap-next-regexp’ in ‘ffap-menu’.
ffap-menu-text-plistText properties applied to strings found by ‘ffap-menu-rescan’.
ffap-newfile-promptWhether ‘find-file-at-point’ prompts about a nonexistent file.
ffap-newsgroup-headsUsed by ‘thing-at-point-newsgroup-p’ if gnus is not running.
ffap-newsgroup-regexpRegexp matching a newsgroup name.
ffap-next-guessLast value returned by ‘ffap-next-guess’.
ffap-next-regexpRegular expression governing movements of ‘ffap-next’.
ffap-pass-wildcards-to-diredIf non-nil, pass filenames matching ‘ffap-dired-wildcards’ to Dired.
ffap-prefer-remote-fileWhether to prefer remote files in remote context.
ffap-require-prefixIf set, reverses the prefix argument to ‘find-file-at-point’.
ffap-rfc-directoriesA list of directories to look for RFC files.
ffap-rfc-pathA ‘format’ string making a filename for RFC documents.
ffap-rfs-regexpMatching file names are treated as remote. Use nil to disable.
ffap-shell-prompt-regexpPaths matching this regexp are stripped off the shell prompt.
ffap-string-at-pointLast string returned by the function ‘ffap-string-at-point’.
ffap-string-at-point-mode-alistAlist of (MODE CHARS BEG END), where MODE is a symbol.
ffap-string-at-point-regionList (BEG END), last region returned by the function ‘ffap-string-at-point’.
ffap-tex-pathPath where ‘ffap-tex-mode’ looks for TeX files.
ffap-url-fetcherA function of one argument, called by ffap to fetch an URL.
ffap-url-regexpRegexp matching the beginning of a URI, for ffap.
ffap-url-unwrap-localIf non-nil, convert some URLs to local file names before prompting.
ffap-url-unwrap-remoteIf non-nil, convert URLs to remote file names before prompting.

Defined functions (93)

dired-at-point(&optional FILENAME)
dired-at-point-prompter(&optional GUESS)
ffap(&optional FILENAME)
ffap--c-path()
ffap--gcc-is-clang-p()
ffap--gopher-var-on-line()
ffap--toggle-read-only(BUFFER-OR-LIST)
ffap--url-file-handler(OPERATION &rest ARGS)
ffap-accept-or-reject-p(SYMBOL)
ffap-all-subdirs(DIR &optional DEPTH)
ffap-all-subdirs-loop(DIR DEPTH)
ffap-alternate-file(FILENAME)
ffap-alternate-file-other-window(FILENAME)
ffap-at-mouse(E)
ffap-bib(NAME)
ffap-bindings()
ffap-c++-mode(NAME)
ffap-c-mode(NAME)
ffap-completable(NAME)
ffap-copy-string-as-kill(&optional MODE)
ffap-dir-separator-near-point()
ffap-dired(NAME)
ffap-dired-other-frame()
ffap-dired-other-window()
ffap-el(NAME)
ffap-el-mode(NAME)
ffap-event-buffer(EVENT)
ffap-file-at-point()
ffap-file-exists-string(FILE &optional NOMODIFY REMOTE-PREFIX)
ffap-file-remote-p(FILENAME)
ffap-file-suffix(FILE)
ffap-fixup-email(EMAIL)
ffap-fixup-machine(MACH)
ffap-fixup-url(URL)
ffap-fortran-mode(NAME)
ffap-gnus-hook()
ffap-gnus-menu()
ffap-gnus-next()
ffap-gnus-wrapper(FORM)
ffap-gopher-at-point()
ffap-guess-file-name-at-point()
ffap-guesser()
ffap-highlight(&optional REMOVE)
ffap-home(NAME)
ffap-host-to-filename(HOST)
ffap-in-project(NAME)
ffap-info(NAME)
ffap-info-2(NAME)
ffap-info-3(NAME)
ffap-kpathsea-expand-path(PATH)
ffap-latex-mode(NAME)
ffap-lcd(NAME)
ffap-list-directory()
ffap-list-env(ENV &optional EMPTY)
ffap-literally(FILENAME)
ffap-locate-file(FILE NOSUFFIX PATH)
ffap-machine-at-point()
ffap-machine-p(HOST &optional SERVICE QUIET STRATEGY)
ffap-menu(&optional RESCAN)
ffap-menu-ask(TITLE ALIST CONT)
ffap-menu-cont(CHOICE)
ffap-menu-rescan()
ffap-newsgroup-p(STRING)
ffap-next(&optional BACK WRAP)
ffap-next-guess(&optional BACK LIM)
ffap-next-url(&optional BACK WRAP)
ffap-other-frame(FILENAME)
ffap-other-tab(FILENAME)
ffap-other-window(FILENAME)
ffap-prompter(&optional GUESS SUFFIX)
ffap-read-file-or-url(PROMPT GUESS)
ffap-read-only(FILENAME)
ffap-read-only-other-frame(FILENAME)
ffap-read-only-other-tab(FILENAME)
ffap-read-only-other-window(FILENAME)
ffap-reduce-path(PATH)
ffap-replace-file-component(FULLNAME NAME)
ffap-rfc(NAME)
ffap-ro-mode-hook()
ffap-search-backward-file-end(&optional DIR-SEPARATOR END)
ffap-search-forward-file-end(&optional DIR-SEPARATOR)
ffap-string-around()
ffap-string-at-point(&optional MODE)
ffap-symbol-value(SYM &optional DEFAULT)
ffap-tex(NAME)
ffap-tex-mode(NAME)
ffap-url-at-point()
ffap-url-p(STRING)
ffap-url-unwrap-local(URL)
ffap-url-unwrap-remote(URL)
ffap-what-domain(DOMAIN)
find-file-at-point(&optional FILENAME)
find-file-literally-at-point(FILENAME)

Defined faces (1)

ffapFace used to highlight the current buffer substring.