Function: ffap-guess-file-name-at-point

ffap-guess-file-name-at-point is an autoloaded and byte-compiled function defined in ffap.el.gz.

Signature

(ffap-guess-file-name-at-point)

Documentation

Try to get a file name at point.

This hook is intended to be put in file-name-at-point-functions.

Source Code

;; Defined in /usr/src/emacs/lisp/ffap.el.gz
;;; Hooks to put in `file-name-at-point-functions':

;;;###autoload
(defun ffap-guess-file-name-at-point ()
  "Try to get a file name at point.
This hook is intended to be put in `file-name-at-point-functions'."
  ;; ffap-guesser can signal an error, and we don't want that when,
  ;; e.g., the user types M-n at the "C-x C-f" prompt.
  (let ((guess (ignore-errors (ffap-guesser))))
    (when (stringp guess)
      (let ((url (ffap-url-p guess)))
	(or url
	    (progn
	      (unless (ffap-file-remote-p guess)
		(setq guess
		      (abbreviate-file-name (expand-file-name guess))))
	      (if (file-directory-p guess)
		  (file-name-as-directory guess)
		guess)))))))