diff options
| author | Stefan Monnier | 2004-08-20 22:40:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-08-20 22:40:34 +0000 |
| commit | fcaf7de969a4e3556e184640911efb8e4a8dc874 (patch) | |
| tree | 97a12450c46ebe9167065372f4e5297897d19039 | |
| parent | 88b4ca188b176d79d4a03f4f81fcc3d0af86e8ff (diff) | |
| download | emacs-fcaf7de969a4e3556e184640911efb8e4a8dc874.tar.gz emacs-fcaf7de969a4e3556e184640911efb8e4a8dc874.zip | |
(normal-top-level-add-subdirs-to-load-path):
Avoid unnecessarily checking system-type.
(normal-top-level): Set TERM to "dumb". Simplify.
| -rw-r--r-- | lisp/startup.el | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 2f0ca4b2c19..c1b25b1867d 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -220,7 +220,7 @@ Setting `init-file-user' does not prevent Emacs from loading | |||
| 220 | "File containing site-wide run-time initializations. | 220 | "File containing site-wide run-time initializations. |
| 221 | This file is loaded at run-time before `~/.emacs'. It contains inits | 221 | This file is loaded at run-time before `~/.emacs'. It contains inits |
| 222 | that need to be in place for the entire site, but which, due to their | 222 | that need to be in place for the entire site, but which, due to their |
| 223 | higher incidence of change, don't make sense to load into emacs' | 223 | higher incidence of change, don't make sense to load into Emacs's |
| 224 | dumped image. Thus, the run-time load order is: 1. file described in | 224 | dumped image. Thus, the run-time load order is: 1. file described in |
| 225 | this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'. | 225 | this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'. |
| 226 | 226 | ||
| @@ -293,8 +293,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 293 | (let* ((this-dir (car dirs)) | 293 | (let* ((this-dir (car dirs)) |
| 294 | (contents (directory-files this-dir)) | 294 | (contents (directory-files this-dir)) |
| 295 | (default-directory this-dir) | 295 | (default-directory this-dir) |
| 296 | (canonicalized (and (eq system-type 'windows-nt) | 296 | (canonicalized (if (fboundp 'untranslated-canonical-name) |
| 297 | (untranslated-canonical-name this-dir)))) | 297 | (untranslated-canonical-name this-dir)))) |
| 298 | ;; The Windows version doesn't report meaningful inode | 298 | ;; The Windows version doesn't report meaningful inode |
| 299 | ;; numbers, so use the canonicalized absolute file name of the | 299 | ;; numbers, so use the canonicalized absolute file name of the |
| 300 | ;; directory instead. | 300 | ;; directory instead. |
| @@ -343,12 +343,14 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 343 | ;; Give *Messages* the same default-directory as *scratch*, | 343 | ;; Give *Messages* the same default-directory as *scratch*, |
| 344 | ;; just to keep things predictable. | 344 | ;; just to keep things predictable. |
| 345 | (let ((dir default-directory)) | 345 | (let ((dir default-directory)) |
| 346 | (save-excursion | 346 | (with-current-buffer "*Messages*" |
| 347 | (set-buffer (get-buffer "*Messages*")) | ||
| 348 | (setq default-directory dir))) | 347 | (setq default-directory dir))) |
| 349 | ;; `user-full-name' is now known; reset its standard-value here. | 348 | ;; `user-full-name' is now known; reset its standard-value here. |
| 350 | (put 'user-full-name 'standard-value | 349 | (put 'user-full-name 'standard-value |
| 351 | (list (default-value 'user-full-name))) | 350 | (list (default-value 'user-full-name))) |
| 351 | ;; Subprocesses of Emacs do not have direct access to the terminal, | ||
| 352 | ;; so unless told otherwise they should only assume a dumb terminal. | ||
| 353 | (setenv "TERM" "dumb") | ||
| 352 | ;; For root, preserve owner and group when editing files. | 354 | ;; For root, preserve owner and group when editing files. |
| 353 | (if (equal (user-uid) 0) | 355 | (if (equal (user-uid) 0) |
| 354 | (setq backup-by-copying-when-mismatch t)) | 356 | (setq backup-by-copying-when-mismatch t)) |
| @@ -357,32 +359,25 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 357 | ;; of that dir into load-path, | 359 | ;; of that dir into load-path, |
| 358 | ;; Look for a leim-list.el file too. Loading it will register | 360 | ;; Look for a leim-list.el file too. Loading it will register |
| 359 | ;; available input methods. | 361 | ;; available input methods. |
| 360 | (let ((tail load-path) | 362 | (dolist (dir load-path) |
| 361 | new) | 363 | (let ((default-directory dir)) |
| 362 | (while tail | 364 | (load (expand-file-name "subdirs.el") t t t)) |
| 363 | (push (car tail) new) | 365 | (let ((default-directory dir)) |
| 364 | (condition-case nil | 366 | (load (expand-file-name "leim-list.el") t t t))) |
| 365 | (let ((default-directory (car tail))) | 367 | (unless (eq system-type 'vax-vms) |
| 366 | (load (expand-file-name "subdirs.el" (car tail)) t t t))) | 368 | ;; If the PWD environment variable isn't accurate, delete it. |
| 367 | (condition-case nil | 369 | (let ((pwd (getenv "PWD"))) |
| 368 | (let ((default-directory (car tail))) | 370 | (and (stringp pwd) |
| 369 | (load (expand-file-name "leim-list.el" (car tail)) t t t))) | 371 | ;; Use FOO/., so that if FOO is a symlink, file-attributes |
| 370 | (setq tail (cdr tail)))) | 372 | ;; describes the directory linked to, not FOO itself. |
| 371 | (if (not (eq system-type 'vax-vms)) | 373 | (or (equal (file-attributes |
| 372 | (progn | 374 | (concat (file-name-as-directory pwd) ".")) |
| 373 | ;; If the PWD environment variable isn't accurate, delete it. | 375 | (file-attributes |
| 374 | (let ((pwd (getenv "PWD"))) | 376 | (concat (file-name-as-directory default-directory) |
| 375 | (and (stringp pwd) | 377 | "."))) |
| 376 | ;; Use FOO/., so that if FOO is a symlink, file-attributes | 378 | (setq process-environment |
| 377 | ;; describes the directory linked to, not FOO itself. | 379 | (delete (concat "PWD=" pwd) |
| 378 | (or (equal (file-attributes | 380 | process-environment)))))) |
| 379 | (concat (file-name-as-directory pwd) ".")) | ||
| 380 | (file-attributes | ||
| 381 | (concat (file-name-as-directory default-directory) | ||
| 382 | "."))) | ||
| 383 | (setq process-environment | ||
| 384 | (delete (concat "PWD=" pwd) | ||
| 385 | process-environment))))))) | ||
| 386 | (setq default-directory (abbreviate-file-name default-directory)) | 381 | (setq default-directory (abbreviate-file-name default-directory)) |
| 387 | (let ((menubar-bindings-done nil)) | 382 | (let ((menubar-bindings-done nil)) |
| 388 | (unwind-protect | 383 | (unwind-protect |