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-prefix | If non-nil, reverse the prefix argument to ‘dired-at-point’. |
ffap-alist | Alist of (KEY . FUNCTION) pairs parsed by ‘ffap-file-at-point’. |
ffap-at-mouse-fallback | Command invoked by ‘ffap-at-mouse’ if nothing found at click, or nil. |
ffap-bindings | List of binding forms evaluated by function ‘ffap-bindings’. |
ffap-c++-path | List of directories to search for include files. |
ffap-c-path | List of directories to search for include files. |
ffap-compression-suffixes | List of suffixes tried by ‘ffap-file-exists-string’. |
ffap-directory-finder | The command called by ‘dired-at-point’ to find a directory. |
ffap-dired-wildcards | A regexp matching filename wildcard characters, or nil. |
ffap-file-finder | The command called by ‘find-file-at-point’ to find a file. |
ffap-file-name-with-spaces | If non-nil, allow file names with spaces in ‘ffap-string-at-point’. |
ffap-foo-at-bar-prefix | Presumed URL prefix type of strings like "<foo.9z@bar>". |
ffap-ftp-default-user | User name in FTP file names generated by ‘ffap-host-to-filename’. |
ffap-ftp-regexp | File names matching this regexp are treated as remote ffap. |
ffap-ftp-sans-slash-regexp | Strings matching this are coerced to FTP file names by ffap. |
ffap-gopher-regexp | Regexp matching a key in a gopher bookmark. |
ffap-highlight | If non-nil, ffap highlights the current buffer substring. |
ffap-highlight-overlay | Overlay used by function ‘ffap-highlight’. |
ffap-kpathsea-depth | Bound on depth of subdirectory search in ‘ffap-kpathsea-expand-path’. |
ffap-latex-guess-rules | List of rules for guessing a filename. |
ffap-lax-url | If non-nil, allow lax URL matching. |
ffap-machine-p-known | What ‘ffap-machine-p’ does with hostnames that have a known domain. |
ffap-machine-p-local | What ‘ffap-machine-p’ does with hostnames that have no domain. |
ffap-machine-p-unknown | What ‘ffap-machine-p’ does with hostnames that have an unknown domain. |
ffap-max-region-length | Maximum active region length. |
ffap-menu-alist | Buffer local cache of menu presented by ‘ffap-menu’. |
ffap-menu-regexp | If non-nil, regexp overriding ‘ffap-next-regexp’ in ‘ffap-menu’. |
ffap-menu-text-plist | Text properties applied to strings found by ‘ffap-menu-rescan’. |
ffap-newfile-prompt | Whether ‘find-file-at-point’ prompts about a nonexistent file. |
ffap-newsgroup-heads | Used by ‘thing-at-point-newsgroup-p’ if gnus is not running. |
ffap-newsgroup-regexp | Regexp matching a newsgroup name. |
ffap-next-guess | Last value returned by ‘ffap-next-guess’. |
ffap-next-regexp | Regular expression governing movements of ‘ffap-next’. |
ffap-pass-wildcards-to-dired | If non-nil, pass filenames matching ‘ffap-dired-wildcards’ to Dired. |
ffap-prefer-remote-file | Whether to prefer remote files in remote context. |
ffap-require-prefix | If set, reverses the prefix argument to ‘find-file-at-point’. |
ffap-rfc-directories | A list of directories to look for RFC files. |
ffap-rfc-path | A ‘format’ string making a filename for RFC documents. |
ffap-rfs-regexp | Matching file names are treated as remote. Use nil to disable. |
ffap-shell-prompt-regexp | Paths matching this regexp are stripped off the shell prompt. |
ffap-string-at-point | Last string returned by the function ‘ffap-string-at-point’. |
ffap-string-at-point-mode-alist | Alist of (MODE CHARS BEG END), where MODE is a symbol. |
ffap-string-at-point-region | List (BEG END), last region returned by the function ‘ffap-string-at-point’. |
ffap-tex-path | Path where ‘ffap-tex-mode’ looks for TeX files. |
ffap-url-fetcher | A function of one argument, called by ffap to fetch an URL. |
ffap-url-regexp | Regexp matching the beginning of a URI, for ffap. |
ffap-url-unwrap-local | If non-nil, convert some URLs to local file names before prompting. |
ffap-url-unwrap-remote | If non-nil, convert URLs to remote file names before prompting. |
Defined functions (93)
Defined faces (1)
ffap | Face used to highlight the current buffer substring. |