diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-12-31 18:29:49 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-12-31 18:29:49 +0000 |
commit | d0789219cce36317b4027016f360d2c9bddfd3b3 (patch) | |
tree | 015655a3ce711f46f18b704835e1c624f88c6ebf /lisp/dired.el | |
parent | 747169de456040f34e9a7969f9c4721c31728a9d (diff) | |
download | emacs-d0789219cce36317b4027016f360d2c9bddfd3b3.tar.gz |
(dired-make-relative): Ignore the third argument;
never signal an error just bbcause FILE is not in DIR's tree.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r-- | lisp/dired.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index c45ba1b2ab1..04f8cd00dfa 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1277,12 +1277,10 @@ Optional arg GLOBAL means to replace all matches." ;; dired-get-filename. (concat (or dir default-directory) file)) -(defun dired-make-relative (file &optional dir no-error) - ;;"Convert FILE (an absolute file name) to a name relative to DIR. - ;; Else error (unless NO-ERROR is non-nil, then FILE is returned unchanged) - ;;DIR defaults to default-directory." - ;; DIR must be file-name-as-directory, as with all directory args in - ;; Emacs Lisp code. +(defun dired-make-relative (file &optional dir ignore) + "Convert FILE (an absolute file name) to a name relative to DIR. +If this is impossible, return FILE unchanged. +DIR must be a directory name, not a file name." (or dir (setq dir default-directory)) ;; This case comes into play if default-directory is set to ;; use ~. @@ -1290,9 +1288,9 @@ Optional arg GLOBAL means to replace all matches." (setq dir (expand-file-name dir))) (if (string-match (concat "^" (regexp-quote dir)) file) (substring file (match-end 0)) - (if no-error - file - (error "%s: not in directory tree growing at %s" file dir)))) +;;; (or no-error +;;; (error "%s: not in directory tree growing at %s" file dir)) + file)) ;;; Functions for finding the file name in a dired buffer line. |