Hi Dear Developers,
Could you please help review this path?
Thanks,
FKtPp
lisp/ChangeLog addition:
2009-06-20 It's me FKtPp ;) <m_pupil(a)yahoo.com.cn>
* files.el (cd): Do not #'split-path on nil #'getenv result; Make
sure the cd-path value is a list.
core-beta[XEmacs] source patch:
Diff command: hg diff -wbB
Files affected: lisp/files.el
diff -r a90b63846dc4 lisp/files.el
--- lisp/files.el Sun Jun 07 16:47:04 2009 +0100
+++ lisp/files.el Sat Jun 20 22:50:52 2009 +0800
@@ -593,29 +593,33 @@
default-directory default-directory
(and (member cd-path '(nil ("./")))
(null (getenv "CDPATH"))))))
- (if (file-name-absolute-p dir)
- (cd-absolute (expand-file-name dir))
- ;; XEmacs change. I'm not sure respecting CDPATH is the right thing to
- ;; do under Windows.
- (unless (and cd-path (equal (getenv "CDPATH") cdpath-previous))
- (let ((trypath (split-path (setq cdpath-previous (getenv "CDPATH")))))
+
+ (let* ((cdpath-current (getenv "CDPATH"))
+ (trypath (if cdpath-current
+ (split-path (setq cdpath-previous cdpath-current))
+ nil))) ; null list
+ (if (file-name-absolute-p dir)
+ (cd-absolute (expand-file-name dir))
+ ;; XEmacs change. I'm not sure respecting CDPATH is the right thing to
+ ;; do under Windows.
+ (unless (and cd-path (equal cdpath-current cdpath-previous))
(setq cd-path (or (and trypath
(mapcar #'file-name-as-directory trypath))
- (file-name-as-directory "")))))
- (or (catch 'found
- (mapcar #'(lambda (x)
+ (list (file-name-as-directory "")))))
+ (or (catch 'found
+ (mapcar #'(lambda (x)
(let ((f (expand-file-name (concat x dir))))
(if (file-directory-p f)
(progn
(cd-absolute f)
(throw 'found t)))))
- cd-path)
- nil)
- ;; jwz: give a better error message to those of us with the
- ;; good taste not to use a kludge like $CDPATH.
- (if (equal cd-path '("./"))
- (error "No such directory: %s" (expand-file-name dir))
- (error "Directory not found in $CDPATH: %s" dir)))))
+ cd-path)
+ nil)
+ ;; jwz: give a better error message to those of us with the
+ ;; good taste not to use a kludge like $CDPATH.
+ (if (equal cd-path '("./"))
+ (error "No such directory: %s" (expand-file-name dir))
+ (error "Directory not found in $CDPATH: %s" dir))))))
(defun load-file (file)
"Load the Lisp file named FILE."
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta