diff options
| author | Stefan Monnier | 2007-07-20 18:54:57 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-07-20 18:54:57 +0000 |
| commit | 091525d5d7077bb6e955874d15d943fe43dfacd4 (patch) | |
| tree | 027fff7f5f9e3297524c40c8203925de385122a8 | |
| parent | d7927b9f487e83cffbb1e051d7b0f2b1f2a4b985 (diff) | |
| download | emacs-091525d5d7077bb6e955874d15d943fe43dfacd4.tar.gz emacs-091525d5d7077bb6e955874d15d943fe43dfacd4.zip | |
(compilation-start): Remember the original directory in a buffer-local
compilation-directory.
(compile): Set the global value of compilation-directory.
(recompile): Use compilation-directory even if run from the compilation buffer.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c7f71d5cfc5..8ce759c5e30 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-07-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/compile.el (compilation-start): Remember the original | ||
| 4 | directory in a buffer-local compilation-directory. | ||
| 5 | (compile): Set the global value of compilation-directory. | ||
| 6 | (recompile): Use compilation-directory even in the compilation buffer. | ||
| 7 | |||
| 1 | 2007-07-20 Dan Nicolaescu <dann@ics.uci.edu> | 8 | 2007-07-20 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 9 | ||
| 3 | * vc-hg.el (vc-hg-diff): Use vc-hg-command. | 10 | * vc-hg.el (vc-hg-diff): Use vc-hg-command. |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 94def936fb9..a7535cd523a 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -934,7 +934,7 @@ to a function that generates a unique name." | |||
| 934 | (unless (equal command (eval compile-command)) | 934 | (unless (equal command (eval compile-command)) |
| 935 | (setq compile-command command)) | 935 | (setq compile-command command)) |
| 936 | (save-some-buffers (not compilation-ask-about-save) nil) | 936 | (save-some-buffers (not compilation-ask-about-save) nil) |
| 937 | (setq compilation-directory default-directory) | 937 | (setq-default compilation-directory default-directory) |
| 938 | (compilation-start command comint)) | 938 | (compilation-start command comint)) |
| 939 | 939 | ||
| 940 | ;; run compile with the default command line | 940 | ;; run compile with the default command line |
| @@ -944,10 +944,7 @@ If this is run in a Compilation mode buffer, re-use the arguments from the | |||
| 944 | original use. Otherwise, recompile using `compile-command'." | 944 | original use. Otherwise, recompile using `compile-command'." |
| 945 | (interactive) | 945 | (interactive) |
| 946 | (save-some-buffers (not compilation-ask-about-save) nil) | 946 | (save-some-buffers (not compilation-ask-about-save) nil) |
| 947 | (let ((default-directory | 947 | (let ((default-directory (or compilation-directory default-directory))) |
| 948 | (or (and (not (eq major-mode (nth 1 compilation-arguments))) | ||
| 949 | compilation-directory) | ||
| 950 | default-directory))) | ||
| 951 | (apply 'compilation-start (or compilation-arguments | 948 | (apply 'compilation-start (or compilation-arguments |
| 952 | `(,(eval compile-command)))))) | 949 | `(,(eval compile-command)))))) |
| 953 | 950 | ||
| @@ -1042,6 +1039,10 @@ Returns the compilation buffer created." | |||
| 1042 | (buffer-disable-undo (current-buffer)) | 1039 | (buffer-disable-undo (current-buffer)) |
| 1043 | ;; first transfer directory from where M-x compile was called | 1040 | ;; first transfer directory from where M-x compile was called |
| 1044 | (setq default-directory thisdir) | 1041 | (setq default-directory thisdir) |
| 1042 | ;; Remember the original dir, so we can use it when we recompile. | ||
| 1043 | ;; default-directory' can't be used reliably for that because it may be | ||
| 1044 | ;; affected by the special handling of "cd ...;". | ||
| 1045 | (set (make-local-variable 'compilation-directory) thisdir) | ||
| 1045 | ;; Make compilation buffer read-only. The filter can still write it. | 1046 | ;; Make compilation buffer read-only. The filter can still write it. |
| 1046 | ;; Clear out the compilation buffer. | 1047 | ;; Clear out the compilation buffer. |
| 1047 | (let ((inhibit-read-only t) | 1048 | (let ((inhibit-read-only t) |