diff options
| author | Richard M. Stallman | 1996-12-31 18:29:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-31 18:29:49 +0000 |
| commit | 827dc60de5855094b96c2729cd5572d2425757f0 (patch) | |
| tree | 719a0b884fa2ba8f529490c87dda3c651d888806 | |
| parent | c9ab42e191ecb12b0c11feef9fcc4c5b55e54f5b (diff) | |
| download | emacs-827dc60de5855094b96c2729cd5572d2425757f0.tar.gz emacs-827dc60de5855094b96c2729cd5572d2425757f0.zip | |
(dired-make-relative): Ignore the third argument;
never signal an error just bbcause FILE is not in DIR's tree.
| -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." | |||
| 1277 | ;; dired-get-filename. | 1277 | ;; dired-get-filename. |
| 1278 | (concat (or dir default-directory) file)) | 1278 | (concat (or dir default-directory) file)) |
| 1279 | 1279 | ||
| 1280 | (defun dired-make-relative (file &optional dir no-error) | 1280 | (defun dired-make-relative (file &optional dir ignore) |
| 1281 | ;;"Convert FILE (an absolute file name) to a name relative to DIR. | 1281 | "Convert FILE (an absolute file name) to a name relative to DIR. |
| 1282 | ;; Else error (unless NO-ERROR is non-nil, then FILE is returned unchanged) | 1282 | If this is impossible, return FILE unchanged. |
| 1283 | ;;DIR defaults to default-directory." | 1283 | DIR must be a directory name, not a file name." |
| 1284 | ;; DIR must be file-name-as-directory, as with all directory args in | ||
| 1285 | ;; Emacs Lisp code. | ||
| 1286 | (or dir (setq dir default-directory)) | 1284 | (or dir (setq dir default-directory)) |
| 1287 | ;; This case comes into play if default-directory is set to | 1285 | ;; This case comes into play if default-directory is set to |
| 1288 | ;; use ~. | 1286 | ;; use ~. |
| @@ -1290,9 +1288,9 @@ Optional arg GLOBAL means to replace all matches." | |||
| 1290 | (setq dir (expand-file-name dir))) | 1288 | (setq dir (expand-file-name dir))) |
| 1291 | (if (string-match (concat "^" (regexp-quote dir)) file) | 1289 | (if (string-match (concat "^" (regexp-quote dir)) file) |
| 1292 | (substring file (match-end 0)) | 1290 | (substring file (match-end 0)) |
| 1293 | (if no-error | 1291 | ;;; (or no-error |
| 1294 | file | 1292 | ;;; (error "%s: not in directory tree growing at %s" file dir)) |
| 1295 | (error "%s: not in directory tree growing at %s" file dir)))) | 1293 | file)) |
| 1296 | 1294 | ||
| 1297 | ;;; Functions for finding the file name in a dired buffer line. | 1295 | ;;; Functions for finding the file name in a dired buffer line. |
| 1298 | 1296 | ||