comparison lisp/ffap.el @ 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 362c52acd51f
children 7e3e0c11f5b6
comparison
equal deleted inserted replaced
24311:c65bd0a4acfd 24312:24ffa91626d3
1098 (abs (file-name-absolute-p name)) 1098 (abs (file-name-absolute-p name))
1099 (default-directory default-directory)) 1099 (default-directory default-directory))
1100 (unwind-protect 1100 (unwind-protect
1101 (cond 1101 (cond
1102 ;; Immediate rejects (/ and // are too common in C++): 1102 ;; Immediate rejects (/ and // are too common in C++):
1103 ((member name '("" "/" "//")) nil) 1103 ((member name '("" "/" "//" ".")) nil)
1104 ;; Immediately test local filenames. If default-directory is
1105 ;; remote, you probably already have a connection.
1106 ((and (not abs) (ffap-file-exists-string name)))
1107 ;; Try stripping off line numbers; good for compilation/grep output.
1108 ((and (not abs) (string-match ":[0-9]" name)
1109 (ffap-file-exists-string (substring name 0 (match-beginning 0)))))
1104 ;; Immediately test local filenames. If default-directory is 1110 ;; Immediately test local filenames. If default-directory is
1105 ;; remote, you probably already have a connection. 1111 ;; remote, you probably already have a connection.
1106 ((and (not abs) (ffap-file-exists-string name))) 1112 ((and (not abs) (ffap-file-exists-string name)))
1107 ;; Accept remote names without actual checking (too slow): 1113 ;; Accept remote names without actual checking (too slow):
1108 ((if abs 1114 ((if abs