Dear Developers,
Here's my patch for the #'cd problem.. Wish it be helpful~
Thanks,
FKtPp
lisp/ChangeLog addition:
2009-06-20 It's me FKtPp ;) <m_pupil(a)yahoo.com.cn>
* files.el (cd): First, #'split-path may fail with wrong type of argument
error stringp nil, if 'cd-path 'cdpath-previrus and (getenv
"CDPATH") were all nil; Second, cd-path was expect to be a list,
not a string; Third, there's only one #'getenv call now.
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 00:16:43 2009 +0800
@@ -587,35 +587,38 @@
"Make DIR become the current buffer's default directory.
If your environment includes a `CDPATH' variable, try each one of that
colon-separated list of directories when resolving a relative directory name."
- (interactive
- ;; XEmacs change? (read-file-name => read-directory-name)
- (list (read-directory-name "Change default directory: "
- 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")))))
- (setq cd-path (or (and trypath
- (mapcar #'file-name-as-directory trypath))
- (file-name-as-directory "")))))
- (or (catch 'found
- (mapcar #'(lambda (x)
+ (let ((cdpath-current (getenv "CDPATH")))
+ (interactive
+ ;; XEmacs change? (read-file-name => read-directory-name)
+ (list (read-directory-name "Change default directory: "
+ default-directory default-directory
+ (and (member cd-path '(nil ("./")))
+ (null cdpath-current)))))
+ (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))
+ (let ((trypath (if cdpath-current
+ (split-path (setq cdpath-previous cdpath-current))
+ nil)))
+ (setq cd-path (or (and trypath
+ (mapcar #'file-name-as-directory trypath))
+ (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