From 7e1626fbe828a35ad55f977b607200ed0e5ceeba Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Feb 2004 13:42:04 +0000 Subject: [PATCH] (ffap-file-at-point): Try parent directories. --- lisp/ChangeLog | 4 ++++ lisp/ffap.el | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2894f660197..72219c47da5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-02-21 Juri Linkov + + * ffap.el (ffap-file-at-point): Try parent directories. + 2004-02-21 Klaus Zeitler * vcursor.el (vcursor-modifiers): New defcustom. diff --git a/lisp/ffap.el b/lisp/ffap.el index 668700a5c1f..27abd52f563 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1185,6 +1185,14 @@ which may actually result in an url rather than a filename." 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)))) -- 2.39.2