# HG changeset patch # User Jim Blandy # Date 721117215 0 # Node ID a7e915481db1dab35c84d8a98af6d302bdcf53da # Parent 816bfa18567121892559e655906f4391af9f15a5 * startup.el (normal-top-level): Don't worry about setting default-directory to PWD if PWD is shorter. And, if PWD isn't accurate, delete it. diff -r 816bfa185671 -r a7e915481db1 lisp/startup.el --- a/lisp/startup.el Sat Nov 07 06:17:04 1992 +0000 +++ b/lisp/startup.el Sat Nov 07 06:20:15 1992 +0000 @@ -126,18 +126,21 @@ (if command-line-processed (message "Back to top level.") (setq command-line-processed t) - ;; In presence of symlinks, switch to cleaner form of default directory. (if (not (eq system-type 'vax-vms)) - (mapcar (function - (lambda (var) - (let ((value (getenv var))) - (if (and value - (< (length value) (length default-directory)) - (equal (file-attributes default-directory) - (file-attributes value))) - (setq default-directory - (file-name-as-directory value)))))) - '("PWD" "HOME"))) + (progn + ;; If the PWD environment variable isn't accurate, delete it. + (let ((pwd (getenv "PWD"))) + (and (stringp pwd) + ;; Use FOO/., so that if FOO is a symlink, file-attributes + ;; describes the directory linked to, not FOO itself. + (or (equal (file-attributes + (concat (file-name-as-directory pwd) ".")) + (file-attributes + (concat (file-name-as-directory default-directory) + "."))) + (setq process-environment + (delete (concat "PWD=" pwd) + process-environment))))))) (setq default-directory (abbreviate-file-name default-directory)) (unwind-protect (command-line)