diff lisp/ffap.el @ 54106:9aa83ff74ef0

(ffap-file-at-point): Try parent directories.
author Eli Zaretskii <eliz@is.elta.co.il>
date Sat, 21 Feb 2004 13:41:04 +0000
parents 89450ca4c47e
children b91c8ab75b81
line wrap: on
line diff
--- a/lisp/ffap.el	Sat Feb 21 13:37:46 2004 +0000
+++ b/lisp/ffap.el	Sat Feb 21 13:41:04 2004 +0000
@@ -1185,6 +1185,14 @@
 			 remote-dir (substring name (match-end 1)))))
 		  (ffap-file-exists-string
 		   (ffap-replace-file-component remote-dir name))))))
+         ;; Try all parent directories by deleting the trailing directory
+         ;; name until existing directory is found or name stops changing
+         ((let ((dir name))
+            (while (and dir
+                        (not (ffap-file-exists-string dir))
+                        (not (equal dir (setq dir (file-name-directory
+                                                   (directory-file-name dir)))))))
+            (ffap-file-exists-string dir)))
 	 )
       (set-match-data data))))