ENGLISH | JAPANESE |
Overview: If you have worked longer with Unix than with Windows, you probably want to build some similar environment to Unix on your machine. This chapter explains how to build a Unix-like environment on you Windows9X. You will install the following products:
Cygnus project provides us with GNU development tools and utilities on Windows9X, allowing us to work on Windows9X as if we were on Unix. We will install the latest version, Cygwin-1.1.X. (as is on the 15rh June, 2000)
To download the package, you need an empty directry to which the setup program imports all the files (mostly, a gzipped tar file) necessary to install Cygnus. We assume that you make a directry, C:\tmp\cygnus, on your PC for installation using DOS-Window as shown below. (You can of course open 'my computer' window to create the new directories under C drive.)
Microsoft(R) Windows 98 (C)Copyright Microsoft Corp 1981-1999 C:\WINDOWS>cd .. C:\>mkdir tmp C:\>cd tmp C:\tmp>mkdir cygnus
This is the Cygwin setup utility (v1.45.2.3), built on Jun 8 2000 12:08:45. Use this program to install the latest version of the Cygwin Utilities from the Internet. Alternatively, if you already have already downloaded the appropriate files to the current directory (and subdirectories below it), this program can use those as the basis for your installation. If you are installing from the Internet, please run this program in an empty temporary directory. Press <enter> to accept the default value. Root directory? [C:\CYGNUS]
You can proceed to setting values to variables. You might however want to use Emacs to edit files. If you prefer using Emacs to other editors available on Windows9X, install Meadow now (See below).
Meadow is the emacs-20 ported to Windows9X/NT by Hisashi Miyashita.
You have to set your home to some directory to install Meadow. We assume that you use C:\cygnus\home as your home directory. Create the directory as below if you use DOS-Window.
Microsoft(R) Windows 98 (C)Copyright Microsoft Corp 1981-1999 C:\WINDOWS>cd .. C:\>cd cygnus C:\cygnus> mkdir home
You can alternatively make C:\cygnus\home using BASH. Invoke BASH to type 'mkdir /home' if you choose this way. Beaware that you do not need to specify your home as 'C:/cygnus/home' because the ROOT directory is already set to 'C:\cygnus' within BASH when you downloaded those files from net. (1) That is, '/' in BASH corresponds to 'C:\cygnus' on Windows9X.
C:\cygnus\bin> BASH.EXE-2.04$ mkdir /home
You will need to invoke BASH frequently. It is thus better to put a short cut to C:\cygnus\bin\cygwin.bat on your desktop. Click the icon of cygwin.bat with the right button to choose the item to make a shortcut to the batch file. Drug the shortcut to your desktop.
A gzipped tar file, Meadow-1.10-i386.tar.gz, for Meadow Win32-Intel binary package is available from Vector . The current version is 1.10. Click the link at right bottom to open a window for download. Then, click the button, [Ftp Download] to import the gzipped file. Be patient as the file size is about 17MB.
BASH.EXE-2.04$ cd /usr/local/bin BASH.EXE-2.04$ ln /usr/local/lib/Meadow/1.10/Meadow95.exe emacs.exe
To use Meadow, you have to set your HOME among others. We are going to edit AUTOEXEC.BAT to edit environment variables. Some parameters may be easily set within $HOME/.bashrc. We conclude this chapter with a note on $HOME/.emacs. I found most settings presented in this section at various sites. (Thank you guys, and I am sorry that I cannot list up all your names here. Too many to name, even to recall.).
You need to set your HOME to c:\cygnus\home. Time zone should also be set to yours. You can optionally set your your path to the bin directories of cygnus if you would like to invoke the shell within DOS-Windows or Emacs, too. (You do not need to do so if you only use the shell within Cygnus window because the path is specified in /bin/cygwin.bat.)
REM --- REM --- Time Zone is set to that of Japan REM --- set TZ=JST-9 REM --- REM --- your home directory REM --- set HOME=c:\cygnus\home REM --- REM --- Below is optional REM --- set PATH=.;c:\cygnus\bin;c:\cygnus\usr\local\bin;%PATH%
Memo: We had to set the variables, TMP, SHELL, and MAKE_MODE, by ourselves in beta version, but it seems that we no longer need to set those variables because the values are set by Cygnus.
You can tune your BASH by editing .bashrc in your HOME directory. Following is my recommendtation. After editing AUTOEXEC.BAT and $HOME/.bash, you restart your PC so that the change takes effect.
# --- set prompt PS1='\w> ' # --- set EDITOR EDITOR="c:/cygnus/usr/local/lib/Meadow/1.10/bin/Meadow95.exe" export EDITOR # --- as you like alias ls='ls -F' alias cp='cp -i' alias rm='rm -i' alias mv='mv -i' alias del='/bin/rm -f \!*' alias h='history 20' alias more=less alias clear='COMMAND.COM /c cls'
Would you like the BASH window to close when you exit? Click the shortcut icon on your desk top to cygwin.bat with Right button and select [property] from the popup menu. A window listing up the properties of shortcut is displayed. Select the tub, [program]. There is an option in the menu to close the window when exit. Check it and select [ok] to finish the setting. Open a BASH window and exit by typing c-d. The window is now closed when you exit.
We can control the behaviour of Meadow by editing $HOME/.emacs. We go through some useful definitions.
Some emacs-lisp programs are under /usr/local/lib/Meadow/site-lisp.
; ; Set load-path to site-lisp and TMP ; (setq load-path (cons (expand-file-name (concat exec-directory "/cygnus/usr/local/lib/Meadow/site-lisp")) load-path)) (setenv "TMP" "/tmp")
To envoke BASH within Meadow by typing [M-x shell], you must include the following lines into your .emacs file.
;;; (setq shell-command-option "-c") ; ;--- from FAQ u-tokyo ; (setq explicit-shell-file-name "/cygnus/bin/bash.exe") (setq shell-file-name "bash.exe")
; ; To start mule from the home directory ; (cd "~")
(add-hook 'mw32-ime-on-hook (function (lambda () (set-cursor-color "red")))) (add-hook 'mw32-ime-off-hook (function (lambda () (set-cursor-color "black"))))
; my favourite (global-set-key "\C-h" 'backward-delete-char) (global-set-key "\M-?" 'help-for-help)
; variables (setq inhibit-startup-message t) ; ; some settings to my taste ; (setq-default fill-column 68) (global-set-key "\C-cg" 'goto-line) (setq visible-bell t) (setq display-time-day-and-date t) (setq default-tab-width 4) (setq search-highlight t) (setq query-replace-highlight t)
;;; ;;; hilit: change colours to improve visibility of characters ;;; (cond (window-system (setq hilit-mode-enable-list '(not text-mode) hilit-background-mode 'light hilit-inhibit-hooks nil hilit-inhibit-rebinding nil) (require 'hilit19))) ; ; to hilite regions (from FAQ u-tokyo) ; (transient-mark-mode 1)
(setq ange-ftp-ftp-program-name "/cygnus/usr/local/lib/Meadow/1.10/bin/ftp.exe") ; (setq ange-ftp-generate-anonymous-password "yourID@Domain")
(setq dired-move-to-filename-regexp (let* ((l "[A-Za-z\xa0-\xff]") (k "[^\x00-\xff]") (s " ") (yyyy "[0-9][0-9][0-9][0-9]") (mm "[ 0-1][0-9]") (dd "[ 0-3][0-9]") (HH:MM "[ 0-2][0-9]:[0-5][0-9]") (western (concat l l l s dd s "\\(" HH:MM "\\|" s yyyy "\\)")) (japanese (concat mm k " " dd k s "\\(" s HH:MM "\\|" yyyy k "\\)"))) (concat s "\\(" western "\\|" japanese "\\)" s))) (eval-after-load "ange-ftp" '(progn (setq ange-ftp-date-regexp (let* ((l "[A-Za-z\xa0-\xff]") (k "[^\x00-\xff]") (s " ") (mm "[ 0-1][0-9]") (dd "[ 0-3][0-9]") (western (concat l l l s dd)) (japanese (concat mm k s dd k))) (concat s "\\(" western "\\|" japanese "\\)" s)))))