Mercurial > emacs
comparison lisp/startup.el @ 1558:a7e915481db1
* 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.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sat, 07 Nov 1992 06:20:15 +0000 |
parents | 279b5a572def |
children | 844e027dc6db |
comparison
equal
deleted
inserted
replaced
1557:816bfa185671 | 1558:a7e915481db1 |
---|---|
124 | 124 |
125 (defun normal-top-level () | 125 (defun normal-top-level () |
126 (if command-line-processed | 126 (if command-line-processed |
127 (message "Back to top level.") | 127 (message "Back to top level.") |
128 (setq command-line-processed t) | 128 (setq command-line-processed t) |
129 ;; In presence of symlinks, switch to cleaner form of default directory. | |
130 (if (not (eq system-type 'vax-vms)) | 129 (if (not (eq system-type 'vax-vms)) |
131 (mapcar (function | 130 (progn |
132 (lambda (var) | 131 ;; If the PWD environment variable isn't accurate, delete it. |
133 (let ((value (getenv var))) | 132 (let ((pwd (getenv "PWD"))) |
134 (if (and value | 133 (and (stringp pwd) |
135 (< (length value) (length default-directory)) | 134 ;; Use FOO/., so that if FOO is a symlink, file-attributes |
136 (equal (file-attributes default-directory) | 135 ;; describes the directory linked to, not FOO itself. |
137 (file-attributes value))) | 136 (or (equal (file-attributes |
138 (setq default-directory | 137 (concat (file-name-as-directory pwd) ".")) |
139 (file-name-as-directory value)))))) | 138 (file-attributes |
140 '("PWD" "HOME"))) | 139 (concat (file-name-as-directory default-directory) |
140 "."))) | |
141 (setq process-environment | |
142 (delete (concat "PWD=" pwd) | |
143 process-environment))))))) | |
141 (setq default-directory (abbreviate-file-name default-directory)) | 144 (setq default-directory (abbreviate-file-name default-directory)) |
142 (unwind-protect | 145 (unwind-protect |
143 (command-line) | 146 (command-line) |
144 (run-hooks 'emacs-startup-hook) | 147 (run-hooks 'emacs-startup-hook) |
145 (and term-setup-hook | 148 (and term-setup-hook |