diff options
| author | Glenn Morris | 2007-04-07 02:58:53 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-04-07 02:58:53 +0000 |
| commit | d35829ffc5c9d1f6759c1575ac511efb48075b56 (patch) | |
| tree | c3d9900721f7098a26b8fc4471e3760a4a6bbdd9 | |
| parent | f11b91069981ef5d769d11409340c03abb85fc46 (diff) | |
| download | emacs-d35829ffc5c9d1f6759c1575ac511efb48075b56.tar.gz emacs-d35829ffc5c9d1f6759c1575ac511efb48075b56.zip | |
(ffap-file-at-point): Lower the priority of the
ffap-ftp-sans-slash-regexp check.
| -rw-r--r-- | lisp/ffap.el | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el index e49c77f4d47..5bba729fce3 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -1147,7 +1147,8 @@ which may actually result in an url rather than a filename." | |||
| 1147 | (error nil)) | 1147 | (error nil)) |
| 1148 | string)) | 1148 | string)) |
| 1149 | (abs (file-name-absolute-p name)) | 1149 | (abs (file-name-absolute-p name)) |
| 1150 | (default-directory default-directory)) | 1150 | (default-directory default-directory) |
| 1151 | (oname name)) | ||
| 1151 | (unwind-protect | 1152 | (unwind-protect |
| 1152 | (cond | 1153 | (cond |
| 1153 | ;; Immediate rejects (/ and // and /* are too common in C/C++): | 1154 | ;; Immediate rejects (/ and // and /* are too common in C/C++): |
| @@ -1164,13 +1165,7 @@ which may actually result in an url rather than a filename." | |||
| 1164 | (not abs) (string-match ffap-shell-prompt-regexp name) | 1165 | (not abs) (string-match ffap-shell-prompt-regexp name) |
| 1165 | (ffap-file-exists-string (substring name (match-end 0))))) | 1166 | (ffap-file-exists-string (substring name (match-end 0))))) |
| 1166 | ;; Accept remote names without actual checking (too slow): | 1167 | ;; Accept remote names without actual checking (too slow): |
| 1167 | ((if abs | 1168 | ((and abs (ffap-file-remote-p name))) |
| 1168 | (ffap-file-remote-p name) | ||
| 1169 | ;; Try adding a leading "/" (common omission in ftp file names): | ||
| 1170 | (and | ||
| 1171 | ffap-ftp-sans-slash-regexp | ||
| 1172 | (string-match ffap-ftp-sans-slash-regexp name) | ||
| 1173 | (ffap-file-remote-p (concat "/" name))))) | ||
| 1174 | ;; Ok, not remote, try the existence test even if it is absolute: | 1169 | ;; Ok, not remote, try the existence test even if it is absolute: |
| 1175 | ((and abs (ffap-file-exists-string name))) | 1170 | ((and abs (ffap-file-exists-string name))) |
| 1176 | ;; If it contains a colon, get rid of it (and return if exists) | 1171 | ;; If it contains a colon, get rid of it (and return if exists) |
| @@ -1193,6 +1188,14 @@ which may actually result in an url rather than a filename." | |||
| 1193 | (ffap-file-remote-p try) | 1188 | (ffap-file-remote-p try) |
| 1194 | (ffap-file-exists-string try)))))) | 1189 | (ffap-file-exists-string try)))))) |
| 1195 | try)) | 1190 | try)) |
| 1191 | ;; Try adding a leading "/" (common omission in ftp file names). | ||
| 1192 | ;; Note that this uses oname, which still has any colon part. | ||
| 1193 | ;; This should have a lower priority than the alist stuff, | ||
| 1194 | ;; else it matches things like "ffap.el:1234:56:Warning". | ||
| 1195 | ((and (not abs) | ||
| 1196 | ffap-ftp-sans-slash-regexp | ||
| 1197 | (string-match ffap-ftp-sans-slash-regexp oname) | ||
| 1198 | (ffap-file-remote-p (concat "/" oname)))) | ||
| 1196 | ;; Alist failed? Try to guess an active remote connection | 1199 | ;; Alist failed? Try to guess an active remote connection |
| 1197 | ;; from buffer variables, and try once more, both as an | 1200 | ;; from buffer variables, and try once more, both as an |
| 1198 | ;; absolute and relative file name on that remote host. | 1201 | ;; absolute and relative file name on that remote host. |