emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el [emacs-unicode-


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el [emacs-unicode-2]
Date: Wed, 15 Sep 2004 05:23:34 -0400

Index: emacs/lisp/progmodes/compile.el
diff -c emacs/lisp/progmodes/compile.el:1.276.2.5 
emacs/lisp/progmodes/compile.el:1.276.2.6
*** emacs/lisp/progmodes/compile.el:1.276.2.5   Thu Sep  9 09:36:33 2004
--- emacs/lisp/progmodes/compile.el     Wed Sep 15 08:59:57 2004
***************
*** 849,854 ****
--- 849,855 ----
  
  (defun compilation-start (command &optional mode name-function 
highlight-regexp)
    "Run compilation command COMMAND (low level interface).
+ If COMMAND starts with a cd command, that becomes the `default-directory'.
  The rest of the arguments are optional; for them, nil means use the default.
  
  MODE is the major mode to set in the compilation buffer.  Mode
***************
*** 861,886 ****
  
  Returns the compilation buffer created."
    (or mode (setq mode 'compilation-mode))
!   (let ((name-of-mode
!        (if (eq mode t)
!            (prog1 "compilation" (require 'comint))
!          (replace-regexp-in-string "-mode$" "" (symbol-name mode))))
!       (process-environment
!        (append
!         compilation-environment
!         (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning
!                 system-uses-terminfo)
!             (list "TERM=dumb" "TERMCAP="
!                   (format "COLUMNS=%d" (window-width)))
!           (list "TERM=emacs"
!                 (format "TERMCAP=emacs:co#%d:tc=unknown:"
!                         (window-width))))
!         ;; Set the EMACS variable, but
!         ;; don't override users' setting of $EMACS.
!         (unless (getenv "EMACS") '("EMACS=t"))
!         (copy-sequence process-environment)))
!       (thisdir default-directory)
!       outwin outbuf)
      (with-current-buffer
        (setq outbuf
              (get-buffer-create
--- 862,890 ----
  
  Returns the compilation buffer created."
    (or mode (setq mode 'compilation-mode))
!   (let* ((name-of-mode
!         (if (eq mode t)
!             (prog1 "compilation" (require 'comint))
!           (replace-regexp-in-string "-mode$" "" (symbol-name mode))))
!        (process-environment
!         (append
!          compilation-environment
!          (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning
!                  system-uses-terminfo)
!              (list "TERM=dumb" "TERMCAP="
!                    (format "COLUMNS=%d" (window-width)))
!            (list "TERM=emacs"
!                  (format "TERMCAP=emacs:co#%d:tc=unknown:"
!                          (window-width))))
!          ;; Set the EMACS variable, but
!          ;; don't override users' setting of $EMACS.
!          (unless (getenv "EMACS") '("EMACS=t"))
!          (copy-sequence process-environment)))
!        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
              (get-buffer-create
***************
*** 901,915 ****
                     (buffer-name)))))
        ;; Clear out the compilation buffer and make it writable.
        ;; Change its default-directory to the directory where the compilation
!       ;; will happen, and insert a `cd' command to indicate this.
        (setq buffer-read-only nil)
        (buffer-disable-undo (current-buffer))
        (erase-buffer)
        (buffer-enable-undo (current-buffer))
!       (setq default-directory thisdir)
        ;; output a mode setter, for saving and later reloading this buffer
!       (insert "cd " thisdir " # -*-" name-of-mode
!             "-*-\nEntering directory `" thisdir "'\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.
--- 905,920 ----
                     (buffer-name)))))
        ;; Clear out the compilation buffer and make it writable.
        ;; Change its default-directory to the directory where the compilation
!       ;; will happen, and insert a `default-directory' to indicate this.
        (setq buffer-read-only nil)
        (buffer-disable-undo (current-buffer))
        (erase-buffer)
        (buffer-enable-undo (current-buffer))
!       (cd 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]