[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el
From: |
Daniel Pfeiffer |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el |
Date: |
Wed, 20 Oct 2004 18:45:07 -0400 |
Index: emacs/lisp/progmodes/compile.el
diff -c emacs/lisp/progmodes/compile.el:1.333
emacs/lisp/progmodes/compile.el:1.334
*** emacs/lisp/progmodes/compile.el:1.333 Tue Oct 19 16:48:30 2004
--- emacs/lisp/progmodes/compile.el Wed Oct 20 22:30:34 2004
***************
*** 866,875 ****
(if (eq mode t)
(prog1 "compilation" (require 'comint))
(replace-regexp-in-string "-mode$" "" (symbol-name mode))))
! cd-path ; in case process-environment contains CDPATH
! (thisdir (if (string-match "^\\s *cd\\s +\\(.+?\\)\\s *[;&\n]" command)
! (substitute-in-file-name (match-string 1 command))
! default-directory))
outwin outbuf)
(with-current-buffer
(setq outbuf
--- 866,872 ----
(if (eq mode t)
(prog1 "compilation" (require 'comint))
(replace-regexp-in-string "-mode$" "" (symbol-name mode))))
! (thisdir default-directory)
outwin outbuf)
(with-current-buffer
(setq outbuf
***************
*** 890,906 ****
(error "Cannot have two processes in `%s' at once"
(buffer-name)))))
(buffer-disable-undo (current-buffer))
;; Make compilation buffer read-only. The filter can still write it.
;; Clear out the compilation buffer.
! (let ((inhibit-read-only t))
(erase-buffer)
- ;; Change its default-directory to the directory where the compilation
- ;; will happen, and insert a `cd' command to indicate this.
- (setq default-directory thisdir)
;; output a mode setter, for saving and later reloading this buffer
(insert "-*- mode: " name-of-mode
"; default-directory: " (prin1-to-string default-directory)
! " -*-\n" command "\n"))
(set-buffer-modified-p nil))
;; If we're already in the compilation buffer, go to the end
;; of the buffer, so point will track the compilation output.
--- 887,911 ----
(error "Cannot have two processes in `%s' at once"
(buffer-name)))))
(buffer-disable-undo (current-buffer))
+ ;; first transfer directory from where M-x compile was called
+ (setq default-directory thisdir)
;; Make compilation buffer read-only. The filter can still write it.
;; Clear out the compilation buffer.
! (let ((inhibit-read-only t)
! (default-directory thisdir))
! ;; Then evaluate a cd command if any, but don't perform it yet, else
start-command
! ;; would do it again through the shell: (cd "..") AND sh -c "cd ..;
make"
! (cd (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]"
command)
! (if (match-end 1)
! (match-string 1 command)
! "~")
! default-directory))
(erase-buffer)
;; output a mode setter, for saving and later reloading this buffer
(insert "-*- mode: " name-of-mode
"; default-directory: " (prin1-to-string default-directory)
! " -*-\n" command "\n")
! (setq thisdir default-directory))
(set-buffer-modified-p nil))
;; If we're already in the compilation buffer, go to the end
;; of the buffer, so point will track the compilation output.
***************
*** 985,991 ****
;; fontified, so fontify it now.
(let ((font-lock-verbose nil)) ; shut up font-lock messages
(font-lock-fontify-buffer))
! (message "Executing `%s'...done" command))))
(if (buffer-local-value 'compilation-scroll-output outbuf)
(save-selected-window
(select-window outwin)
--- 990,998 ----
;; fontified, so fontify it now.
(let ((font-lock-verbose nil)) ; shut up font-lock messages
(font-lock-fontify-buffer))
! (message "Executing `%s'...done" command)))
! ;; Now finally cd to where the shell started make/grep/...
! (setq default-directory thisdir))
(if (buffer-local-value 'compilation-scroll-output outbuf)
(save-selected-window
(select-window outwin)