aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1999-02-13 16:28:34 +0000
committerRichard M. Stallman1999-02-13 16:28:34 +0000
commit8005ea3f215d3c37621b9b89ebfe7f06d0f5f0ae (patch)
treeffd2f62fea84e1513d118a33c919983e7109b188
parent118069b3b08d386e51edab6a1df1c0b0b1865a59 (diff)
downloademacs-8005ea3f215d3c37621b9b89ebfe7f06d0f5f0ae.tar.gz
emacs-8005ea3f215d3c37621b9b89ebfe7f06d0f5f0ae.zip
(ffap-file-at-point): Test local file names
immediately. Strip off line numbers.
-rw-r--r--lisp/ffap.el8
1 files changed, 7 insertions, 1 deletions
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."
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)))