diff options
| author | Richard M. Stallman | 1994-04-22 18:28:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-22 18:28:22 +0000 |
| commit | 09a1077ce25adc5ac367a95ede0a93e45f8f03b5 (patch) | |
| tree | 144efcdd87b9073eacfa305d9470edcfdcf20db6 | |
| parent | 3fadec1a1f304cf6b19bb9dfadd368958ea9c073 (diff) | |
| download | emacs-09a1077ce25adc5ac367a95ede0a93e45f8f03b5.tar.gz emacs-09a1077ce25adc5ac367a95ede0a93e45f8f03b5.zip | |
(command-line-default-directory): New variable.
(command-line, command-line-1): Use and set it.
| -rw-r--r-- | lisp/startup.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 6322cef428a..c5f131e0814 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -87,6 +87,10 @@ arguments). The function should return non-nil only if it recognizes and | |||
| 87 | processes `argi'. If it does so, it may consume successive arguments by | 87 | processes `argi'. If it does so, it may consume successive arguments by |
| 88 | altering `command-line-args-left' to remove them.") | 88 | altering `command-line-args-left' to remove them.") |
| 89 | 89 | ||
| 90 | (defvar command-line-default-directory nil | ||
| 91 | "Default directory to use for command line arguments. | ||
| 92 | This is normally copied from `default-directory' when Emacs starts.") | ||
| 93 | |||
| 90 | (defvar before-init-hook nil | 94 | (defvar before-init-hook nil |
| 91 | "Functions to call after handling urgent options but before init files. | 95 | "Functions to call after handling urgent options but before init files. |
| 92 | The frame system uses this to open frames to display messages while | 96 | The frame system uses this to open frames to display messages while |
| @@ -177,6 +181,8 @@ this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.") | |||
| 177 | (run-hooks 'window-setup-hook))))) | 181 | (run-hooks 'window-setup-hook))))) |
| 178 | 182 | ||
| 179 | (defun command-line () | 183 | (defun command-line () |
| 184 | (setq command-line-default-directory default-directory) | ||
| 185 | |||
| 180 | ;; See if we should import version-control from the environment variable. | 186 | ;; See if we should import version-control from the environment variable. |
| 181 | (let ((vc (getenv "VERSION_CONTROL"))) | 187 | (let ((vc (getenv "VERSION_CONTROL"))) |
| 182 | (cond ((eq vc nil)) ;don't do anything if not set | 188 | (cond ((eq vc nil)) ;don't do anything if not set |
| @@ -423,7 +429,7 @@ Type \\[describe-distribution] for information on getting the latest version.")) | |||
| 423 | (set-buffer (get-buffer "*scratch*")) | 429 | (set-buffer (get-buffer "*scratch*")) |
| 424 | (erase-buffer) | 430 | (erase-buffer) |
| 425 | (set-buffer-modified-p nil))))) | 431 | (set-buffer-modified-p nil))))) |
| 426 | (let ((dir default-directory) | 432 | (let ((dir command-line-default-directory) |
| 427 | (file-count 0) | 433 | (file-count 0) |
| 428 | first-file-buffer | 434 | first-file-buffer |
| 429 | (line 0)) | 435 | (line 0)) |