summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKai Großjohann <kgrossjo@eu.uu.net>2003-03-31 16:05:50 +0000
committerKai Großjohann <kgrossjo@eu.uu.net>2003-03-31 16:05:50 +0000
commit493c98af4a131762196371570254f92a8f046101 (patch)
tree771e938cc1504be8e49d0239e5616263cc318a87 /lisp
parent2217b8e1e67a18aec2c1693038d21a12b1d02f76 (diff)
downloademacs-493c98af4a131762196371570254f92a8f046101.tar.gz
emacs-493c98af4a131762196371570254f92a8f046101.tar.bz2
emacs-493c98af4a131762196371570254f92a8f046101.zip
(file-relative-name): Remove superfluous `and'.
Clarify docstring. From Lars Hansen.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/files.el45
2 files changed, 27 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fc5951f3558..4c9a207447f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-31 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
+
+ * files.el (file-relative-name): Remove superfluous `and'.
+ Clarify docstring. From Lars Hansen.
+
2003-03-31 Kenichi Handa <handa@etlken2>
* international/utf-16.el (ccl-decode-mule-utf-16-le): Don't
diff --git a/lisp/files.el b/lisp/files.el
index cb3da5717b9..037c37b6455 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2826,7 +2826,7 @@ Uses `backup-directory-alist' in the same way as does
This function returns a relative file name which is equivalent to FILENAME
when used with that default directory as the default.
If FILENAME and DIRECTORY lie on different machines or on different drives
-\(DOS/Windows), it returns FILENAME in expanded form."
+on a DOS/Windows machine, it returns FILENAME on expanded form."
(save-match-data
(setq directory
(file-name-as-directory (expand-file-name (or directory
@@ -2836,28 +2836,27 @@ If FILENAME and DIRECTORY lie on different machines or on different drives
(hd (find-file-name-handler directory 'file-local-copy)))
(when (and hf (not (get hf 'file-remote-p))) (setq hf nil))
(when (and hd (not (get hd 'file-remote-p))) (setq hd nil))
- (if (and
- ;; Conditions for separate trees
- (or
- ;; Test for different drives on DOS/Windows
- (and
- (memq system-type '(ms-dos cygwin windows-nt))
- (not (string-equal (substring filename 0 2)
- (substring directory 0 2))))
- ;; Test for different remote file handlers
- (not (eq hf hd))
- ;; Test for different remote file system identification
- (and
- hf
- (let ((re (car (rassq hf file-name-handler-alist))))
- (not
- (equal
- (and
- (string-match re filename)
- (substring filename 0 (match-end 0)))
- (and
- (string-match re directory)
- (substring directory 0 (match-end 0)))))))))
+ (if ;; Conditions for separate trees
+ (or
+ ;; Test for different drives on DOS/Windows
+ (and
+ (memq system-type '(ms-dos cygwin windows-nt))
+ (not (string-equal (substring filename 0 2)
+ (substring directory 0 2))))
+ ;; Test for different remote file handlers
+ (not (eq hf hd))
+ ;; Test for different remote file system identification
+ (and
+ hf
+ (let ((re (car (rassq hf file-name-handler-alist))))
+ (not
+ (equal
+ (and
+ (string-match re filename)
+ (substring filename 0 (match-end 0)))
+ (and
+ (string-match re directory)
+ (substring directory 0 (match-end 0))))))))
filename
(unless (eq (aref filename 0) ?/)
(setq filename (concat "/" filename)))