]> git.eshelyaron.com Git - emacs.git/commitdiff
(ffap-file-at-point): Try parent directories.
authorEli Zaretskii <eliz@is.elta.co.il>
Sat, 21 Feb 2004 13:42:04 +0000 (13:42 +0000)
committerEli Zaretskii <eliz@is.elta.co.il>
Sat, 21 Feb 2004 13:42:04 +0000 (13:42 +0000)
lisp/ChangeLog
lisp/ffap.el

index 2894f660197d51da1dfc368c00c69513efbd900e..72219c47da5b40ed7fb296376cc40243937d17d2 100644 (file)
@@ -1,3 +1,7 @@
+2004-02-21  Juri Linkov  <juri@jurta.org>
+
+       * ffap.el (ffap-file-at-point): Try parent directories.
+
 2004-02-21  Klaus Zeitler  <kzeitler@lucent.com>
 
        * vcursor.el (vcursor-modifiers): New defcustom.
index 668700a5c1f23d57eaa547a2e19bff0e48c8e2a3..27abd52f5630f49b7d4ee630d83879ffe9c855e6 100644 (file)
@@ -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))))
 \f