* lisp/dired.el (dired-make-relative): Make change less aggressive.
This commit is contained in:
parent
6edb676c18
commit
17d0f61c80
1 changed files with 5 additions and 1 deletions
|
@ -2953,7 +2953,11 @@ Optional arg GLOBAL means to replace all matches."
|
|||
If DIR is omitted or nil, it defaults to `default-directory'.
|
||||
If FILE is not in the directory tree of DIR, return FILE
|
||||
unchanged."
|
||||
(setq dir (expand-file-name (or dir default-directory)))
|
||||
(or dir (setq dir default-directory))
|
||||
;; This case comes into play if default-directory is set to
|
||||
;; use ~.
|
||||
(if (string-match-p "\\(\\`\\|:\\)~" dir)
|
||||
(setq dir (expand-file-name dir)))
|
||||
(if (string-match (concat "^" (regexp-quote dir)) file)
|
||||
(substring file (match-end 0))
|
||||
file))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue