From: Richard M. Stallman Date: Sat, 13 Feb 1999 16:28:34 +0000 (+0000) Subject: (ffap-file-at-point): Test local file names X-Git-Tag: emacs-20.4~637 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8005ea3f215d3c37621b9b89ebfe7f06d0f5f0ae;p=emacs.git (ffap-file-at-point): Test local file names immediately. Strip off line numbers. --- diff --git a/lisp/ffap.el b/lisp/ffap.el index f2cdcea9408..785cd2376e0 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1100,7 +1100,13 @@ which may actually result in an url rather than a filename." (unwind-protect (cond ;; Immediate rejects (/ and // are too common in C++): - ((member name '("" "/" "//")) nil) + ((member name '("" "/" "//" ".")) nil) + ;; Immediately test local filenames. If default-directory is + ;; remote, you probably already have a connection. + ((and (not abs) (ffap-file-exists-string name))) + ;; Try stripping off line numbers; good for compilation/grep output. + ((and (not abs) (string-match ":[0-9]" name) + (ffap-file-exists-string (substring name 0 (match-beginning 0))))) ;; Immediately test local filenames. If default-directory is ;; remote, you probably already have a connection. ((and (not abs) (ffap-file-exists-string name)))