delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/02/23:40:44

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Mon, 02 Jul 2001 20:35:28 -0700 (PDT)
Message-Id: <20010702.203528.42410799.Takaaki.Ota@am.sony.com>
To: csims AT templartrading DOT com
Cc: cygwin AT cygwin DOT com
Subject: Re: Executing shell command to run bash from within emacs
From: Tak Ota <Takaaki DOT Ota AT am DOT sony DOT com>
In-Reply-To: <001b01c1031b$257ddb50$09fea8c0@3hi25.flashcom.com>
References: <001b01c1031b$257ddb50$09fea8c0 AT 3hi25 DOT flashcom DOT com>
X-Mailer: Mew version 1.95b126 on Emacs 21.0.103.1 / Mule 5.0 (SAKAKI)
X-Telephone: +1-858-942-3239
X-Fax------: +1-858-942-9142
X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804
Organization: Sony Electronics Inc.
Mime-Version: 1.0

This is what I do in my .emacs for NT emacs.  (in fact this works for
all cygwin, Linux and bare NT environment)

-Tak

;;
;; shell-mode
;;
(or (fboundp 'executable-find)
    (defun executable-find (command)
      "Search for COMMAND in exec-path and return the absolute file name.
Return nil if COMMAND is not found anywhere in `exec-path'."
      (catch 'found
	(let ((path-list exec-path))
	  (while path-list
	    (let ((full-path (expand-file-name command (car path-list)))
		  (executable-binary-suffixes
		   (if (memq system-type '(ms-dos windows-nt))
		       '(".exe" ".com" ".bat" ".cmd" ".btm")
		     '(""))))
	      (while executable-binary-suffixes
		(if (file-executable-p (concat full-path (car executable-binary-suffixes)))
		    (throw 'found full-path))
		(setq executable-binary-suffixes (cdr executable-binary-suffixes))))
	    (setq path-list (cdr path-list)))))))

(setq explicit-shell-file-name
      (let ((preferred-shells '("bash" "sh" "cmdproxy")))
	(catch 'found
	  (while preferred-shells
	    (let* ((shell (executable-find (car preferred-shells)))
		   file-name-handler)
	      (and shell
		   (setq file-name-handler (find-file-name-handler shell t))
		   (setq shell (funcall file-name-handler 'identity shell)))
	      (if shell (throw 'found shell)))
	    (setq preferred-shells (cdr preferred-shells))))))

(setenv "SHELL" explicit-shell-file-name)


On Mon, 2 Jul 2001 12:19:26 -0500, "Clark Sims" <csims AT templartrading DOT com> wrote:

> Hi everybody,
> I really like to record my bash sessions (both input and output), from
> within emacs. It is easy to do on Linux:  alt-x shell, or in emacs notation
> m-X shell.
> Does anybody know now to do this emacs for NT and cygnus bash?
> 
> Thanks in Advance,
> 
> Clark
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019