Meadow version 2.00 basic manual The Meadow Team http://www.meadowy.org/meadow/ Meadow 2.00の基本マニュアルです。 Meadowのインストール方法や、Meadowに特有な機能等を説明しています。 This is a basic manual for Meadow 2.00, which describes installation and Meadow specific features.
イントロダクション Introduction

Meadowは、Windows 9x/NT/2000/XPで動作するEmacs実装の一つです。

Meadow is one of the implementations of GNU Emacs, which currently runs on Windows Windows 9x/NT/2000/XP.

Meadowは、もともとはWindows向けのGNU Emacsにおいて多言語拡張をするとの 題目で進められていました。しかし、GNU Emacs自身にMuleが統合され、また、 一部Meadow由来のコードがGNU Emacsへ導入されたこと、GNU Emacs 20.4で Windows向けにも多言語処理機能が一応のことながら実装されるようになった ことから、このような表現はもはや不正確になってしまいました。

Since this project was started, we have been working for multilingual enhancement to GNU Emacs for Windows, and the result become Meadow.

At present, however, GNU Emacs and Mule have been integrated, and an implementation for Windows of GNU Emacs, which is called NTEmacs, also can handle multilingual features, which is partly imported from Meadow's result.

Meadowはある時を境にGNU EmacsにおけるWindows実装(NTEmacsと呼ばれています) とは、異なった実装を歩み始めました。現状になってもその違いは残っており、 さまざまな機能が付加されています。Meadowは基本的にはGNU Emacsをベースに していますが、積極的にmaintainer達の好みで改良が施されています。将来的 には基となったGNU Emacsとは違ったものになるかもしれませんし、そうでない かもしれません。 :-)

From historical affairs, Meadow and NTEmacs make another decision on Windows implementation of GNU Emacs from a certain stage. Therefore, these two implementaion is different from each other especially on Windows interfaces, and Meadow have been added on various features to original GNU Emacs.

This Meadow version is based on GNU Emacs 21.1 currently. We plan to extend many features to Meadow. Thus, Meadow may change from original GNU Emacs, maybe or not maybe. :-)

配布パッケージ Distribution packages

Meadowは、以下の2種類の形式で配布されています。 お好きな方法を選択してインストールしてください。 配布ファイルは、以下のサイトもしくはそのミラーサイトからダウンロードできます。 お近くのサイトからダウンロードしてください。

tarball形式 tarball form

Meadowのバイナリをtar+gzipでアーカイブした形式です。 この形式は、Meadow本体や各種Emacs Lispパッケージを手作業でインストール したい方向けです。

この形式の配布ファイル名は、以下です。 Meadow-2.00-i386-base.tar.gz インテルx86用バイナリ (基本ファイル:必須) Meadow-2.00-i386-els.tar.gz インテルx86用バイナリ (.elファイル:選択) Meadow-2.00-i386-leim.tar.gz インテルx86用バイナリ (leimファイル:選択) Meadow-2.00-src.tar.gz ソースファイル (Meadow自体をコンパイルする場合には必要)

Netinstaller形式 Netinstaller form

ネットワーク経由でファイルを取得してインストールする形式です(Cygwinや Windows用のXEmacs等でも利用されています)。メニューを操作するだけで、 Meadow本体だけでなく各種Emacs Lispパッケージも簡単にインストールできます。

この形式の配布ファイル名は、setup.exeです。 setup.exeを実行すると、ネットワーク経由で必要なファイルを ダウンロード・インストールします。 また、メニューを日本語化したsetup-ja.exeも 利用できます(機能は同じです)。

インストール Install

Meadowをインストールする前に、以下の事項に注意してください。

以上で注意点は終わりです。 以下に、各形式ごとのインストール方法を説明します。

tarball形式からのインストール Installation by tarball form

各アーカイブを、適切なディレクトリ下で展開してください。 展開ソフトによっては、テキストファイルの行末をLFからCR+LFに自動的に 変換してしまうものがあります。このようなソフトを利用していないか、 注意してください(コマンドラインから、tar.exegzip.exeを利用して展開することを推奨します)。

以下は、C:\win32appの下にMeadowをインストールする場合の例です。

> c: > cd \win32app > tar xzf Meadow-2.00-i386-base.tar.gz

必要に応じ、elsおよびleimアーカイブを、同じ ディレクトリ下に展開してください。

> tar xzf Meadow-2.00-i386-els.tar.gz > tar xzf Meadow-2.00-i386-leim.tar.gz

展開が終わったら、Meadow\2.00ディレクトリに移動し、 install.exeコマンドを実行してください。install.exe を実行するとホームディレクトリ名を聞かれますので、環境に応じて適切な ディレクトリ名を入力してください。特にホームディレクトリが存在しない 場合は、そのままENTERキーを入力してください。

> cd Meadow\2.00 > install

以上でインストールは終了です。初期設定を行なってください。

Netinstaller形式からのインストール Installation by Netinstaller form

setup.exe(もしくはsetup-ja.exe)を実行し、 インストーラーの指示に従ってください。

インストール終了後、初期設定を行なってください。

初期設定 Initial configuration

この章では、Meadowを使うために最低限必要な設定を説明します。

Meadowの配布物にはdot.emacs.jaという名前で .emacsのサンプル(日本語向け)が付属していますので、 カスタマイズする際の参考にしてください。

詳細な設定を行ないたい場合は、必要に応じて次章以降を参照してください。 また、本文書の末尾に各種情報源へのリンクが記されていますので、 そちらも併せて参照してください。

環境変数 Environment variable

