aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-22 18:28:22 +0000
committerRichard M. Stallman1994-04-22 18:28:22 +0000
commit09a1077ce25adc5ac367a95ede0a93e45f8f03b5 (patch)
tree144efcdd87b9073eacfa305d9470edcfdcf20db6
parent3fadec1a1f304cf6b19bb9dfadd368958ea9c073 (diff)
downloademacs-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.el8
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
87processes `argi'. If it does so, it may consume successive arguments by 87processes `argi'. If it does so, it may consume successive arguments by
88altering `command-line-args-left' to remove them.") 88altering `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.
92This 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.
92The frame system uses this to open frames to display messages while 96The 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))