1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-24 10:38:38 +00:00

(ffap-file-at-point): Try parent directories.

This commit is contained in:
Eli Zaretskii 2004-02-21 13:42:04 +00:00
parent 69e82404c0
commit 7e1626fbe8
2 changed files with 12 additions and 0 deletions

View 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.

View 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))))