Meadow本体は特に環境変数を設定しなくても動作しますが、Meadow上で動作する Emacs Lispプログラムや、Meadowから呼び出される外部プログラムが特定の 環境変数が設定されていることを期待している場合があります。 以下に、よく利用される環境変数と、その設定内容を説明します。これらの 環境変数は、設定しておくことをお勧めします。

HOME
いわゆるホームディレクトリです。.emacsをはじめとして、各種の設定ファイルが格納されます。
TZ
タイムゾーンです。日本の場合は、JST-9に設定します。

環境変数は、Windows 95/98/MeならAUTOEXEC.BATで、Windows NT/2000/XPであれば 「コントロールパネル」「システム」「環境」で設定できます。

設定ファイル Configuration file

Meadowは、起動時にホームディレクトリにある.emacsを 読み込み、実行します。Meadowをカスタマイズしたい場合は、この.emacs を編集してください。以下に、必要最低限の設定を説明します。

言語環境の設定
Meadow(および、その元になったEmacs)は、多言語環境を利用する際には 最初に言語環境の設定を行なう必要があります。日本語を利用する場合は、 .emacsに以下の行を追加してください。 (set-language-environment "Japanese")
IMEの設定
MeadowはIME(MS-IME等による日本語入力)をサポートしていますが、 起動時には一部の機能が無効化されています。IMEを利用するためには、 .emacsに以下の行を追加してください。 (mw32-ime-initialize) (setq default-input-method "MW32-IME") IMEのより詳細な設定方法は、「IME」の章を参照してください。
フォントの設定
Meadowは、表示に利用できるフォントとしてTrueTypeフォントとBDF フォントをサポートしています。多言語環境を利用する際には、 言語環境と同様に表示用フォントの設定を行なう必要があります。 以下の設定を.emacsに追加すると、TrueTypeフォントを利用し、 アルファベットフォントを「Courier New」、 日本語フォントを「MS ゴシック」に設定することができます。 (create-fontset-from-request "private-fontset" '((width . 8) (height . 16) (fixed . t) (italic . nil)) '((family . "MS ゴシック") (family . "Courier New"))) (setq default-frame-alist (append (list '(font . "private-fontset")) default-frame-alist)) フォントについての詳細な説明は、「フォントの設定」の章を参照 してください。

詳細設定及び拡張機能 Detail configuration and exhancements

基本的に、Meadowの設定は基となったGNU Emacsと同じです。 この章はMeadowに特有な設定及び機能について説明しています。 その他の設定については、基となったGNU Emacsのドキュメントを参照してください。

Fundamentally, the configuration of Meadow is the same as that of the original Emacs. This chapter describes Meadow specific configurations and some enhancements. As for other configurations, please refer the original ocumentations of GNU Emacs.

バージョンと機能の取得 version and feature information 機能の検査 Checking the feature on Meadow

Emacs Lispや、.emacsでの設定で、現在Meadowで動いているかどうかを調べるためには (featurep 'meadow)を用いて検査してください。

When you'd like to cheke if the current environment is Meadow, use (featurep 'meadow).

Meadowのバージョン取得 Obtaining Meadow version information

(Meadow-version)で、Meadowのバージョンに関する情報を文字列で取得することが出来ます。 この関数はinteractiveではありません。

(Meadow-version) will return the version information with string. Note that this function is not interactive.

キー及びマウスのカスタマイズ Customizing configurations for keyboard and mouse モディファイアの設定 Setting modifiers

この関数でキーに修飾(modifier)キーを設定することができます。 修飾キーとは、そのキーを押下することによって、他のキーの操作を違うもの にすることができるキーのことです。Emacsはmeta, ctrl, alt, shift, super, hyperの6種類の修飾を重ねあわせることが出来ます。(shiftは大分毛 色が違うのですが) この関数は実際にどのキーを修飾キーとして取り扱うかを指示します。 KEY はキーの仮想コード、又はキーを示す文字列です。 MODIFIER には以下のキーのどれかを指定することができます。

nil
通常のキー
none
無視されるキー。この指定を受けたキーに関する全ての動作はMeadowから無視されます。
meta
meta modifier キー
ctrl
ctrl modifier キー
shift
shift modifierキー(修飾キーとしてのみ動作します)
alt
alt modifierキー(Windowsの alt キーのことではありません)
super
super modifierキー
hyper
hyper modifierキー

You can set modifier keys by this function. For detail, please refert to the documentation strings.

マウスボタンの設定 Configuring mouse buttons

Meadow は IntelliMouse 等の3ボタンマウスに対応しています。 ボタンの割り当ては以下の変数で変更することができます。

Meadow recognizes 3 button mouse like IntelliMouse. By default, mouse buttons are natually mapped to Emacs mouse button event. Besides it, you can remap mouse buttons by the following variables.

w32-lbutton-to-emacs-button w32-mbutton-to-emacs-button w32-rbutton-to-emacs-button

これらの変数にはそれぞれ左、真中、右のボタンが押されたときと離されたときに、 Meadow に送られるボタンの番号を指定します。

Each of them indicates a button number of mouse button event when left, middle, or right buttons are pressed or depressed respectively.

マウスホイール Mouse weheel

マウスホイールが回されたときは、Meadow は次のようなイベントを 受け取ります。

When mouse wheel is turned, Meadow receives an event as below.

(mouse-wheel1 ([WINDOW | FRAME] POSITION (X . Y) TIME DELTA))

[WINDOW | FRAME]はマウスのカーソルがあるウインドウまたはフレームを表します。 POSITIONはどのエリアにマウスのカーソルがあるかを表します。 (X . Y)はマウスのカーソルの座標を表します。 DELTAはホイールの回転角を表します。DELTAを以下の関数に渡すことで、 スクロールした行の総数を知ることができます。

[WINDOW | FRAME] is a window or frame where the mouse cursor is. POSITION indicates the area where the mouse cursor is. (X . Y) indicates coordinates of the mouse cursor. DELTA is a rotation angle of wheel. You can pass DELTA to the following function to obtain the amount of scroll lines.

(w32-get-mouse-wheel-scroll-lines DELTA)

デフォルトのホイールの動作の設定は、マウスカーソルがバッファーウィンドウにある時は バッファーの内容のスクロール、モードラインにあるときはモードラインが移動されます。

By default, when the mouse cursor is in a buffer window, its contents will be scrolled; when the cursor is on a mode line, it will be moved up or down.

マウスカーソルの消去 Hiding mouse cursor

カーソルスタイル設定 Configuring cursor style

MCI機能 MCI features

Meadow では、Windows の MCI (Media Control Interface)を利用して、マルチメディアデバイスを制御できます。 これにより、音声データを再 生したり、CD を再生したりできるようになります。 詳しくは、MCI のマニュアルを参照してください。

Meadow provides an API for controling multimedia devices with Windows MCI (Media Control Interface). Using this API, you can play a sound data and also music in a CD. If there is any further information you require, please refer to the MCI specification.

(mw32-mci-send-string COMMAND) (mw32-mci-send-string COMMAND)

mciSendString() を使って、MCI コマンドを送信します。 正常終了した場合には、コマンドの実行結果を表す文字列を返します。 例えば、`open' を実行した場合には、`open' したデバイスの ID を文字列で返します。 エラー発生時には、エラーコードを数値で返します。

使い方は次のとおりです。 (mw32-mci-send-string "open c:/WINDOWS/Media/tada.wav alias tada") => "1" ; デバイス ID (mw32-mci-send-string "play tada") => "" (mw32-mci-send-string "close tada") => ""

また、notify を指定することで、 MM_MCINOTIFY イベントを捕獲できます。 (mw32-mci-send-string "open c:/WINDOWS/Media/tada.wav alias tada") => "1" ; デバイス ID (progn (mw32-mci-send-string "play tada notify") (read-event)) => (mw32-mci mw32-mci-notify-successful 1 nil) (mw32-mci-send-string "close tada") => ""

This function sends a command string to an MCI device with mciSendString(). And it returns a string that holds return information (e.g. ID of a device that are opened).

The following is usage of this functin. (mw32-mci-send-string "open c:/WINDOWS/Media/tada.wav alias tada") => "1" ; device ID (mw32-mci-send-string "play tada") => "" (mw32-mci-send-string "close tada") => ""

You are able to catch a MM_MCINOTIFY event if you specify `notify' in a command string. (mw32-mci-send-string "open c:/WINDOWS/Media/tada.wav alias tada") => "1" ; device ID (progn (mw32-mci-send-string "play tada notify") (read-event)) => (mw32-mci mw32-mci-notify-successful 1 nil) (mw32-mci-send-string "close tada") => ""

(mw32-mci-get-error-string ERROR-CODE) (mw32-mci-get-error-string ERROR-CODE)

エラーコードからエラーの内容を文字列で取得します。

This function retrieves a string that describes the specified MCI error code with mciGetErrorString().

(mw32-mci-add-notify-callback DEVICE-ID CALLBACK-FUNC &optional CALLBACK-ARG) (mw32-mci-add-notify-callback DEVICE-ID CALLBACK-FUNC &optional CALLBACK-ARG)

MM_MCINOTIFY イベントに対するコールバックを登録できます。 詳しくは、mw32-mci-notify-func() を参照してください。 ここでは、MM_MCINOTIFY イベントを拾って、waveaudio を close しています。

This function adds a callback function which should be executed when a MM_MCINOTIFY event rises. For further information, please refer to mw32-mci-notify-func().

フォントの設定 font configuration

Meadow 2.xからは、Emacs 21ベースになったため、フォントに関する設定はMeadow 1.xとは だいぶ変更されています。すくなくとも、Meadow 1.xにおける低水準APIについては互換性が なくなってしまいました。高水準APIについては互換性を保っていますが、それもすこし性質が ことなっていますし、従来の高水準APIを使用する事ももはや推奨されません。

Since Meadow 2.x is based on Emacs 21, its font configurations are hugely changed. At least the low level font selection APIs of Meadow 1.x have no compatibility. Although the high level ones have partly compatible with those of Meadow 1.x, those behaviors are not totally equal, and we don't recommend you to use them any more.

Meadow 2.xでは、低水準APIと高水準APIのはっきりした区別がなくなっており、 単一のフォントリクエストシステムに統合されています。 ユーザーはフォント選択に関する要求を指定するだけとなっていて、 その指定方法がことなっているだけなのです。フォント選択の指定は連想リストによる条件の 指定方法と、Emacs Lispによるプログラムによる条件の指定方法の2種類が用意されています。

Meadow 2.x has no clear distinctions between low and high level APIs, and they are integrated to a single font request system. Users set only requests about font selsection, and we can see difference only at how to specify requests. Currently, Meadow 2.x has two methods to specify such requests; (1) an association list; and (2) an Emacs Lisp function.

Meadowではフォントシステムを以下の3階層でモデル化しています。

In Meadow, font system can be characterized by the following 3-layer model.

+----------------------------------------+ | Font Request Layer (FR) | +----------------------------------------+ | Logical Font Layer (LF) | +----------------------------------------+============== | Physical Font Layer (PF) | Invisible +----------------------------------------+
フォント要求(FR)レイヤ
フォントに関する要求事項を管理する層です。一つ一つのフォント要求(FR)は文字列による フォント名が必ず与えられます。 FRに割り当てられた名前はフォント名と完全に同一視できるように設計されており、 Emacs Lispからは、そのフォント名をset-face-fontや、 set-frame-fontなどのAPIに指定することが出来ます。言い換えると、 この名前によって、通常のEmacs Lispとの互換性をとっているというわけです。 フォント要求には、連想リストもしくはEmacs Lisp Functionを割り当てることが出来、 これらの記述には、以下で挙げる論理フォント(LF)を用います。 Meadowは、フェイスの情報と、表示される文字、そしてフレームを、このフォント要求 レイヤに渡し、結果として、それらを表示するために用いられる論理フォントを得ます。
論理フォント(LF)レイヤ
論理フォントは、デバイスによる相違があるものの、デバイス環境さえ特定されれば、 物理フォントと完全に対応させることが出来るフォント情報を保持しているものです。
物理フォント(PF)レイヤ
実際に表示されるフォントを取り扱うレイヤです。デバイスによって異なった情報を 扱うため、ユーザーからは直接操作することは出来ません。論理フォントから物理フォントへの 対応は、完全に隠蔽されています。
Font Request(FR) layer
This layer manages any requests related to fonts. Each of font requests (FR) needs to be given a name in string. The name assigned to a FR can be regarded as a font name in view of Emacs so that you can specify it in Emacs Lisp to the various functions that accept a font name, e.g., set-face-font, set-frame-font, and so on. Anyway, by such names, we can keep ompatibility with ordinal Emacs Lisp. In a FR, you can designate one or more assocation lists and Emacs Lisp functions, and use logical fonts(LF), which will be explained later, to describe them. Meadow passes face information, a character to be displayed, and frame object to the font request layer, and then obtains a LF that is used to display those.
Logical Font(LF) layer
A logical font has device-independent font infomation. Once the device environment is fixed, any logical font can be completely matches to an actual physical font.
Physical Font(PF) layer
This layer deals with fonts that are actually shown. Since it handles device specific information, users cannot directly manipulate this layer. Any kind of conversions from logical fonts to physical fonts are totally invisible.
論理フォントの記述 Logical Font

Meadowでは、現状で以下の2種類の論理フォントを定義しています。

Currently, Meadow defines two types of logical fonts as follows.

Windowsの論理フォント
Windowsで通常用いられるフォントを指定するための論理フォントです。 Win32 APIにおける LOGFONT 構造体とほとんど直接対応し、 以下のようなリストで表現されます。 ) ]]>
NAME
31バイト以内のフォントの名前
WIDTH
フォントの幅(数字)
HEIGHT
フォントの高さ(数字)
WEIGHT
フォントの太さ(数字) (通常の太さは400で、ボールドは700)
ITALIC-P
nilでない値の時はイタリックフォント
STRIKEOUT-P
nilでない値の時は打ち消し線を表示
CHARSET
フォントの文字集合を表す番号 (0で、いわゆるWindows-Latin1の文字集合に、128で、SHIFTJIS文字集合を指定することになる。)
QUALITY
フォントの品質(数字)
OUTPRECISION
フォントの出力精度(数字)
PITCH&FAMILY
フォントが固定幅であるかどうか、加えてフォントファミリーもここに指定する
この論理フォントを(w32-query-get-logfont)という関数を用いて、Windowsのフォント選択ダイアログを通して選択することも出来ます。
BDFの論理フォント
Meadowでは、BDFフォントを使うことも出来ます。BDFフォントの論理フォントは、 以下のようなリストで表現されます。 (bdf-font "FILENAME") FILENAME には実際の BDF フォントのファイル名をフルパスで指定します。
logical font for Windows font
This type of logical font is used to specify Windows fonts. It has nearly direct correspondences with LOGFONT structure in Win32 API, and it can be described with a list as follows. ) ]]>
NAME
the font name within 31bytes
WIDTH
font width (number)
HEIGHT
font height (number)
WEIGHT
font weight (number) (400 for normal font, 700 for bold font)
ITALIC-P
Non-nil means an italic font
STRIKEOUT-P
Non-nil means a strikeout font
CHARSET
a charset number of font. (0 means so-called Windows-Latin1 character set, and 128 means SHIFTJIS character set)
QUALITY
quality of font (number)
OUTPRECISION
output precision (number)
PITCH&FAMILY
specifies whether a font is fixed pitch of not, and a font family as well.
This type of logical font can be obtained with (w32-query-get-logfont) function, which pop-up a Windows font selection common dialog with which users can interactively select a font.
logical font for BDF font
Meadow can use BDF fonts as well. This type of logical font can be described by a list of something like: (bdf-font "FILENAME") FILENAME is a BDF font file name in full path format.
フォント要求の記述 Describing font requests

フォント要求を追加するためにはw32-add-font関数を用います。

w32-add-font function adds a new font request.

'((spec [(strict ) |(function )]...))) ]]>

FR-NAMEには、追加されるフォントリクエストの名前を指定します。すでに 同一名が追加済みの場合にはエラーとなります。

FR-NAME is the name of a newly added font request. If the same name has been already added, it raises an error.

2番目の引数にはフォントの要求の明細を指定します。現状では、specのみがキーとして 有効で、他は無視されます。このspecに対応する値には、0個以上の要求を 指定します。各々の要求は、既に示したように、

The second argument is the specification of the request. Currently, only spec key is effective, and other keys are just ignored. The value of spec key must be font 0 or more requests. As is given the above, each request must have the either of the following forms:

) ]]>

もしくは、

or

) ]]>

によって構成されます。

まず、両者の共通項から説明します。SPEC-PLISTには、 この要求が適用されるときの条件を指定します。これは属性リストで指定されます。 これらの条件は、通常フェイスで指定されているものと照合されます。例えば、 defaultフェイスで、高さが120と指定されているとします。このフェイスの 指定と適合させる為には、SPEC-PLISTで、以下のように指定する必要があります。

First, we explain the common arguments. In SPEC-PLIST, you have to specify the matching condition that must be satisfied whenever this request is adopted. The matching condition must be an a-list, which will be usually matched with face information. For example, let default face be defined to be 120 in height. In order to match with this face, you specify the following in SPEC-PLIST.

もしくは、以下のような指定を用いて、 どんな高さが指定されているフェイスに対しても適用されるようにも出来ます。

Or, with the below condition, the request will be used for all faces of any height.

anyは特別なキーワードで、フェイス属性のあらゆる値にも適合するという 指定です。特別に、SPEC-PLISTの代わりにanyを指定することも 許されます。例えば、以下のように指定すると、"test"というフォント名では、 どんなフェイスに適用される場合にでもFixedSysの19ドットのフォントが用いられることに なります。

any is the special condition that can match any value of the face attribute. Besides it, you can specify any instead of SPEC-PLIST. In this case, the condition matches any face. For example, by the following configuration, 19-dot "FixedSys" font is used for any faces when the current font name is "test".

また、unspecifiedを指定した場合には、フェイスでその値が指定されていない ときのみ、条件が満たされているものとみなされます。SPEC-PLISTで、明示的に 条件が指定されていないときには、このunspecifiedが指定されているものと みなされます。したがって、フェイスで何が特別な指示がなされているときには、その条件は 選択されません。

Otherwise, when unspecified is specified, the matching condition is satisfied only if the corresponding face attribute is also unspecified. When you don't explicitly give the condition in SPEC-PLIST, unspecified is used by default. Therefore, when the face attribute has any specific value, such conditions will not be selected.

SPEC-PLISTに指定できるキーは以下の通りです。

:char-spec
そのフォントで表示される文字を、 文字そのもの(generic charを含む)、charset、もしくは、文字テーブルで指定します。 文字テーブルで指定する場合には、 文字テーブルで対応する項目に非nil値が入っているかで判定されます。 この項目を指定しなかった場合にはascii文字集合が指定されたものとみなされます。
:width
そのフォントで表示される文字の幅を以下のシンボルで指定します。
  • ultra-condensed
  • condensed
  • normal
  • semi-expanded
  • expanded
  • extra-expanded
  • ultra-expanded
:height
フォントの高さを0.1ポイント単位で指定します。 例えば、120と指定した場合には12ポイントと指定されたフェイスの条件に適合します。
:family
フォントファミリ名の条件を指定します。
:weight
フォントのウェイトに関する条件を指定します。以下の値が指定できます。
  • extra-bold
  • bold
  • semi-bold
  • normal
  • semi-light
  • light
  • ultra-light
  • extra-light
:slant
斜体やイタリック体に関する条件を指定します。以下の値が指定できます。
  • normal
  • italic
  • reverse-italic
  • oblique
  • reverse-oblique

Meadowは、あるフェイスが表示される時点で、そのフェイスや表示される文字に関する条件が specで記述された条件に適合するかどうかを順に調べます。条件に適合されたspecの項目が 採用され(関数によるspecの場合にはこれが失敗することがある。その場合には、次のspecを また順に試していく)、その項目が指定する論理フォントを表示のために用いることになります。 なお、結果はキャッシュされるので、2度目以降の表示にはこの評価は再度行われることは ありません。

OPTION-ALISTには、そのフォントを表示する為のオプション設定を指定します。 現状で以下のオプションが指定できます。

encoding
そのフォントのエンコーディングを指定します。 通常は自動的に判別されますが、その判別がうまく行かない場合には 設定しなければ正常な表示が行われません。 この項目には以下のうちのいずれかを指定することが出来ます。
nil
文字セットのディメンジョンで、フォントのエンコーディングを推測します。 1ディメンジョンのフォントの場合、1単位に付き1バイトでエンコーディングされ、 2ディメンジョンでは1単位に付き2バイトでエンコーディングされます。
1-byte-set-msb
文字セットのディメンジョンによらず、1単位に付き1バイトでエンコーディングされます。 その際、最上位ビットは常に1になります。
2-byte-set-msb
文字セットのディメンジョンによらず、1単位に付き2バイトでエンコーディングされます。 その際、各バイトの最上位ビットは常に1になります。
shift-jis
Shift-JIS形式でのエンコーディングを行います。 ただし、文字セットが1ディメンジョンの場合 バイトの上位ビットが1にセットされます。
unicode
Unicode形式でのエンコーディングを行います。ただし、現状では、適切な エンコーディングが行われません。将来の為に予約されています。
エンコーディングメソッドシンボル
w32-regist-font-encoderで登録された エンコーディングメソッドを指定します。
spacing
表示時の文字間のスペース間隔を指定します。例えば、1を指定すると1ドット間隔が 増やされます。負の値も指定できます。
centering
非nil時には、ベースラインを用いず、全体で中心が揃えられるように表示が行われます。
relative-compose
合成文字を扱う際のグリフの判断基準を指定します。特殊なパラメータなので、通常は 指定しないでください。
default-ascent
relative-composeと同じく、合成文字を扱う際のグリフの判断基準を指定します。 特殊なパラメータなので、通常は指定しないでください。

specの項目がstrictの時、LFには、論理フォントを直接指定します。 一方、specの項目がfunctionの時、FUNCTIONで指定された 関数が、以下の形式で呼ばれます。

CHARACTERには今表示されようとしている文字が渡されます。 FACE-ATTRSには属性リストで、フェイスの属性が渡されます。 FRAMEには表示されようとするフレームが渡されます。 この関数は、渡された情報を基に、適切な論理フォントを返却するか、もし みつからなければ、nilを返却しなくてはなりません。(論理フォント . オプション) のコンスペアを返却することも可能です。

IME IME 初期化設定 Initializing IME

Meadowは、IMEをサポートしていますが、起動時には、一部の機能が無効化されています。 IME機能を初期化するためには、mw32-ime-initializeを呼んでください。 .emacsに以下の行を追加すると良いでしょう。 (mw32-ime-initialize) 通常、IMEをインプットメソッドして利用するためには、以下のように設定をしてください。 (setq default-input-method "MW32-IME") keyboard-coding-systemは、通常自動的にmw32-ime-initialize によって設定されるはずですが、これがうまく自動設定されない場合には手動設定の 必要があるかもしれません。その場合には、 (set-keyboard-coding-system <CODING-SYSTEM>) のようにして、手動でコーディングシステムを設定してください。

入力文字列のフォント指定 Setting fonts for composition strings

frame-alistに、ime-fontキーを指定することで、IMEの入力文字列の フォントを設定することも出来ます。(IMM APIの実装と共に将来的には廃止される 可能性があります) ただし、制限として、Windowsのフォント以外は選択されません。BDFフォントは 使用することができません。.emacsなどの設定例を以下に示します。 (setq default-frame-alist (cons '(ime-font . (w32-logfont "MS ゴシック" 0 0 400 0 nil nil nil 128 1 3 49)) default-frame-alist))

引数編集機能 Argument Editing

Meadowは、外部プロセスを起動することが出来ますが、Windowsでは、 引数の渡し方がUNIXでの方法とはかなり異なったものになっています。 UNIX では引数は次のような方式で渡されます。

Meadow can invoke external processes. But, in Windows, the style of arguments for such processes is quite differenct from that in UNIX. In UNIX style, arguments are already separated in a list like the following.

argv[0] = /usr/bin/ls argv[1] = -l argv[2] = "/home/himi/foo"

しかし、Windows では引数は一つの文字列でなくてはなりません。さらに問題なことに こういった引数を文字列に結合する方法は起動されるプログラムによって異なるのです。 Windowsでは、慣例的に、おもに次の3つの方法が用いられます。

On the contrary, in Windows, arguments must be connected to a single string. To make matters worse, how we should connect these arguments depends on each program to be invoked. In Windows, by convension, there are mainly three ways to do that, which are shown below.

単純な結合
単純に引数を結合し、それぞれの引数を" "スペースで区切ります。上の例では、 /usr/bin/ls -l "home/himi/foo" となります。この方法は単純ですが欠陥もあります。引数にスペースが 入っていてもそれを判別することが出来なくなってしまうのです。
Microsoft Visual C++の方法
Microsoft Visual C++ は引数を`"'の引用符で囲んで結合します。それぞれの 引数は" "(スペース)で区切られます。引数に`"'がある時は`\'(バックスラッ シュ)を`"'の前につけます。`"'が`\'の後にある場合は`\'を`\'の前につけます。 この方法は複雑ですが、引数のスペースも引用符も正確に起動プログラムに渡すことが できます。
Cygwinの方法
面倒な事ですが、Cygwinでは、また別の方法で引数を引用符で囲みます。 Cygnus のプログラムは引数を`"'の引用符で囲んで結合します。 それぞれの引数は" "(スペース)で区切られます。 引数に`"'がある時は`""'に変換します。 この方法も引数にスペースや引用符が入っていても正確に起動プログラムに渡すことが できます。
Simply connecting arguments
In this way, arguments are simply connected and they are separated by " "(SPACE). In the above example, the result is: /usr/bin/ls -l "home/himi/foo" This way is simple, though it has a critical flaw because we cannot correctly split arguments if it contains any space in each of them.
Microsoft Visual C++ style
In Microsoft Visual C++, areguments are connected with quoting by `"'. And each arguments are separated by " "(SPACE). If a argument contains `"', quote it by `\'(Backslash). If its `"' is located after `\', quote the `\' by `\', too. Although this way is rather complicated, it can correctly pass arguments to a program even if they include any spaces or quotations.
Cygwin style
It's really troublesome, but in Cygwin, arguments are connected in a different approach. In Cygwin, arguments are connected with quoting by `"'. And each arguments are separated by " "(SPACE). If a argument contains `"', convert it to `""'. Also in this way, arguments are correctly passed to a program.

Meadowでは、この問題に対処する為に「引数編集」機能を備えています。 この機能によって、ユーザーが引数を実際にプロセスに対してどのように渡すかを 制御することが出来ます。これは、実際には、起動プロセスのプログラム名に対して 照合される正規表現を指定することによって行われます。

Meadow has "Arugment Editing" feature to deal with this problem. Owing to it, users can control how arguments are actually passed to the process to be invoked by specifying a regular expression that is matched to the pathname of the program.

引数編集の設定 Defining argument editings

「引数編集」は、次の関数で設定します。

You can configure "Argument Editing" by the following function.

PROCESSには、正規表現を指定します。起動されるプログラム名は フルパスかつ区切り文字が'/'に正規化されて、この正規表現に対してマッチが 行われます。マッチが成功すると、FUNCTIONで指定された関数が 呼ばれ、引数が実際に変換されることになります。

You have to specify a regular expression, PROCESS, and it is matched with a program name. Note that the program name is converted to a full path and all of its separators are normalized to `/' before matching. When the matching is successful, FUNCTION will be invoked to convert the arguments.

FUNCTIONはプロセスに渡されるべき引数のリストとともに呼ばれます。 この関数は以下のうちの一つの方法で値を返さなければなりません。

  • 関数が文字列を返却した場合、プロセスは、その文字列を引数として起動されます。
  • (PROGRAM . ARGUMENT)のコンスペア (PROGRAMARGUMENTも両方とも文字列でなければなりません) を返却した場合、PROGRAMで指定されたプロセスが、ARGUMENTを 引数として起動されます。

FUNCTION is invoked with a list of arguments to be passed to the process. This function must return one of the following.

  • When the function returns a string, it will be the argument of the process to be invoked.
  • When the function returns a cons pair of (PROGRAM . ARGUMENT) (both PROGRAM and ARGUMENT must be strings), PROGRAM will be invoked as a process with ARGUMENT.

METHODには、設定がどのような優先順位で登録されるかを指定します。 以下のうちのいずれかが指定可能です。

'first
設定を一番最初に登録します。従って、その設定の優先順位は最も高くなります。
'last
設定を一番最後に登録します。従って、その設定の優先順位は最も低くなります。
'append
設定を付け加えます。もし PROCESS がすでに登録されていると、何もしません。 そうでない場合はその設定を一番最初に登録します。
'replace
設定を置き換えます。もし PROCESS がすでに登録されていると、新しいものと置き換えます。 そうでない場合は何もしません。
nil
もし PROCESS がすでに登録されていると、新しいものと置き換えます。 そうでない場合はその設定を一番最初に登録します。

In METHOD, you can specify how the setting is registered with priority. You can specify one of the followings.

'first
Register the setting at the head. Hence, it will have the highest precedence.
'last
Register the setting at the tail. Hence, it will have the lowest precedence.
'append
Append the setting. If PROCESS has been already registered, nothing happens. Otherwise, register it at the head.
'replace
Replace the older setting with the new one. If PROCESS has been already registered, replace it. Otherwise, register it at the head.
nil
If PROCESS has been already registered already, replace it with the new setting. Otherwise, register it at the head.

引数編集の削除 Removing argument editings

「引数編集」の設定を削除するには以下の関数を用います。

To remove a setting of argument editing, use the following function.

PROCESSには、削除したい設定に対応する正規表現を指定します。

In PROCESS, specify a regular expression that corresponds to the definition you want to remove.

引数編集設定用の関数 A general function to define argument editings

引数編集を簡単に設定するために以下の関数が用意されています。

For conveniently defining argument editing, we prepare the following function.

ARGUMENTにはリスト形式で引数を指定します。 QUOTINGには引数の引用符の処理をどのようにするかを指定します。 以下のうちのいずれかが指定できます。

nil
引数を単純に結合します。 引数は" "(スペース)で区切られます。
'msvc
Microsoft Visual C++ の方法で引用符をつけます。
'cygnus
Cygwinライブラリの方法で引用符をつけます。

ARGV0ISPが非nilの場合、argv[0]の区切り記号を `\\' に変換します。

QUOTINGで指定された方法で引数が一つの文字列として結合された後、 EP, H2SP, QP, S2IPSに従って、 文字列は変換されます。

H2SPが非nilの場合、文字列の中の '-' は '/' に変換されます。

S2ISPが非nilの場合、文字列の中の '/' は '\\' に変換されます。

EPが非nilの場合、'\\' をエスケープキャラクターと見なし、 '\\' の後の文字は変換されません。

QPが非nilの場合、'または"で囲まれた部分を引用符で囲まれた文字列と見なし、 その文字列を変換しません。

In ARGUMENT, specify arguments in a list. In QUOTING, specify how arguments are quoted. You can specify one of the followings.

nil
Simply connect the arguments, and they are separated by " "(SPACE).
'msvc
Quote arguments by following the way of Microsoft Visual C++.
'cygnus
Quote arguments by following the way of the Cygwin library.

When ARGV0ISP is non-nil, convert a separator of argv[0] to `\\'.

After the arguments are connected in the sytle of QUOTING into a single string, it is also converted in accordance with the settings of EP, H2SP, QP, S2IPS.

When H2SP is non-nil, every '-' in a string is converted to '/'.

When S2ISP is non-nil, every '/' in a string is converted to '\\'.

When EP is non-nil, '\\' is regarded as an escape character, thus, any character following to '\\' is NEVER converted.

When QP is non-nil, any part enclosed with ' or " is regarded as a quoted-string, thus it is NOT converted.

ネットワーク環境について Networking environment FQDNの取得 Retrieving an FQDN

Meadow can retrieve the current system's FQDN by (w32-get-fqdn) function. Unlike the other Emacsens, Meadow does not automatically get FQDN at the startup so that it doest not set a FQDN to system-name variable. If you'd like to set a FQDN to this variable, add something like the following line to your .emacs or something.

Meadowでは(w32-get-fqdn)という関数で現在のシステムのFQDNを取得できます。 通常のEmacsとは異なり、起動時にFQDNを自動的に取得したりはしません。このため、 system-nameにFQDNがセットされません。 起動時にsystem-nameにFQDNをセットするためには、 以下のような設定を.emacsなどに追加してください。

(setq system-name (w32-get-fqdn))

しかし、環境によっては、この設定によって、MeadowはDNSサーバーへの 問い合わせを行うようになるので、システムはダイアルアップネットワークの ダイアログをだすかもしれません。このダイアログを出したくないときは、以下の 事項をチェックしてください。

正しいドメイン名とホスト名をコントロールパネルで設定する
OS毎に設定は違いますが、FQDNをネットワーク設定であらかじめ指定しておくと、 いちいちDNSサーバーに取得をすることはなくなります。
hostsファイルを設定する
Windowsではhostsファイルによってもドメインネームを決定しますので、 このファイルにFQDNを設定することもできます。 通常hostsファイルはWindowsのsystem32\drivers\etc ディレクトリなどに用意されています。 このファイルのlocalhostに対応するエントリを以下のように編集してください。 127.0.0.1 localhost <あなたのホストネーム(FQDN)>

In some sorts of environment, however, by the above setting, Meadow might do some queries to a DNS server, which make the system pop-up dial-up network dialog. Either of the following configurations will help you to avoid it.

Set the correct domain name and host name in the Control Panel
When you set a FQDN in the network configuration beforehand, Meadow does not query DNS server.
Set `hosts' file
Windows resolves domain names also by hosts file. Therefore, you can set the FQDN of you host in this file. Usually, `host' file locates at "system32\drivers\etc" of Windows directory. In this file, edit the entry that corresponding to `localhost' like the following. 127.0.0.1 localhost <YOUR HOST NAME (FQDN)>

コンパイル Compilation

この章では、Meadowをソースコードからコンパイルする方法について説明します。 コンパイルには、Microsoft Visual C++もしくは Cygwinが必要です。

まず、ソースアーカイブを適当なディレクトリ配下で展開してください。 > c: > cd \source > tar xzf Meadow-2.00-src.tar.gz 展開されたファイルは、以下のような構成になっています。 c:\source\Meadow-2.00\src\ (メインソース) lib-src\ (ライブラリとツールのソース) nt\ (Meadow用ツールのソースや設定ファイル) info\ (infoファイル) lisp\ (Emacs Lispファイル) etc\ (他のデータ) ...

Microsoft Visual C++を利用する場合 Using Microsoft Visual C++

Microsoft Visual C++は、バージョン6.0および7.0を利用することができます。 コンパイルは、以下の手順で行なってください。 > cd Meadow-2.00\nt [ENTER] > configure.meadow --with-msvc --prefix <インスールディレクトリ名> [ENTER] > nmake bootstrap [ENTER] > nmake all [ENTER] コンパイルが正常に終了したら、以下の手順でインストールしてください。 > nmake install [ENTER]

Cygwinを利用する場合 Using Cygwin

コンパイルは、以下の手順で行なってください。 > cd Meadow-2.00/nt [ENTER] > ./configure.meadow.bat --with-gcc --no-cygwin --prefix <インストールディレクトリ名> [ENTER] > make bootstrap [ENTER] > make all [ENTER] コンパイルが正常に終了したら、以下の手順でインストールしてください。 > make install [ENTER]

開発者 Developers

Meadowは以下の人々によって開発されました。

Here is the list of developers of Meadow:

Eメールアドレスは、<と>で括られているユーザ名の後に @meadowy.orgを追加したものになります。

Here are the list of developers of Meadow:

For e-mail address, append @meadowy.org to the tail of the local name enclosed between < and >.

ライセンス License

基本的にMeadowは基のGNU Emacsのライセンスである、GPL (GNU General Public License) Version 2または(あなたが選ぶならば) その後のバージョン、に従います。

GNU General Public LicenseをMeadowと一緒に受け取っていると思います。 COPYING ファイルを見てください。もし COPYING ファイルがない場合は Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. に手紙を書いてください。

しかし、Meadowのバイナリ配布に含まれているftp.exeは例外です。 このプログラムは Chris Szurgot <szurgot@itribe.net> の許可を得て このパッケージに入っています。 正確なライセンスを知りたいときは、彼に尋ねてください (オリジナルのソースは、"そのまま"で表される、BSDの様式に従って 配布されています)。

そして、Meadowのバイナリ配布に含まれているtelnet.exeはもう一つの例 外です。 このプログラムはTsubakimoto Hiroyaによって移植されました。 このプログラムはTsubakimoto Hiroya <zorac@4000do.co.jp>の許可を得て このパッケージに入っています。 このオリジナルもBSD様式に従って配布されています。

Fundamentally, Meadow follows the original license of GNU Emacs, which is GPL (gnu General Public License) Version 2, or (at your option) any later version.

You should have received a copy of the GNU General Public License along with Meadow(GNU Emacs); see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

But `ftp.exe' included in the binary distribution of Meadow is an exception. This program is allowed to include in the package by Chris Szurgot<szurgot@itribe.net>. If you want to know its correct license, please contact him. (Original source is distributed in the BSD style aka "AS-IS".)

And `telnet.exe' included in the binary distribution of Meadow is another exception. This program is ported by Tsubakimoto Hiroya. This program is allowed to include by Tsubakimoto Hiroya <zorac@4000do.co.jp>. Its original is also distributed in the BSD style.