changeset 24312:24ffa91626d3

(ffap-file-at-point): Test local file names immediately. Strip off line numbers.
author Richard M. Stallman <rms@gnu.org>
date Sat, 13 Feb 1999 16:28:34 +0000
parents c65bd0a4acfd
children a9e60ce7973e
files lisp/ffap.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ffap.el	Sat Feb 13 13:38:17 1999 +0000
+++ b/lisp/ffap.el	Sat Feb 13 16:28:34 1999 +0000
@@ -1100,7 +1100,13 @@
     (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)))