# HG changeset patch # User Eli Zaretskii # Date 1077370864 0 # Node ID 9aa83ff74ef096164a73145fd5b1adab3a321296 # Parent 10f8365e0cf4415518f0c270d3f961ab2061aa41 (ffap-file-at-point): Try parent directories. diff -r 10f8365e0cf4 -r 9aa83ff74ef0 lisp/ffap.el --- 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))))