help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] Use Cygwin bash as shell but use cmdproxy for compile??


From: Eli Daniel
Subject: Re: [h-e-w] Use Cygwin bash as shell but use cmdproxy for compile??
Date: Thu, 16 Dec 2004 15:37:49 -0500

On Thu, 16 Dec 2004 15:25:59 -0500, Timothy Babin
<address@hidden> wrote:
>
> I can't stop my compiles gracefully when they are invoked from bash since
> cygwin doesn't handle the signal appropriately. What I'd like to do is to
> bypass cygwin when running the compile command and have it use the cmdproxy
> instead. 
> 
> Is there an easy way to do this? 
> 
> Tim 

If you like bash for interactive use but don't care that emacs use it
internally, you can just write your own function to run a bash shell,
and use that instead of M-x shell.  This lets emacs use cmd/cmdproxy
for running things internally (like compile, grep, etc), but you get
the bash you want for interactive use.

I have this in my .emacs to set this up:

;;----------------------------------------------------------------------------
;; Set up shell and bash commands
;;----------------------------------------------------------------------------
;; create a shell buffer, but not necessarily called *shell*
(defun ewd-shell (&optional bufname)
"Just like `shell', only takes buffer name as argument."
 (interactive)
 (require 'shell)
 (if (null bufname) (setq bufname "shell"))
 (if (not (comint-check-proc (concat "*" bufname "*")))
     (let* ((prog (or explicit-shell-file-name
                      (getenv "ESHELL")
                      (getenv "SHELL")
                      "/bin/sh"))
            (name (file-name-nondirectory prog))
            (startfile (concat "~/.emacs_" name))
            (xargs-name (intern-soft (concat "explicit-" name "-args")))
            shell-buffer)
       (save-excursion
         (set-buffer (apply 'make-comint bufname prog
                            (if (file-exists-p startfile) startfile)
                            (if (and xargs-name (boundp xargs-name))
                                (symbol-value xargs-name)
                              '("-i"))))
         (setq shell-buffer (current-buffer))
         (shell-mode))
       (pop-to-buffer shell-buffer))
   (pop-to-buffer (concat "*" bufname "*"))))

;; create a bash buffer called *bash*
(defun ewd-bash()
 "Runs the bash shell"
 (interactive)
 (let* ((shell-file-name "bash")
        (explicit-shell-file-name shell-file-name)
        (explicit-sh-args '("-login" "-i"))
        (w32-quote-process-args ?\")) ;; Use Cygnus quoting rules.
   (ewd-shell "bash")))




reply via email to

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