changeset 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 10f8365e0cf4
children 2b492a8fc6ba
files lisp/ffap.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
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))))