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

menu system document



かねこです。yak 方面から要望があったので、menu ドキュメントを更
新しました。チェックよろしくお願いします。

#原文のタグ付けが酷くて閉口した。

------>8------------>8------------>8------------>8------------>8
<!doctype debiandoc system>

<!--
 Debian Menu System
 Copyright (C) 1997 Joost Witteveen, Joey Hess, Christian Schwarz;
 released under the terms of the GNU
 General Public License, version 2 or (at your option) any later.
 -->

<book>

<title>Debian Menu System
<author>Joost Witteveen <email/joostje@debian.org/
<author>Joey Hess <email/joey@xxxxxxxxxxx/
<author>Christian Schwarz <email/schwarz@debian.org/
<author>日本語訳: かねこ <email/skaneko@xxxxxxxxxxxx/
<version>version 1.3 (JP 0.1), <date>

<abstract><!--
The <tt/menu/ package was inspired by the <tt/install-fvwm2-menu/
program from the old <prgn/fvwm2/ package. However, <tt/menu/ tries to
provide a more general interface for menu building.  With the
<prgn/update-menus/ command from this package, no package needs to be
modified for every X window manager again, and it provides a unified
interface for both text- and X-oriented programs.
--><tt/menu/ パッケージは昔の <prgn/fvwm2/ パッケージに含まれていた
<tt/install-fvwm2-menu/ 機能に想を得ています。そこから、<tt/menu/
では、より汎用のメニュー作成のためのインターフェースを提供すべく開発を行ないました。
このパッケージの <prgn/update-menus/ コマンドを用いれば、
各パッケージは各種の X のウィンドウマネージャごとの変更を行なう必要はありませんし、文字端末と X
環境に共通したインターフェースを利用することができます。</abstract>


<copyright>Copyright &copy;1997 Joost Witteveen, Joey Hess, Christian Schwarz.
<P>
ライセンス部は、原文と訳の両方を示します。
</P>
<P>
This manual is free software; you may redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
</P>
<P>

	  このマニュアルはフリーソフトウェアです。フリーソフトウェア財団発行の
	   GNU 一般公有使用許諾書 (GPL) バージョン 2
	   が規定する条件の下での再配布および改変を許可します。
	  GPL に関しては、バージョン
	  2 以降のものであればどれを採用してもかまいません。
</P>
<P>

This is distributed in the hope that it will be useful, but
<em>without any warranty</em>; without even the implied warranty of
merchantability or fitness for a particular purpose.  See the GNU
General Public License for more details.
</P>
<P>
この文書は有用であるという期待の下に配布されていますが、<em>無保証です</em>。
販売に、あるいは特定の目的に適するという保証は、明示されているか否かを問わず一切存在しません。
詳しくは GNU 一般公有使用許諾書をご覧下さい。
</P>
<P>

A copy of the GNU General Public License is available as
<tt>/usr/share/common-licenses/GPL</tt> in the Debian GNU/Linux distribution
or on the World Wide Web at
<tt>http://www.gnu.org/copyleft/gpl.html</tt>. You can also obtain it
by writing to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
</P>
<P>
GNU 一般公有使用許諾書のコピーは、Debian GNU/Linux
ディストリビューションでは <file>/usr/share/common-licenses/GPL</file>
として、World Wide Web 上では GNU Public License
<url id="http://www.gnu.org/copyleft/gpl.html"; name=
"The GNU General Public License"> として
入手可能です。また、Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
に請求しても手に入ります。
</P>
<P>

<toc sect>

<chapt><!--Introduction-->はじめに
<P><!--

Before  the  advent  of  <tt/update-menus/,  when  the sysadmin
installed a package onto a debian system, they would  need
to  edit  various  window manager config files to make the
new program show up on, for  example,  <tt/fvwm/'s  menus.  The
menus  could  easily become out of sync with what programs
were actually available, with some menu items that  didn't
work,  and  other  programs  that  lacked  a  menu  entry.
update-menus and debian's menu package aim to  solve  this
problem.
-->
<tt/update-menus/ が開発される前は、システム管理者が Debian
システムにパッケージをインストールした時点で、各種のウィンドウマネージャ
(例えば、<tt/fvwm/ のメニュー)
を設定して新しいプログラムがメニュー中に現れるようにする必要がありました。
今現在どのプログラムが提供されているかという状態とメニューとの間の同期が失われて、
一部のメニュー項目が動かなくなったり、メニューにプログラムが現れなくなったりする状況に簡単になっていました。
<prgn>update-menus</prgn> と Debian
のメニューパッケージはこのようなことが起きないようにしようとするものです。
</P>
<P><!--

<tt/update-menus/  automatically  generates  menus of installed
programs for window managers and other menu  programs.  It
should  be  run whenever a menu file or menu-method file
is changed.  <tt/update-menus/ will be ran  automatically  when
debian  packages  that contain menu files are installed or
removed from the system. Users themselves can add/delete menu items,
and should then run <tt/update-menus/ as that user, thus creating
window-manager startup files that are used in preference to the
systemwide files.
-->
<tt/update-menus/ はインストールされたプログラムのメニューを、
ウィンドウマネージャやその他のメニュープログラム向けに自動的に作成します。
このプログラムは、menu ファイルや、menu
の対象となるファイルが変更された場合には毎回実行する必要があります。
menu ファイルを持つ Debian
パッケージがインストールされたり、削除されたりした際には
<tt/update-menus/ が実行されるようになっています。
ユーザ自身によるメニュー項目の追加や削除も可能で、その際にはユーザにより
<tt/update-menus/ を実行することで、ウィンドウマネージャの初期設定ファイルが作成され、この設定がシステム全体の設定より優先されます。
</P>
<P><!--

One problem we ran into with menu-1.x (and before) was that the
number of entries in any submenu vary wildly: on my system there are
only two entries in /Apps/Editors, while I'm sure that other people
have more like 20 entries there. Many people complained about the
fullness of certain submenus, citing scientific studies or personal
experience to explain why overfull or underfull submenus are a bad
thing. To overcome this, menu-2.0 now can optimize the tree itself,
possibly subdividing for example the /Apps/Editors tree in, say
Editors/Beginner, Editors/Experienced, or whatever, if there are many
entries in that submenu, or maybe even totally removing /Apps/Editors
on systems where there are few editors installed. To be able to do
this, menu follows the information supplied to it in the `hints'
variables (see paragraph below, or the hints chapter).-->
menu-1.x (およびそれ以前)
の問題点の一つは、各サブメニューのエントリ数が大きく異なっていることでした。
例えば、私のシステムでは /Apps/Editors には二つのエントリしかありませんが、
ここに 20 以上のエントリを持つ人もいるに違いありません。
沢山の人が、特定のサブメニューが溢れていることに文句を言っていました。
科学的知見から個人的経験までの、メニューに溢れるほど項目がある、あるいは殆ど項目がないことは悪いことである、という説明を受けました。
これを解決するため、menu-2.0 はツリー構造を最適化できるようになっています。
例えば、/Apps/Editors を例に取れば、このメニューが混み合っている場合、これを
Editors/Beginner や Editors/Experienced
などなど、に更に分割できるようにしました。
また、少数のエディタしかインストールされていない場合、/Apps/Editors
をシステムから削除することも可能になっています。
これを行うため、menu は <tt>hint</tt> 変数 (上記、および
<ref id="hints"> を参照のこと)
で与えられた情報に従うようになっています。
</P>
<P><!--

Each package that needs to add an entry to the menu tree,
includes a menu file <tt>/usr/lib/menu/package-name</tt>. In
this file, it will have one line per menu entry, like this (copied
from <tt>/usr/lib/menu/xbase</tt>):-->
各パッケージは <tt>/usr/lib/menu/package-name</tt>
という名前のファイルを含みます。
このファイルには、メニュー一項目につき一行の記述が含まれています。
こんな風になっています (これは<tt>/usr/lib/menu/xbase</tt>から転記しました)。
<example>
   ?package(xbase):command="/usr/bin/X11/xedit" needs="X11" \
                section="Apps/Editors" title="Xedit" \
                hints="Beginner,Small"
</example><!--
This describes the type of interface Xedit needs (X11),
the menu section the menu entry should be in,
the menu text, and the command that should be executed.
Also, it tells menu that, if /Apps/Editors is overfull,
it could put Xedit in a Apps/Editors/Beginner or Apps/Editors/Small
subsection.

-->
ここには、Xedit が必要とするインターフェースの種類
(X11)、そのメニュー項目をおくべきセクション、メニューの文面、そして実行すべきコマンドが記されています。
また、/Apps/Editors に置かれているものが多すぎる場合、Xedit を
Apps/Editors/Beginner か Apps/Editors/Small サブセクションに入れてもいい、との指定も記載されています。
</P>
<P><!--

Whenever <tt/root/ runs <prgn/update-menus/, it will check all
menu files in <tt>/etc/menu</tt> and <tt>/usr/lib/menu</tt>,
and run the installation scripts that display managers like <prgn/fvwm2/
should provide in <tt>/etc/menu-methods</tt>.
-->
<tt>スーパユーザ権限</tt>で <prgn/update-menus/
が実行されたときには、<tt>/etc/menu</tt> と <tt>/usr/lib/menu</tt>
の下の新しかったり、変更されていたりしたメニューファイルが調べられ、
<prgn/fvwm2/ のようなウィンドウマネージャの提供する
<tt>/etc/menu-methods</tt> 下のインストールスクリプトが実行されます。
</P>
<P><!--

The menu package itself provides a set of default menu files,
for people to get the idea, and to speed up things a bit.
(These files should be incorporated into the package.)
-->
メニューパッケージ自身もいくつかの標準メニューファイルを提供します。
これはどういう風にすればいいのかの例を示すとともに、多少なりとも時間の節約にしてもらうためでもあります
(これらのファイルは各自のパッケージに組み込んでつかうものです)。<P>
</P>
<P><!--

Note, that substantial and incompatible changes took place with the
menu-1.0 release, while substantial features were added by the release
of menu-2.0. This document describes menu-2.0.
Menu-2.0 now doesn't accept the menu-methods written for menu-0.x, but
for most window managers that still have those old menu-methods, I
have put new style menu-methods in /usr/share/doc/menu/examples. Everything
written for menu-1.0 will work with menu-2.0.
-->
気をつけていただきたいのは menu-1.0
リリースの際にかなり大きな変更が行われていること、および menu-2.0
 のリリースの際に大きな機能がいくつも追加されていることです。
このドキュメントは menu-2.0 について説明します。
Menu-2.0 は menu-0.x 向けに書かれた menu-method
を受け付けませんが、殆どのウィンドウマネージャはまだこの古い menu-method
を収録していますので、/usr/share/doc/menu/examples に新しい形式の menu-method
を置きました。menu-1.0 向けに書かれたものは、すべて menu-2.0 でも動きます。
</P>
<P><!--
Most notable changes between menu-0.x and menu-1.x are listed in the file
README.changes in the menu package, the features added by menu-2.0 can
be summarised here: hints, and the menu-2 compat mode. (where lines
are finished by a ';' instead of a newline).-->
menu-0.x と menu-1.x の間の主な変更点については、メニューパッケージに含まれる
README.changes ファイルに挙げてあります。また、menu-2.0
で追加された機能の概要、ヒント、及び menu-2 互換モード
(各行を改行ではなく ';' で終わるようにする) についてもここに記載されています。

<chapt> <heading><!--Menu from the viewpoint of a user-->ユーザの視点から見たメニュー</heading>
<P>
<sect> <heading><!--How/when do the window manger startup files get created?-->
ウィンドウマネージャの初期設定ファイルは、どのように/いつ作成されるのですか?</heading>
<P><!--
Basically, you as user don't need to know any of how and when the
startupfiles are created, but you might be interested to know anyway.
-->
基本的には、初期設定ファイルはどうやって作るのか、いつ作られるのかについて知っておく必要はありません。
でも、好奇心に答えることにしましょう。
</P>
<P><!--
When a package that wants to add something to the menu tree gets
installed, it will run <tt/update-menus/ in it's <tt/postinst/ script.
Update-menus then reads in all menu files in <tt>/etc/menu/</tt>
<tt>/usr/lib/menu</tt> and <tt>/usr/share/menu/default</tt>, and stores
the menu entries of all installed packages in memory. Once that has
been done, it will run the menu-methods in
<tt>/etc/menu-methods/*</tt>, and pipe the information about the menu
entries to the menu-methods on stdout, so that the menu-methods can
read this. Each Window Manager or other program that wants to have
the debian menu tree, will supply a menu-method script in
<tt>/etc/menu-methods/</tt>. This menu-method then knows how to
generate the startup-file for that window manager. To facilitate this
task for the window-manager maintainers, menu provides a
<tt>install-menu</tt> program. This program can generate the
startupfiles for just about every window manager.
-->
メニューツリーに何かを加えるようなパッケージがインストールされる場合、
そのパッケージの <tt/postinst/ スクリプト中で <tt/update-menus/
が実行されます。update-menus は <tt>/etc/menu/</tt>、<tt>/usr/lib/menu</tt>
と <tt>/usr/share/menu/default</tt> の全メニューファイルを読んで、
インストールされている全パッケージのメニューエントリをメモリに展開します。
これが終わった時点で、次に <tt>/etc/menu-methods/*</tt> 中の menu-methods
が呼び出され、メニューエントリに関する情報を <tt/update-menus/
から標準出力経由で渡し、menu-method で読み込みます。
各ウィンドウマネージャや類似のプログラムで Debian
メニューツリーを作成したいものは、<tt>/etc/menu-methods/</tt> に menu-method
スクリプトを用意します。この menu-method スクリプトは、
そのウィンドウマネージャの初期設定ファイルを作成するためのものです。
この際のウィンドウマネージャのメンテナの作業を容易にするため、menu システムでは
<tt>install-menu</tt> プログラムを用意しています。
このプログラムは、全ウィンドウマネージャ向けに、ほぼ妥当なスタートアップファイルを生成できるものです。
</P>
<sect> <heading><!--Tuning of the generated window manager startup files-->
作成されたウィンドウマネージャ初期設定ファイルのチューニング</heading>
<P><!--

In principle this is a very window-manager specific business.
But for all window managers (and others) applies:
-->
原則として、これはウィンドウマネージャ個々に依存する作業ですが、全てのウィンドウマネージャ (および類似プログラム) に共通する事項があります。
</P>
<P><!--
The file to attack is the menu-method in
<tt>/etc/menu-methods/$wm</tt>, with <tt/$wm/ the
name of your window manager. However, if this menu-method
<tt/!include/-s the <tt/menu.h/ file (as it should), you can also edit
that file, to make your changes work for every installed window
manager.
-->
取り組むべきファイルは <tt>/etc/menu-methods/$wm</tt> 中の menu-method で、ここの
 <tt/$wm/ をあなたが使っているウィンドウマネージャ名で置き換えてください。。
但し、この menu-method が <tt/menu.h/ を <tt/!include/-s (取り込んで)
いる場合は (そうなっているのが普通です)、そちらの方も編集することで、
インストールしてある全てのウィンドウマネージャで変更が有効になるようにすることもできます。
</P>
<P><!--
If the menu-method file of your window manager does <tt/!include/ the
<tt/menu.h/ file, and makes proper use of the definitions in there,
then you can look at the comments in that <tt/menu.h/ file to see how
you can make minor adjustments to the look of your menus in your
window manager.
-->
あなたのウィンドウマネージャの menu-method ファイルが <tt/menu.h/ に対して
<tt/!include/ (取り込んで) おり、そこで適切な定義を行っている場合には、
<tt/menu.h/ ファイル中のコメントを参考にして、あなたのウィンドウマネージャでのメニューの見た目に関係した微調整を行う必要があるかをチェックしてください。
</P>
<P><!--
To generally change the menu tree, see the next section:
-->
<sect> <!--Optimization of menu tree: hints--><heading>メニューツリーの最適化: ヒント</heading>
<P><!--
If in the <tt>/etc/menu-methods/*</tt> script appears the definition
<tt/hint_optimize=true/ (actually, that definition should appear in
the <tt/!include/-ed <tt/menu.h/ file), then install-menu will try to
alter the menu tree, to make every submenu have about the optimum
number of menu entries (as specified by <tt/hints_nentry=.../). It
will do that by removing under-full submenus (only if the `parent' of
that submenu isn't itself already overfull), and by possibly creating
new submenus, using hints. Note, however, that the optimization of the
tree takes in principle exponential time, so I've had to speedup the
process, at the expense of occasionally not finding the best tree. So,
the tree you are presented with may not be optimal. For tuning
variables, see the hint_* variables in the last chapter.
-->
<tt>/etc/menu-methods/*</tt> 中に <tt/hint_optimize=true/ という定義がある場合
(実際には、この定義は <tt/!include (取り込み)/ された <tt/menu.h/
中に書くべきですが)、install-menu
はメニューツリーを変更して、各サブメニューのメニューエントリ数を最適化
(<tt/hints_nentry=.../ に従って) しようとします。
次に、エントリ数の少なすぎるサブメニューを削除
(その親のサブメニューが既に一杯でない場合には)
しようとし、それに伴いヒントを用いて新しいサブメニューを作成します。
但し、このツリーの最適化は原理的に指数時間かかる処理であるため、最適なツリーにならないことが時々あることに目をつぶって高速化を図っています。
従って、作成されたツリーは最適ではないことがあります。
これを調整するには、後の章で記載されている hint_* 変数
(<ref id="installmenuvar"> 参照) を参考にしてください。
</P>
<chapt><!--What packages with applications should do -->
アプリケーションパッケージの調理法

<P>
<sect><!--Registering your applications-->アプリケーションを登録しよう
<P><!--
A package should provide a menu file
<tt>/usr/lib/menu/&lt;package-name&gt;</tt> that contains
information about each program it likes to make available in the
menus.
-->
アプリケーションパッケージでは、メニュー中で有効としたい各プログラムについての所定情報を記載したメニューファイルを<tt>/usr/lib/menu/&lt;package-name&gt;</tt> という名称で用意します。
</P>
<P><!--

Here is an example to describe the syntax of such a file:-->
以下に、そのファイルの書式を示すための例を挙げましょう。
<!--
<example>
  ?package(gnuplot):\            specifies what packages need to be installed
     needs=text\                 what kind of terminal this command expects
                                 needs=X11: if this program runs only on X11
                                 needs=text: if it only runs on text terminals
                                           (the window manager should spawn
                                            an xterm or rxvt in this case)
                                 needs=vc: runs only at linux console
                                 needs=wm: this starts another window manager
     section=Apps/Math\          in what section this menu entry should be
     title="Gnuplot"\            the title of the menu entry
                                 (please make it short!)
     command="/usr/bin/gnuplot"  the command to run.
</example>
-->
<example>
  ?package(gnuplot):\	インストールしたいパッケージの名前を記します
     needs=text\     	コマンドの期待する端末種別
  			          needs=X11: X11 環境だけで走るならこのように指定
  			          needs=text: 文字端末だけで走る場合です
				   (ウィンドウマネージャは xterm か
					 rxvt を開きます)
  			          needs=vc: Linux コンソールだけで走る場合
  			          needs=wm: ほかのウィンドウマネージャに変えます
     section=Apps/Math\	メニューエントリを置くセクション
     title=&quot;Gnuplot&quot;\	メニューエントリのタイトル (簡潔に!)
     command=&quot;/usr/bin/gnuplot&quot;  実行するコマンド
</example>
</P>
<P><!--
A program like gnuplot which can be run on X11 as well as on a text
terminal should <em/not/ have an extra entry with <tt/needs=X11/
because it will then be next to impossible to configure the window
managers to spawn <prgn/rxvt/ instead of the default <prgn/xterm/.
-->
gnuplot のように、X11 環境と文字端末環境の両方で実行するようなプログラムでは、
<tt>needs=X11</tt> の追加エントリを <em>書いてはいけません</em>。
というのはそのエントリがあると標準値の <prgn/xterm/ ではなく <prgn/rxvt/
を使うよう設定することがとても困難になるためです。
</P>
<P><!--
On the other hand, if a program (like <prgn/emacs/) can be run as real X
application as well as in a terminal, two entries should be listed,
otherwise the program will always be run in an <prgn/xterm/ (or <prgn/rxvt/).
-->
それに対して、<prgn/emacs/ のように純粋に X 環境で走り、かつ文字端末でも実行できるようなプログラムでは、2つのエントリを併記しなければなりません。
そうしなければ、プログラムは常に <tt>xterm</tt> (または <prgn/rxvt/)
で実行されてしまいます。
</P>
<P><!--
In the menu entry files, you can use "#" as comment (like in shell scripts).
-->
メニューエントリファイルでは、"#" をコメントを記述するのに使えます
(シェルスクリプトと同じです)。
</P>
<P><!--
You should add a line like this to your <tt/postinst/ script
<example>
 if test -x /usr/bin/update-menus; then update-menus; fi
</example>
and the <tt/postrm/ script should get the line
<example>
 if test -x /usr/bin/update-menus; then update-menus; fi
</example>
(that is, the same line in postinst and in postrm).
-->
そして、パッケージの <tt>postinst</tt> と <tt>postrm</tt> に以下の一行を付け加えましょう。
<example>
 if test -x /usr/bin/update-menus; then update-menus; fi
</example>
(つまり、postinst と postrm に同じ行を加えると言うことです)
</P>
<P><!--
<sect>Preferred menu structure -->
<sect>正しいメニュー構成とは
<P><!--
The <em/authoritative list of Debian's menu structure/ is maintained
in the Debian Menu sub-policy document which is part of the Debian
Policy package.
-->
<em>Debian メニュー構成の公式リスト</em> は Debian
メニューサブポリシー文書として管理されており、Debian
ポリシーパッケージに収録されています。
</P>
<P><!--
The menu structure below is included only for convenience and is not authoritative. If it disagree with the structure in the Debian Menu sub-policy, please
send a wishlist bug to the <tt/menu/ package.
-->
以下のリストは便宜のために収録してあるものであり、公式のものではありません。
Debian メニューサブポリシーに不満がある場合には、<tt>menu</tt>
パッケージに対して wishlist 扱いのバグ報告を行ってください。
</P>
<P><!--
Please do <em/not/ put your packages into any other sections.
-->
あなたのパッケージをここにないカテゴリを作って入れないでください。
</P>
<P>【訳注】以下訳は 03-01 時点で最新の Debian policy 3.5.8 パッケージより持ってきました。
</P><P>
<!--
<example>
       Apps            - normal apps
         Databases     - interactive database programs
         Editors       - text editors, word processors
         Emulators     - dosemu, etc.
         Graphics      - image manipulation
         Hamradio      - anything relating to ham radio.
         Math          - gnuplot, octave, oleo, etc.
         Net           - mail, news, web, irc, etc.
         Programming   - debuggers, etc.
         Science       - scientific programs
         Tools         - other tools: xclock, xmag, xman, etc.
         Technical     - technical stuff.
         Text          - text oriented tools other than editors.
         Shells        - bash, ksh, zsh, etc.
         Sound         - sound players and editors
         Viewers       - image viewers
         System        - system administration and monitoring tools
       Games           - games and recreations
         Adventure     - walk around virtual space, zork, MOO's, etc
         Arcade        - any game where reflexes count
         Board         - like gnuchess, pente, gnugo
         Card          - solitaire, etc
         Puzzles       - Stuff from xpuzzles, ...
         Sports        - Games derived from "real world" sports
         Strategy      - games involving long term strategic thinking
         Tetris-like   - games involving falling blocks
         Toys          - oneko, xeyes, etc.
       Help            - programs that provide user documentation
       Screen          - programs that affect the whole screen
         Lock          - xlock, etc.
         Save          - screen savers
         Root-window   - things that fill the root window
       WindowManagers  - X window managers
         Modules       - window manager modules
       XShells         - shells (like xterm, rxvt, ...)
</example>
-->
	<taglist>
	    <!-- <tag>Apps</tag> -->
	    <tag>アプリケーション (Applications)</tag>
	    <item>
	      <!-- <p>normal applications</p>-->
	      <p>普通のアプリケーション</p>
	      <p><taglist>
		  <!-- <tag>Databases</tag> -->
		  <tag>データベース</tag>
		  <item>
		    <!-- <p>interactive database programs</p> -->
		    <p>対話型データベースプログラム</p>
		  </item>
		  <!-- <tag>Editors</tag> -->
		  <tag>エディタ</tag>
		  <item>
		    <!-- <p>text editors, word processors</p> -->
		    <p>テキストエディタ、ワードプロセッサ</p>
		  </item>
		  <tag><!-- Emulators-->エミュレータ</tag>
		  <item>
		    <!-- <p>wine, dosemu, etc.</p>-->
		    <p>wine や dosemu など</p>
		  </item>
		  <tag><!-- Graphics-->グラフィック</tag>
		  <item>
		    <p><!-- image manipulation-->画像操作用プログラム</p>
		  </item>
		  <tag><!-- Hamradio-->ハム</tag>
		  <item>
		    <p><!-- anything relating to ham radio--></p>
		    <p>アマチュア無線関係のものは何でもここ</p>
		  </item>
		  <tag><!-- Math-->数学</tag>
		  <item>
		    <p><!-- math related programs-->数学関連プログラム</p>
		  </item>
		  <tag><!-- Net-->ネットワーク</tag>
		  <item>
		    <!-- <p>network programs that don't fit elsewhere</p> -->
		    <p>他のカテゴリに入らないネットワーク関連プログラム</p>
		  </item>
		  <tag><!-- Programming-->プログラミング</tag>
		  <item>
		    <p><!-- debuggers, etc.-->デバッガなど</p>
		  </item>
		  <tag><!--Science-->科学</tag>
		  <item>
		    <p><!--scientific programs-->科学関連プログラム</p>
		  </item>
		  <tag><!-- Tools-->ツール</tag>
		  <item>
		    <!-- <p>simple apps, like clocks, that perform only one task</p> -->
		    <p>一つのことをするための単純なプログラム (時計など)</p>
		  </item>
		  <tag><!-- Technical-->技術関連</tag>
		  <item>
		    <p><!-- technical stuff -->技術関連プログラム</p>
		  </item>
		  <tag><!-- Text-->テキスト</tag>
		  <item>
		    <!-- <p>text oriented tools other than editors</p>-->
		    <p>エディタ以外のテキスト関連プログラム</p>
		  </item>
		  <tag><!-- Shells-->シェル</tag>
		  <item>
		    <p><!-- bash, ksh, zsh, etc.-->bash, ksh, zsh など</p>
		  </item>
		  <tag><!-- Sound-->サウンド</tag>
		  <item>
		    <!-- <p>sound players and editors</p>-->
		    <p>サウンドプレーヤやエディタ</p>
		  </item>
		  <tag><!--Viewers-->ビューア</tag>
		  <item>
		    <p><!-- image viewers-->画像ビューア</p>
		  </item>
		  <tag><!--System-->システム</tag>
		  <item>
		    <!-- <p>system administration and monitoring tools</p> -->
		    <p>システム管理とモニタ用のツール</p>
		  </item>
		</taglist>
	      </p>
	    </item>
	    <tag><!-- Games-->ゲーム</tag>
	    <item>
	      <p><!-- games and recreations-->ゲームとレクリエーション</p>
	      <p><taglist>
		  <tag><!-- Adventure-->アドベンチャー</tag>
		  <item>
		    <!-- <p>walk around virtual space, zork, MOO's, etc</p>-->
		    <p>仮想空間を動き回るもの:zork や MOO など</p>
		  </item>
		  <tag><!-- Arcade-->アーケード</tag>
		  <item>
		    <!-- <p> any game where reflexes count</p>-->
		    <p>点数を競うゲーム</p>
		  </item>
		  <tag><!-- Board-->ボード</tag>
		  <item>
		    <!-- <p>games played on a board</p>-->
		    <p>盤の上で遊ぶゲーム</p>
		  </item>
		  <tag><!-- Card-->カード</tag>
		  <item>
		    <!-- <p>games involving a deck of cards</p>-->
		    <p>カードを使うゲーム</p>
		    <!-- この言い方はちょっと確信犯かもしれない -->
		  </item>
		  <tag><!-- Puzzles-->パズル</tag>
		  <item>
		    <!-- <p>tests of ingenuity and logic</p>-->
		    <p>頭の冴えと論理を試すもの</p>
		  </item>
		  <tag><!-- Sports-->スポーツ</tag>
		  <item>
		    <!-- <p>games derived from "real world" sports</p>-->
		    <p>実世界のスポーツに関連したもの</p>
		  </item>
		  <tag><!-- Strategy-->戦略</tag>
		  <item>
		    <!-- <p>games involving long term strategic thinking</p>-->
		    <p>長期にわたる戦略思考を要求されるもの</p>
		  </item>
		  <tag><!-- Tetris-like-->落ちもの</tag>
		  <item>
		    <!-- <p>games involving falling blocks</p>-->
		    <p>ブロックが落ちてくるゲーム</p>
		  </item>
		  <tag><!-- Toys-->おもちゃ</tag>
		  <item>
		    <!-- <p>amusements, eye-candy, etc.</p>-->
		    <p>おもちゃ、見て楽しむものなど</p>
		  </item>
		</taglist>
	      </p>
	    </item>
	    <tag><!-- Help-->ヘルプ</tag>
	    <item>
	      <!-- <p>programs that provide user documentation</p> -->
	      <p>ユーザ向けの説明文書やヘルプを表示するプログラム</p>
	    </item>
	    <tag><!-- Screen-->スクリーン</tag>
	    <item>
	      <!-- <p>programs that affect the whole screen</p> -->
	      <p>画面全体に影響するプログラム</p>
	      <p>
		<taglist>
		  <tag><!-- Lock-->画面ロック</tag>
		  <item>
		    <!-- <p>programs to lock the screen</p>-->
		    <p>画面をロックするプログラム</p>
		  </item>
		  <tag><!-- Save-->セーバー</tag>
		  <item>
		    <p><!-- screen savers-->スクリーンセーバー</p>
		  </item>
		  <tag><!-- Root-window-->ルートウィンドウ</tag>
		  <item>
		    <!-- <p>things that fill the root window</p> -->
		    <p>ルートウィンドウを埋めるもの (壁紙の類)</p>
		  </item>
		</taglist>
	      </p>
	    </item>
	    <tag><!-- WindowManagers-->ウィンドウマネージャ</tag>
	    <item>
	      <p><!-- X window managers-->X ウィンドウマネージャ</p>
	      <p>
		<taglist>
		  <tag><!-- Modules-->モジュール</tag>
		  <item>
		    <!--<p> window manager modules</p>-->
		    <p>ウィンドウマネージャモジュール</p>
		  </item>
		</taglist>
	      </p>
	    </item>
	    <tag><!-- XShells-->X 用シェル</tag>
	    <item>
	      <p><!-- xterm and its brethern-->xterm とその兄弟</p>
	    </item>
	  </taglist>
</P>
<P><!--
<sect>Hints-->
<sect>ヒント機能
<P><!--
Hints have been added starting from this version of menu. There needs
to be some discussion about them first, but if you want to try them
out, simply add a hints="Myhint,Herhint,Hishint" definition to the
menu entry file. For example:
-->
ヒント機能はこのバージョンの menu から加えられました。
まず、これについて少々の解説は必要でしょうが、試してみたい場合には単に
hints="Myhint,Herhint,Hishint"
という定義をメニューエントリファイルに加えて下さい。例えば
<example>
?package(emacs20):\
  needs="x11"\
  hints="Big,Expert,Featureful" \
  section="Apps/Editors"\
  title="Emacs 20"\
  command="/usr/bin/emacs20"\
  icon=/usr/share/emacs/20.3/etc/emacs.xbm
</example>
とします。
<!--
The above hints will case <tt/menu/ to consider grouping <tt/emacs/
together with other editors that are marked similar. For example, if
<tt/vi/ on your system has a hints="Small,Expert" definition, and
there are too many entries in the /Apps/Editors menuentry, then menu
will consider creating a /Apps/Editors/Expert submenu, and put both
<tt/vi/ and <tt/emacs/ in it. (of course, only if you have
<tt/hint_optimize=true/ in your /etc/menu-methods/menu.h file).
-->
上記のヒントは、<tt/menu/ に <tt/emacs/ を、他の類似の指定がされたエディタと合わせてグループ化するよう、検討を指示するものです。
例えば、もし <tt/vi/ があなたのシステムにインストールしてあり、ヒントに
<tt>hints="Small,Expert"</tt> と指定してあった場合で、かつ /Apps/Editors
メニューエントリにあまりに多数のエントリがあった場合、menu は
/Apps/Editors/Expert サブメニューを作成して、<tt/vi/ と <tt/emacs/
をそこに格納する検討を行います (もちろん、これは /etc/menu-methods/menu.h
ファイルに、<tt/hint_optimize=true/ との指定がある場合のみです)。

<sect><!--Icons-->アイコンについて
<P><!--
Please, make sure the icons you specify are always available on the
system. So, if you want to have an icon with your menu entry, the
preferred method is to supply the icon with that package. Also, to
prevent the distribution of icons files to turn too much into a mess,
please put all icon files in the directory
<tt>/usr/share/pixmaps</>.
-->
まず、あなたがこれから使用しようとしているアイコンが、
対象となるシステムで使えるものであるようにしておく必要があります。
このため、もしメニューエントリにアイコンを使用したい場合には、
望ましい方法はパッケージと一緒にアイコンを提供することです。
また、アイコンを配布することによるごちゃごちゃを避けるため、アイコンファイルは
<tt>/usr/share/pixmaps</> に入れるようにしてください。
</P>
<P><!--
Debian package maintainers should ensure that any icons they include
for use in the debian menus conform to the following points:-->
Debian パッケージメンテナは Debian メニューに用いるアイコンに関して、以下の規定を守ってください。
<enumlist>
<ITEM><!--The icons should be in xpm format.-->xpmフォーマットとする。
<ITEM><!--The icons may not be larger than 32x32 pixels, although smaller
sizes are ok.-->
大きくとも 32x32 ピクセルとする。それより小さいことはかまわない。
<ITEM><!--The icons should use only the 24 colors present in cmap.xpm,
which comes with the <tt/menu/ package.-->
アイコンは <tt>menu</tt> パッケージ付属の cmap.xpm にある 24 色だけを使う。
<ITEM><!--The background area of the icon should be transparent, if
possible.-->アイコンのバックグラウンドはできるなら透明とすること。
</enumlist><!--

If you have Imagemagick installed, you can make your icons meet requirements
1, 2, and 3 with the following command, but you will need to edit the icon
afterwards to clean it up and make the background transparent:-->
Imagemagick がインストールしてあるなら、1番から3番までの規定は以下のコマンド一発で満たすことができますが、
細かいところの修正を行ったり、バックグラウンドを透明にするため恐らく再編集が必要となるでしょう。
<example>
  $ mogrify -format xpm -geometry 32x32 -map cmap.xpm &lt;filenames&gt;
</example><!--
If you, as a system administrator, don't like the icons in the menus, simply
remove the <tt/$%{icon}/ from the files in
<tt>/etc/menu-methods/$wm</>, and run <prgn/update-menus/.
-->
もしあなたがシステム管理者で、メニューにアイコンがあるなんてけしからんと思うなら、<tt>/etc/menu-methods/$wm</tt>
から <tt>$%{icon}</tt> という記述を取り去って,<tt>update-menus</tt>
を実行してください。
</P>
<P><!--
It's also possible to specify an icon for a sub-menu. However, if each
package would supply its own icons for the sub menus we can never be
sure that the icon files are available. Thus, only the <tt/menu/
package is allowed to specify icons for sub menus. The syntax for this
is:
<example>
  X11 Apps menu/apps /usr/share/pixmaps/icon.xpm "Editors"
</example>
-->
サブメニューにアイコンを指定することも可能です。
ただ,各パッケージが自分のサブメニューのためにアイコンを提供し始めた場合、
<!--上書きされまくるため -->欲しいアイコンファイルが使えるかどうか心もとなくなるため、
メニューパッケージのみにサブメニューのアイコンを指定することを許しています。
書式は以下の通り。
<example>
  X11 Apps menu/apps /usr/share/pixmaps/icon.xpm "Editors"
</example>

</P>
<sect><!--Fvwm's task and title bars-->Fvwm のタスクバーとタイトルバー
<P><!--
The problem with the stuff in the task bar is that all items are
displayed all of the time. So, if 1500 debian packages all were to
register a button, the buttons would quickly fill the screen, making
the exercise useless. The few applications that are considered
important enough to be listed in the task bar usually vary widely on
each system, making it impossible to select a ``happy few'' apps that
are allowed there on every debian system. If you (as a local system
administrator) want your <prgn/fvwm2/ to have a few buttons, you can
install files for those packages in <tt>/menu/$package</>, containing
a menu entry like this:-->
タスクバーにものを置くことの問題は、その全部のアイテムが常時表示されつづけることです。
つまり、1500 の Debian パッケージが全部ボタンを定義したら、画面はたちまちボタンだらけになり、操作どころではなくなります。
タスクバーにおいていいほど重要なアプリケーションというものは、システムごとに大違いであるものですし、
ゆえにどの Debian システムでも適用できる「幸せな幾名かの」
アプリケーションの選択というのは現実的ではないでしょう。
もし、あなたの <tt>fvwm2</tt> に数個のボタンを定義したいなら、まず以下のような定義を記載したボタンに対応するパッケージごとのファイルを
<tt>/usr/lib/menu/$package</tt> におきます。
<example>
  ?Package(xmball):needs=button\
                section=Games/Puzzles\
                icon=path-to-pixmap.xpm\
                title="Xmball"\
                command=/usr/games/xmball
</example>
<!--
Then, do the following:
-->
次に以下を実行します。
<example>
  cd /etc/menu-methods/
  cp fvwm2 fvwm2button
  vi fvwm2button
</example>
<!--
and remove all the &quot;supported&quot; entries, adding the one below. For the rest,leave everything the same except those listed below.-->
そして &quot;supported&quot; エントリを全部削除し,以下を追加します。
他は以下にあるところ以外は修正しません。
<example>
  supported
    button="+ Style \"" $title "\" TitleIcon" $icon " Exec "  $command "\n"
  endsupported
  startmenu:   "AddToTitlebar \n"
  endmenu:     "\n"
  submenutitle:""
  mainmenu:
  genmenu:   "buttondefs.hook"
</example><!--
(Of course regular users (not system administrators) can also specify
`buttonfiles' in their ~/.menu/ directory).-->
(もちろん、一般ユーザ (システム管理者ではない) が自分用の ~/.menu/
ディレクトリに &ldquo;buttonfiles&rdquo; を置くこともできます)
</P>

<chapt><heading><!--What packages with menu managers should do
-->メニューマネージャを持つパッケージの調理法</heading>
<P><!--

Each package containing a <em/menu manager/ (i.e. a program that can
display a menu) should provide a script or program in
<tt>/etc/menu-methods/</> that can read the menu files. This script
will be executed by <prgn/update-menus/, which will feed the menu
entries to be installed to your script via standard input (stdin).
-->
<em>メニューマネージャ</em> (メニューを表示できるプログラム) を含むパッケージは
<tt>/etc/menu-methods/</tt> に、メニューファイルを読むためのスクリプトかプログラムを用意しなければいけません。
このスクリプトは <tt>update-menus</tt> から呼ばれます。
この <tt>update-menus</tt> はインストールされたパッケージのメニューエントリを、
あなたが作成したスクリプトに標準入力から与えます。
</P>
<P><!--
The scripts in <tt>/etc/menu-methods/</> should be configuration
files, so the user can tune the behaviour of the script.
-->
<tt>/etc/menu-methods/</tt>の中のスクリプトは、ユーザがその挙動を制御できるようにするため、設定ファイルでなければいけません。
</P>
<P><!--
Good examples for these scripts for nearly all debian window managers
are included in the <tt/menu/ package in
<tt>/usr/share/doc/menu/examples</>. Note that while working on your script,
you can use the tricks described in "The internals of the Menu
package", section "The update-menus program", to run just your script,
instead of having update-menus run all scripts (can save quite a lot
of time).
-->
Debian で使われる殆どのウィンドウマネージャのための、スクリプトのよい例が
<tt/menu/ パッケージの <tt>/usr/share/doc/menu/examples</> においてあります。
このスクリプトは動作はしますが、<ref id="updatemenudetail"> 節の記載の手法を用いて、update-menu
から全スクリプトを実行するのではなく、自分のスクリプトだけが実行されるようにすることもできます
(こうしておくと、かなりの時間の節約になります)。
</P>
<P><!--
Run <prgn/update-menus/ (if it exists) in your <tt/postinst/ script,
and remove the execute bit from the <tt>/etc/menu-methods/</> script
in the <tt/postrm/ when called with option ``remove.'' The
wm-menu-config script is provided to make all this easier:
-->
(必要に応じて) あなたの <tt>postinst</tt> スクリプトで <tt>update-menus</tt>
を実行しましょう。
また、&quot;remove&quot; オプション付きで実行されたときには、<tt>postrm</tt>
スクリプト中で <tt>/etc/menu-methods/</tt> のスクリプトから実行可能属性
(i.e. xbit) を落としましょう。この処理を容易とするため wm-menu-config
スクリプトが menu パッケージに添付されています。
</P>
<P><!--
Here is an example of such a <tt/postrm/ script using <prgn/sh/:-->
以下に <tt>postinst</tt> スクリプトに書くための例を示します。これは <tt>sh</tt>
スクリプトです
<example>
  #!/bin/sh
  set -e
  wm=twm  #<!--or pdmenu, fvwm, ... whatever manager you're installing-->インストールしてあるウィンドウマネージャ
  case "$1" in
     remove)
         if test -x /usr/sbin/wm-menu-config; then wm-menu-config $wm off;fi
     ;;
     purge)
<!--         #remove the files that install-fvwmgenmenu creates:-->
         #install-fvwmgenmenu が作ったファイルを消す
         (cd /etc/X11/twm/; rm system.twmrc menus.dat menudefs.hook)
     ;;
     upgrade);;
     *)
         echo "postrm called with unknown argument \`$1'" >&2
         exit 0
     ;;
  esac
</example><!--
And here is a good example for a <tt/postinst/ script:-->
そして、<tt>postrm</tt>には、以下のように書きます。
<example>
  #!/bin/sh
  set -e
  wm=pdmenu #<!--or fvwm, ... whatever manager you're installing-->インストールしてあるウィンドウマネージャ

  if test -x /usr/sbin/wm-menu-config; then wm-menu-config $wm on;fi
</example><!--
Please, do not make your package <em/depend/ on the menu package! The
preferred way of telling dpkg that your wm can cooperate with menu is:-->
注意すべきなのは、あなたのパッケージがメニューパッケージに依存するようにしてはいけないことです。
dpkg にあなたの ウィンドウマネージャが menu とうまくやっていけることを教える、
よりよい方法は Suggest を使うことです。
<example>
   Suggests: menu (>1.5)
</example><!--
Please only consider using "depends" if you feel providing reasonable
defaults for systems without menu will make life very difficult for you.
-->
依存を指定する、すなわち &quot;depends&quot;
を使うことを考慮すべきなのは、メニューなしには生きるのがつらくなるほどシステムのあたりまえの既定値である、と感じる場合だけです。
</P>

<chapt><!--How a user can override the menus
-->メニュー設定を上書きするには
<P>

<sect><!--Configuring the menus-->メニュー設定の変更

<P><!--
A user can specify his/her own menu entries in the <tt>~/.menu</> directory.
The files can have an arbitrary file name as long as the new syntax
for the menu entries is used. They should start with either-->
ユーザは自分用のメニューエントリを <tt>~/.menu</>
ディレクトリにもつことができます。
エントリを規定するファイル名は、メニューエントリの新書式を使っている限り任意のものでかまいません。
このファイルでは、最初に以下の2つのいずれかを記述します。
<example>
  ?package(installed-package):
</example>
<!--or-->または
<example>
  ?package(local.mystuff):
</example><!--
if it's something that isn't ``debian-officially'' installed. (Any
``package'' that starts with ``<tt/local./'' is considered installed.)
-->
Debianの流儀を使用しないでインストールしたものに対して後者を使います。
このような、&quot;<tt/local./&quot; で始まる名称の &quot;パッケージ&quot;
は、インストールされているという扱いになります。
</P>
<P><!--
If a user wants to have his/her own menu methods, he/she should create
a <tt>~/.menu-methods</> directory and put all scripts he/she wants to
be run in it. (If <tt>~/.menu-methods</> exists,
<tt>/etc/menu-methods</> will not be searched when a user runs
<prgn/update-menus/).
-->
ユーザが自分用のメニューメソッドを定義したい場合には、<tt>~/.menu-methods</>
ディレクトリを作成して自分の走らせたいスクリプトを <EM>すべて</EM>
そこにおいてください (もし <tt>~/.menu-methods</>
が存在する場合には、一般ユーザが <prgn/update-menus/ を実行する場合
<tt>/etc/menu-methods</> の中のスクリプトは使われません)。</P>
<P><!--

A system administrator should place system-wide menu entries in
<tt>/etc/menu</> (not in <tt>/usr/lib/menu/package</>, since these
files will probably be overwritten by a package upgrade).
-->
システム管理者は、システムで共通のメニューを <tt>/etc/menu</> におきます。
<tt>/usr/lib/menu/package</> ではありません。
こちらは、パッケージのアップグレードの際に恐らく上書きされてしまいます。</P>

<sect><!--Specifying a ``no-menu entry''-->「メニューなし」とするには
<P><!--
If a user wants to remove an entry from the system menu (in
<tt>/etc/menu</>), then this will do the trick:-->
もしユーザがシステムメニュー (<tt>/etc/menu</> に記述されているもの)
からエントリを取り去りたいときには以下のようにします。
<example>
  echo -n  > ~/.menu/package
</example><!--
The zero-size file will tell <prgn/update-menus/ that the
corresponding package should not have any menu entries listed.
-->
大きさ0のファイルによって、<prgn/update-menus/
に対象パッケージがメニューエントリを並べてはいけないことを伝えることができます。
</P>
<sect><!-- Include: (one) other feature-->Include: ほかのファイルのとりこみ
<P><!--
More out of curiosity than anything else, I recently read the KDE
mailing list. In it I saw some discussion about how good the Debian
menu system is (whow, thanks, guys!), but one person found a missing
feature: s/he said you couldn't include other files in the user
menu files. Well, actually, it was already possible, but not very well
documented. To include the contents of file /usr/lib/menu/somefile,
add this to your menu file:-->
気が向いたから、というほかにないのですが、私は最近 KDE メーリングリストを読んでいます。
そこで最近 Debian メニューシステムが如何に優れているかという議論があり
(有難いことです)、そこで一人の参加者が不足している機能、ユーザのメニューファイルに他のファイルをとりこむことができないこと、について述べていました。
実は、ですね、これは既に可能ですが、どうも宣伝が足りなかったようです。
/usr/lib/menu/somefile ファイルの内容を読み込むには、次の一行を足します。

<example>
!include /usr/lib/menu/somefile
</example><!--

Apart form that, it is of course possible to make the menu entry file
executable (<tt>chmod a+x ~/.menu/package</>), and do something like-->
これとは別に、メニューエントリファイルを実行可能にして置いて (つまり、
<tt>chmod a+x ~/.menu/package</>
とする)、以下のようにすることももちろん可能です。
<example>
#!/bin/sh
cat  /usr/lib/menu/somefile
sed -e  "/unwanted_entry/s/?package(/?package(notinstalled./" \
     /usr/lib/menu/someotherfile
</example><!--
to get the same effect, with the added flexibility of being able to
filter out unwanted lines.-->
同様の動作で、更に柔軟性を加えるには不必要な行をフィルタして除去してください。
</P>

<chapt><!--The internals of the menu package-->メニューパッケージの内部構造

<sect id="updatemenudetail"><heading><!--The update-menus program-->update-menus プログラム</heading>
<P><!--

On startup, update-menus checks the file
<tt>/var/run/update-menus.pid</> and the pid in it. If there's an
<prgn/update-menus/ process with that pid it kills it.
If <tt>/var/lib/dpkg/lock</> exists, it forks to background and
returns control to dpkg. The background process checks the
<tt>/var/lib/dpkg/lock</> file approx. every second until the file's
gone.
-->
立ち上がり時に、update-menus は <tt>/var/run/update-menus.pid</tt> ファイルと、
そこに書かれている pid をチェックします。もしその pid を持つ
<tt>update-menus</tt>プロセスが存在した場合,そのプロセスを殺します。
もし <tt>/var/lib/dpkg/lock</tt> ロックファイルが存在していたならば、
<tt>update-menus</tt> は fork してバックグラウンドに回り、制御を dpkg
に返します。バックグラウンドで走っている間そのプロセスは約 1 秒に 1 回
<tt>/var/lib/dpkg/lock</tt>
ファイルを見に行き、そのファイルがなくなるまで待ちます。
</P>
<P><!--
After that, <prgn/update-menus/ reads the menu-entry-files in
the following directories:<tt> /etc/menu /usr/lib/menu /usr/share/menu/default
</>
(if a user runs <prgn/update-menus/, it will add ~/.menu to the
front of that list). For every menu entry line in each file it checks
if the corresponding package is installed (works on file bases for old
syntax menu entry files). The menu entries of all "installed" packages
are added together in one big buffer that is kept in memory (exception:
executable menu entry files are executed, and stdout is placed in
the buffer).
-->
そのあと、<prgn/update-menus/ は以下のディレクトリ中の menu-entry-file を読みます -
<tt>/etc/menu /usr/lib/menu /usr/share/menu/default </tt> です。
もし一般ユーザが <prgn/update-menus を走らせている場合には、
さらに上記のリストの先頭に ~/.menu が加えられます。
各ファイルのメニューエントリの各行毎に、対象となるパッケージがインストールされているかどうかが調べられます
(旧書式のメニューエントリの場合、ファイルベースで調べます)。
全 &quot;インストール済み&quot; のパッケージのメニューエントリは、一つの大きなバッファにまとめ合わされて、メモリ中に保持されます
(例外的に、実行可能なメニューエントリは実行され、その標準出力がバッファに向けられるようになっています)。
</P>
<P><!--
Once it's read all menu entry files, <prgn/update-menus/ starts all
executable scripts in /etc/menu-methods/, hands the scripts the
previously created buffer via stdin. (If <prgn/update-menus/ is ran by
a user, it will first try to run the scripts in ~/.menu-methods, and
only if that directory doesn't exist, it will run the scripts in
/etc/menu-methods).
-->
全メニューエントリファイルを読んだあと、<prgn/update-menus/
は /etc/menu-methods/ 中の実行可能なスクリプトを全て起動し、
標準入力から先に作成したバッファの内容を与えます (<prgn/update-menus/
がユーザ権限で実行されている場合、まず ~/.menu-methods を実行しようとし、
それがない場合に限って /etc/menu-methods 以下のスクリプトが実行されます)。
</P>
<P><!--

Note that as an aid to debugging, one can create a simple script like-->
デバッグの助けのためには、以下のような単純なスクリプトを作成できます。
<example>
#!/bin/sh
cat > /tmp/menu-stdout
</example><!--
and then view the file /tmp/menu-stdout to see exactly what
<tt/update-menus/ handed the menu-methods on their stdin.
-->
これにより、/tmp/menu-stdout を調べれば <tt/update-menus/ が menu-methods
の標準入力に与えた内容を正確に知ることが出来ます。
</P>
<P><!--
This may also be useful for people
writing /etc/menu-method/* scripts: Running <prgn/update-menus/ every
time you changed something in the script may be quite
time-consuming. So, it's much easier to install the above script in
<tt>/etc/menu-methods/</>, run <prgn/update-menus/ once, and then run-->
これは /etc/menu-method/* を書く人にとっても役に立ちます。<prgn/update-menus/
をスクリプトの何かを変更するたびに実行するのは、かなりの時間を要します。
従って、上記のスクリプトを <tt>/etc/menu-methods/</tt> に用意しておき、
<prgn/update-menus/ を一回だけ実行して、
<example>
  /etc/menu-methods/mymethod < /tmp/menu-stdin
</example><!--
(and, if that also takes too long, just try editing /tmp/menu-stdin,
and removing 90% or so of all entries)-->
を実行すればいいのです。
また、これでも時間が掛かりすぎる場合には、/tmp/menu-stdin
を編集して、全エントリの 90% 位を削除してみてください。

<sect id="installmenudetail">
<heading><!--The install-menu program-->install-menu プログラム</heading>
<P><!--

The files <tt>/etc/menu-methods/$wm</> are executable config
files that start with the line-->
<tt>/etc/menu-methods/fvwm*</tt>のファイル群は、先頭行が
<example>
  #!/usr/sbin/install-menu
</example><!--
and thus start that program, handing it the configuration file for the
specific window manager in the first command line argument. This
configuration consists of:-->
で始まる、実行可能な設定のためのスクリプトです。
ですから、プログラムの実行時には、最初のコマンド引数としてこの特定のウィンドウマネージャに対する設定ファイルを指定しなければなりません。
この設定ファイルには以下が記載されます。
<enumlist>
<ITEM><!--the compatibility mode ("menu-1" or "menu-2").-->互換モード ("menu-1" または "menu-2")
<ITEM><!--where the various files should be stored/read.-->
様々なファイルを読み書きすべき場所
<ITEM><!--what "needs" are supported, and what wrapper files should
   be used for each "type".-->
   どのような &quot;needs&quot; (必要な表示機能) がサポートされているか、各
   &quot;type&quot; に対してどのラッパファイルを使うべきか。
</enumlist><!--
See <tt>/usr/share/doc/menu/examples/</> of the menu package for more
comments.
-->
より詳細な説明には、メニューパッケージの<tt>/usr/share/doc/menu/examples/</tt>
をご覧ください。
</P>
<P><!--

Options to <prgn/install-menu/:--><prgn>install-menu</prgn>のオプションは
<example>
  -v              <!--be verbose-->詳細な経過を出す
  -d              <!--Produce loads of debugging output-->デバッグ情報をたくさん出す
</example>
です。
</P>
<P><!--
Some window managers don't support an `include' like statement in
their <tt/system.*rc/ files (like <prgn/m4/ or <prgn/cpp/
preprocessing), they cannot read the <tt/menudefs.hook/ file generated
by install-menu from their
<tt/system.*rc/ config file. To still be able to use them,
<prgn/install-menu/ will copy the file
<tt>$path/$examplercfile</tt> to <tt>$path/$rcfile</tt> (with
<tt/$examplercfile/ and <tt/$rcfile/ defined in the
<prgn/install-menu/ config file, and <tt/$path/ eihter the
<tt/$rootprefix/ or <tt>${HOME}/userprefix</tt>, depending on whether root
or user executed the file.), and replace all occurrences of
``install-menu-defs'' with the <tt/$genmenu/ file it just
generated.
-->
いくつかのウィンドウマネージャは <tt/system.*rc/ ファイルからの `include'
相当機能 (<tt>m4</tt> や <tt>cpp</tt> によるプリプロセッシング)
に対応しておらず、自ウィンドウマネージャの
<tt>system.*rc</tt> 構成ファイルから install-menu により作成された
<tt>menudefs.hook</tt> ファイルを読み出すことができません。
そのようなウィンドウマネージャでも利用できるようにするため、<prgn/install-menu/
は <tt>$path/$examplercfile</tt> ファイルを <tt>$path/$rcfile</tt>
へコピーし (ここで <tt/$examplercfile/ と <tt/$rcfile/ は <prgn/install-menu/
設定ファイルで指定されているもので、<tt/$path/ は root
と一般ユーザのどちらで実行されているのかに従って <tt/$rootprefix/ または
<tt>${HOME}/userprefix</tt> です)、さらに、&quot;install-menu-defs&quot;
が出現する個所を、今作った <tt>$genmenu</tt> ファイルで置き換えます。
<!--
このやり方はエレガントとは言えませんが、一つの <tt>$path/$examplercfile</tt>の環境でも確かに動作します。
(<tt>m4</tt>/<tt>cpp</tt>を使った場合、<tt>system.*rc</tt>に<tt>&quot;include(/etc/X11/*/menudefs.hook)&quot;</tt>が追加されます。
このためユーザは自分の<tt>menudefs.hook</tt>のロードは行ないません)-->
</P>
<P><!--
As an example, consider the following:
<tt>examplercfile=system.foo-wm-example</tt>,
<tt>rcfile=system.foo-wm</tt>, <tt>genmenu=menudefs.hook</tt> and
<tt>rootprefix=/etc/X11/foo-wm</tt>. Now, if <prgn/install-menu/ gets run, it
will first generate the file
<tt>/etc/X11/foo-wm/menudefs.hook</tt>. Next, it will line-by-line
read the file <tt>/etc/X11/foo-wm/system.foo-wm-example</tt> and copy
it's contents to <tt>/etc/X11/foo-wm/system.foo-wm</tt>, replacing
every occurrence of the string <tt>install-menu-defs</tt> by the
contents
of the file <tt>/etc/X11/foo-wm/menudefs.hook</tt>.
-->
例として、以下を検討してください。
<tt>examplercfile=system.foo-wm-example</tt>、
<tt>rcfile=system.foo-wm</tt>、<tt>genmenu=menudefs.hook</tt> と
<tt>rootprefix=/etc/X11/foo-wm</tt>。
この状態で、<prgn/install-menu/ が実行された場合は、まず
<tt>/etc/X11/foo-wm/menudefs.hook</tt> ファイルが作成されます。次に、
<tt>/etc/X11/foo-wm/system.foo-wm-example</tt> が行毎に読まれ、その中身が
<tt>/etc/X11/foo-wm/system.foo-wm</tt> にコピーされます。
その際、<tt>install-menu-defs</tt> という文字列が出てくる毎に、その内容は
<tt>/etc/X11/foo-wm/menudefs.hook</tt> ファイルの内容で置き換えられます。
</P>
<P><!--

To activate the file copying in this way, simply define the
<tt/$examplercfile/ and <tt/$rcfile/ variables in the
<prgn/install-menu/ configuration file
(for example, see <tt>/etc/menu-methods/fvwm</tt>), and make sure there is a
<tt>$path/$examplercfile</> (<tt>$path</> being either
<tt/$rootprefix/, or <tt/$userprefix/.)
-->
このやり方のファイルコピーを行うには、単に
<tt>install-menu</tt> 設定ファイル (たとえば、<tt>/etc/menu-methods/fvwm</tt>
参照) に <tt>$examplercfile</tt> と <tt>$rcfile</tt> の2つの変数を定義し、
<tt>$path/$examplercfile</tt> が存在していることを確認しておくだけです。
この<tt>$path</tt>は、<tt>$rootprefix</tt> か <tt>$userprefix</tt>
のいずれかです。</P>
<P><!--

If you are wringing a menu method, you can use the following to
debug it somewhat easier:-->
menu method を書く場合には、デバッグを少しでも容易にするため以下の手を使うといいでしょう。
<enumlist>
<ITEM><!--use the "cat" menu-method in <tt>/usr/share/doc/menu/examples/cat</>
to create a list of menu entries in <tt>/tmp/menu-stdin</> (put it in
<tt>~/.menu-methods</>, and run <prgn/update-menus/), and then-->
<tt>/usr/share/doc/menu/examples/cat</> 中の &quot;cat&quot; menu-method
を用いて、<tt>/tmp/menu-stdin</>
中のメニューエントリのリストを作成するようにする (これを
<tt>~/.menu-methods</> 中に入れて、<prgn/update-menus/ を実行します)。
そのようにしておけば
  <ITEM><!--you can run just your menu-method with (if it's called wm):-->
  自分のメニューメソッドを (wm (ウィンドウマネージャ) から呼ばれた際に)
  以下のようにして実行できる。
<example>
  ./wm -v < /tmp/menu-stdin
</example><!--
(Use <tt/-v/ for verbose, <tt/-d/ for debugging, and you'll get loads
of output!)-->
 <tt>-v</tt> を使えば詳細な、<tt>-d</tt>
  によってデバッグ用の山のような出力を得ることができます。
</enumlist>
</P>

<sect id="installmenuvar"><heading><!--The install-menu config script definitions-->
install-menu 構成スクリプト定義</heading>
<P><!--
The menu-methods in <tt>/etc/menu-methods/*</> are basically made up of
a lot of ``tag=string'' definitions, explaining <prgn/install-menu/
how to generate a <tt/system.$wmrc/ script. This way you can tune
the look of generated <tt/system.$wmrc/ to your needs.
-->
<tt>/etc/menu-methods/*</tt> のメニューメソッドとは、基本的には
<tt>install-menu</tt> に対して <tt>system.$wmrc</tt>
の作成方法を指定するための多数の &quot;section=string&quot;
定義の繰り返しからなります。
これらによって、必要に応じて <tt>system.$wmrc</tt> の内容を調整するわけです。
</P>
<P><!--
In the following, something like-->以下では、
<example>
  treewalk="c(m)"
</example><!--
means that the treewalk variable by default has the value "c(m)".
-->
のような記述は、treewalk 変数の値が &quot;c(m)&quot; であることを意味します。
</P>
<P><!--
For examples of what these scripts can look like, see
<tt>/usr/share/doc/menu/examples/*</>.
-->
これらスクリプトの例は、<tt>/usr/share/doc/menu/examples/*</>
をご覧ください。</P>
<P><!--
-->
<taglist>
<tag><tt/compat="menu-1"/
<ITEM><!--
Should always be "menu-1". Please, make this the first non-comment
line in the script.-->
常に &quot;menu-1&quot; を使うことを指定します。
これはスクリプト中で、コメントを除いた最初の行に来るようにしてください。
<tag><tt/supported/
<tag><tt/endsupported/
<ITEM><!--
Between the <tt/supported/ and <tt/endsupported/ keywords you define
what "needs" are supported by this window manager. So, the following
is an example for a wm that supports both needs=x11 and needs=text:-->
<tt>supported</tt> と <tt>endsupported</tt> キーワードの間にどのような
&quot;needs&quot; (表示の機能)
がウィンドウマネージャによって提供されているかを定義しなければなりません。
以下に示すものは、needs=x11 と needs=text
の両方をサポートしているウィンドウマネージャの例です。
<example>
  supported
    x11=" ShowEntry(\"" $title "\", \"" $command "\")"
    text="  ShowEntry(\"" $title "\", \"" $command
             "xterm -T " $title " -e " $command "\")"
  endsupported
</example><!--

For the variable substitution (and functions, not shown above), see
the next paragraph. In the above example, you'll notice that for the
menu entries that "need=text", an xterm is spawned for the command to
run in.  Also, as x11 is higher up in the supported list above than text, a
package that supplies both a "needs=x11" and a "needs=text" entry will
have the needs=x11 entry installed, in favour of the needs=text entry.
You can continue lines on the next line with a \, but do make sure you
don't add any spaces after the \.-->
変数置換については(上には記載されていませんが、関数も同様)
<ref id="variablesubst"> を参照ください。
上記の例では、メニューエントリに &quot;need=text&quot;
が記載されている個所で、コマンドを実行するために xterm
が呼ばれていることに気づかれたかと思います。また、x11
の方がサポートリストとして text より上位に指定されているため、
&quot;needs=x11&quot; と &quot;needs=text&quot; の両方を提供するパッケージでは
needs=text エントリにも対応して &quot;needs=x11&quot; がインストールされます。  行の最後に
  \ をおくことによって次の行に続けることができますが、そのときには \ のあとに空白が入らないよう確認ください。
<tag><tt/startmenu=""/
<tag><tt/endmenu=""/
<tag><tt/submenutitle=""/
<ITEM><!--
These define what to print for the beginning/end of a menu, and
how to the print a menu entry that pops up another menu entry.
They are substituted the same way as the "supported" stuff is.
(see next paragraph).
-->
これらはメニューの始めと終わりに何を表示するか、および他のメニューエントリを吹き出し表示するときにどのように表示するかを定義します。
これらは &quot;supported&quot; と同様に変数置換を受けます (<ref id="variablesubst"> 参照)。
<tag><tt/treewalk="c(m)"/
<ITEM><!--
This string defines in what order to dump the <tt/$startmenu/, <tt/$endmenu/,
and <tt/$submenutitle/ (and its children). Each char in the string
refers to:
<example>
    c  : dump children of menu.
    m  : dump this menu's $submenutitles
    (  : dump $startmenu
    )  : dump $endmenu
    M  : dump all $submenutitles of this menu and this menu's children.
</example>-->
この文字列は <tt>$startmenu</tt>、<tt>$endmenu</tt> と
<tt>$submenutitle</tt> のダンプ順序を規定します。
文字列中の各文字は以下の意味を持ちます:
<example>
  c : 子メニューをダンプします
  m : このメニューの $submenutitles (サブメニュータイトル)をダンプします。
  ( : $startmenu をダンプします。
  ) : $endmenu をダンプします。
  M : このメニューと子メニューの全ての $sumbmenutitles をダンプします。
</example><!--
The default is "c(m)". For olvwm, one needs: "(M)"
-->
既定値は &quot;c(m)&quot; です。olvwm
  の場合、&quot;(M)&quot; としなければなりません。
<tag><tt/genmenu=""/
<ITEM><!--
The menu file to generate (usually something like <tt>system."$wm"rc</>).
The file itself may depend on the level or title that is currently
being worked on, like-->
作成しようとしているメニューファイル (通常 <tt>system.&quot;$wm&quot;rc</tt>
といったものです) を指定します。
このファイル自身は現在実行している階層や表題に依存するものであるかもしれません。例えば、<example>
    genmenu="/subdir/" replacewith($section," ","_") "/rc.menu"
</example><!--
(Substitution works just like in the supported stuff, see above).
Note that the files made this way are truncated upon
opening, so if you have a genmenu like the example above, then
your <tt/endmenu=/ will override the startmenu stuff (but you probably
only need one of the two anyway).-->
置換は定義されているものと同様に動作します (<ref id="variablesubst"> 参照)。
注意しておきたいのは、
このようにして作られたファイルは開くときに置換を受けるため、上の例のように
  genmenu がある場合には、あなたの指定した <tt>endmenu=</tt> が startmenu
の指定内容を上書きすることです
(といっても、2つのうちの一方のみが必要になるわけですが)。
</P>
<tag><tt>rootsection="/Debian"</>
<ITEM><!--
the prefix, every <tt/$section/ variable gets.
-->全 <tt/$section/ 変数のもつ Prefix 値です。
</P>
<tag><tt/prerun=""/
<tag><tt/postrun=""/
<ITEM><!--
The commands to run before resp. after the actual generation of the
<tt/menudefs.hook/ (genmenu) file. Commands will be executed by <prgn/sh/.
Example:-->
順に、<tt/menudefs.hook/ (genmenu)
を実際に作成する前、および作成後に実行されるコマンドです。
コマンドは <prgn/sh/ で実行されます。例:
<example>
  prerun="rm -rf " prefix() "/*"
  postrun="killall -USR1 fvwm2"
</example><!--
(Substitution works just like the supported stuff, see below).-->
置換は supported の項などと同様に動作します (<ref id="variablesubst"> 参照)。
<tag><tt/preruntest=""/
<ITEM><!--
Just like prerun, but if the return value of the command is non-zero,
menu will quit.-->
prerun 同様です。違いは、コマンドの戻り値が 0
で無かった場合にはメニューが終了することです。
<tag><tt/also_run=""/
<ITEM><!--
If non-zero, install-menus will, after generating the output files,
also load the file also_run, and use the new assignments to treewalk,
genmenu, etc to generate more output. This second time, variables like
<tt/prerun/ and all of the hint stuff are ignored.
--> 0 でなかった場合には、install-menus は出力ファイルの作成後、also_run
で指定されたファイルをロードし、ツリー探索時やメニュー作成などの、追加の出力作成時に新定義を使用します。
この二回目の出力時には、<tt/prerun/ などの変数と、ヒント類は全て無視されます。
</P>
<P><!--
Note: NOT just like <tt/prerun/ etc: <tt/prerun/ etc start a command
with /bin/sh, <tt/also_run/ doesn't exec any other command, just tells
install-menu to also load anoter binary, and generate the output.
-->
<tt/prerun/ などとは違い (<tt/prerun/ などは /bin/sh でコマンドを実行します)
<tt/also_run/ は他のコマンドを実行せず、install-menu
に単に別のバイナリをロードして出力を作成するように指定するものだ、という点に注意下さい。
</P>
<tag><tt/onlyrunasroot=false/
<tag><tt/onlyrunasuser=false/
<ITEM><!--
If onlyrunasroot is set to true, menu will quit silently when run as
user. Similarly for onlyrunasuser.-->
onlyrunasroot が真だった場合には、一般ユーザで実行されていた場合にはメニューはメッセージなしに終了します。
onlyrunasuser はその逆です。
<tag><tt>preoutput="#Automatically generated file. Do not edit (see /usr/share/doc/menu/html)\n\n"</tt>
<tag><tt>postoutput=""</tt>
<ITEM><!--
Text to put at the beginning resp. end of the generated file ($genmenu).
-->
順に、自動生成されるファイル ($genmenu) の開始と終了をしめす文字列で、既定値は上記の通りです。
<tag><tt/command=""/
<ITEM><!--
A command to run instead of <prgn/install-menus/. This command used
to be needed to get around limitations due to compatibility stuff. But
that compatibility with pre menu-1 stuff has been dropped, and isn't
needed any more.
-->
<tt>install-menus</tt>の代わりに実行するファイルです。
このコマンドは、互換性に関した制約を回避するために必要でしたが、menu-1
以前のものに対する互換性はサポートされなくなったため、このコマンドも必要なくなっています。
</P>
<P><!--
Example:
-->
例:
<example>
  command="cat &gt; /tmp/menu-stdin"
</example>
<tag><tt/hotkeyexclude=""/
<ITEM><!--
Keys not to use for hotkey generation. You can use the same
variables and functions here as in for example the startmenu
sections.
-->
ホットキー作成に使用しないキーの定義です。同じ変数と関数の定義をここと、
startmenu セクションの両方で使うことができます。
</P>
<P><!--
Example:-->
例:
<example>
  hotkeyexclude="q" $section
</example>
<tag><tt/hotkeycase="insensitive"/
<ITEM><!--
can be either "insensitive" or "sensitive". Determines
whether the hotkeys can be of mixed case (<tt/fvwm2/ reads
the hotkeys case-insensitive, <tt/pdmenu/ case-sensitive).
In case of the titles "Xa" and "xb", hotkey case-insensitive will
generate "X" and "b", whereas case-sensitive would generate "X" and
"x".
-->
値は &quot;insensitive&quot; か &quot;sensitive&quot; です。
ホットキーが大文字と小文字を区別するか否かを規定します (例えば、<tt/fvwm2/
は区別がなく、<tt/pdmenu/ は区別します)。
&quot;Xa&quot; や &quot;xb&quot; というタイトルの場合、ホットキーは
大文字と小文字を区別しない場合には &quot;X&quot; と &quot;b&quot;
になりますが、一方、大文字と小文字を区別する場合には &quot;X&quot; と
&quot;x&quot; となります。
</P>
<tag><tt/sort=$sort ":" $title/
<ITEM><!--
Entries within one menu will be alphabetically sorted by whatever
sort returns. So, if you do
<tt/sort=ifelse($command, "1", "0"):$title/, then all submenus will
appear above the commands in a submenu. (A submenu always has
<tt/$command=""/). Or, as Joey Hess writes:-->
一つのメニューの順が使った sort の戻り値に従ってアルファベット順に並べ替えられます。従って、
<tt/sort=ifelse($command, "1", "0"):$title/ とした場合、サブメニューは全てそのメニュー内の個々のコマンドより上に現れます  (サブメニューには <tt/$command=""/
がついているため)。または Joey Hess さん記載の通り:
<example><!--
  You can add another field to the menu items, with whatever name you like,
  let's say it's called priority. Then add this line to
  /etc/menu-methods/*:-->
  メニュー項目に好きな名前のフィールドを加えることが出来ます。
  例えば、priority という名前としましょうか。この場合、/etc/menu-methods/*
  に以下の行を加えます。

  sort=ifelse($priority, $priority, "9")
<!--
  This has the result of sorting things so items with a low priority sort to the
  top, and items with no priority default to priority 9 and sort to the bottom.

  (Note that it compares the strings alphabetically, not numerically.)
-->
  この結果、ソートされた結果は、小さなプライオリティ値を持つものが上に、
  そしてプライオリティ値を持たないものは標準のプライオリティの 9
  になり、一番下に置かれます
  (ここで文字列はアルファベット順で比較されているのであり、数値として比較さ
  れているわけではありません)。
</example>
<tag><tt/rcfile=""/
<ITEM><!--
If the window manager doesn't support an "include filename" or
"read(filename)" statement in it's config file, you can rename
the wm's config file to <tt>system."$wm"rc-menu</>, and insert
a "install-menu-defs" line (without the quotes, or whitespace around
it, and "install-menu-defs" must be the only thing on the line)
in the <tt>system."$wm"rc-menu</> file. This will then get replaced
by the <tt/$genmenu/ file that was just created (see
also <tt/$examplercfile/).
-->
ウィンドウマネージャが &quot;include filename&quot; や
&quot;read(filename)&quot; という書式をサポートしていない場合、前で説明したように問題のウィンドウマネージャの設定ファイルを
<tt>system.&quot;$wm&quot;rc-menu</tt>に変更して、そこに
&quot;install-menu-defs&quot; を挿入する (この行には、引用符と空白抜きの
install-menu-defs だけを書いてください) ことになります。そして
<tt>$genmenu</tt> ファイルによって、今作った <tt>wasrcfile=&quot;&quot;</tt>
が置き換えられることになります
  (<tt/$examplercfile/ の項を参照下さい)。
</P>
<tag><tt/examplercfile=""/
<ITEM><!--
if needed (see <tt/rcfile/), this is the <tt/system.rc"$wm"-menu/
file. In that case, make <tt/rcfile=system.rc"$wm"/.
-->
必要な場合 (<tt/rcfile/ 参照)、これは <tt>system.rc&quot;$wm&quot;-menu</tt>
ファイルです。この場合には <tt>rcfile=system.rc&quot;$wm&quot;</tt>
を作成ください。
</P>
<tag><tt/rootprefix=""/
<ITEM><!--
The prefix to use when running as root (applies to $genmenu, $rcfile,
$examplercfile  and other old cache files)

-->
root として実行している場合の prefix の値です ($genmenu、$rcfile、
$examplercfile やその他の旧キャッシュファイルを参照する際に用います)。
</P>
<P><!-- -->
<tag><tt/userprefix=""/
<ITEM><!--
see <tt/rootprefix/, but when running as user.
-->
一般ユーザとして実行している場合、<tt/rootprefix/ を見ます。
</P>
<tag><tt/process_menudirs="user,system"/
<ITEM><!--
Directories that <tt/install-menu/ will process menu entry files from
(new in menu-2.1.6).
The default is "<tt/user/, <tt/etc/, <tt/debian/, <tt/default/", which means that
<tt/install-menu/ will read files found in <tt>${HOME}/.menu</tt>, then in
<tt>/etc/menu</tt>, then in <tt>/usr/lib/menu</tt>, and last in
<tt>/usr/share/menu/default</tt>. To make life easier, there's an alias for
the <tt/etc/, <tt/debian/, <tt/default/ locations: <tt/system/.
Note that the order in which you specify
the locations doesn't matter.
-->
<tt/install-menu/ が、処理すべきメニューエントリファイルを読み込むディレクトリです
(menu-2.1.6 での新機能)。
標準の値は、"<tt/user/, <tt/etc/, <tt/debian/, <tt/default/" で、これは
<tt/install-menu/ がまず、<tt>${HOME}/.menu</tt> を見て、次に
<tt>/etc/menu</tt>、<tt>/usr/lib/menu</tt>、<tt>/usr/share/menu/default</tt>
の順序で見ていくことを指定しているものです。話を簡単にするため、
<tt/etc/、<tt/debian/、<tt/default/ のディレクトリをまとめて <tt/system/
という別名が付けてあります。ここで指定している順序は他に影響しません。
</P>
<P><!--
To be complete, <tt/user/=<tt>"${HOME}/.menu"</tt>; <tt/etc/=<tt>"/etc/menu"</tt>;
<tt/debian/=<tt>"/usr/lib/menu"</tt>;
<tt/default/=<tt>"/usr/share/menu/default"</tt>; <tt/system/=<tt>"/etc/menu</tt>,
<tt>/usr/lib/menu</tt>, <tt>/usr/share/menu/default"</tt>
-->
完全に書き下しておくと、<tt/user/=<tt>"${HOME}/.menu"</tt>; <tt/etc/=<tt>"/etc/menu"</tt>;
<tt/debian/=<tt>"/usr/lib/menu"</tt>;
<tt/default/=<tt>"/usr/share/menu/default"</tt>; <tt/system/=<tt>"/etc/menu</tt>,
<tt>/usr/lib/menu</tt>, <tt>/usr/share/menu/default"</tt> です。
</P>
<P><!--
If you have a WM which allows an "incremental" user configuration file
(with only the menu entries of the users), then you may want to
specify:
<example>process_menudirs="user, " ifroot(system)
</example>
This will cause <tt/install-menu/ to discard all system menu entry
files if run as normal user, and the user's WM-config file can
<tt/#include/ the system menu definitions from
<tt>/etc/WM/*</tt>. Note that if you do this, you disable an elswehere
in this manual advertised feature: if the user does <tt> true >
~/.menu/package </tt>, then the user doesn't have the menu entry files
from <tt/package/. But as in your case the user's WM-config file
<tt/#include/s the system wide menu defintions, this will not work any more.
-->
もし、使っているウィンドウマネージャに "incremental" (追加可能な)
ユーザ設定ファイルの機能 (少なくともユーザメニューエントリに関して)
がある場合、
<example>process_menudirs="user, " ifroot(system)
</example> としてみたいと思うかもしれません。
このようにした場合、一般ユーザで実行した場合には <tt/install-menu/
は全てのシステムメニューエントリファイルを見ないようになるため、ユーザのウィンドウマネージャ設定ファイルから
<tt>/etc/WM/*</tt> 中のシステムメニュー設定を <tt/!include/ (読み込む)
ことになります。<!-- !include の誤記と思われるので訂正 -->
もし、このようにした場合、本文書で記載の機能は一切使えなくなります。
ユーザが <tt> true &gt; ~/.menu/package </tt> としていた場合、
<tt/package/ からのメニューエントリファイルを使わなくなりますが、
ユーザのウィンドウマネージャ設定ファイルからシステム全体のメニュー設定を読み込んでいた場合、この指定は動作しなくなります。
</P>
<P><!--
The way this feature works may not be the one you at first glance
expect: when the user or system admin runs <tt/update-menus/, it will
read all menu entry files in all directories (user, etc, debian and
default). <tt/update-menus/ then generates one big list of the
concatenated files (whose packages are installed), and hands that file
to the stdin of the <tt/install-menu/ program in
<tt>/etc/menu-methods/*</tt>. That program then reads the
<tt/process_menudirs/ variable, and starts processing the input given
by <tt/update-menus/. And it will discard any menu
entry files if they appear to originate from a directory not specified
in <tt/process_menudirs/. Due to this implementation, it is not
possible for <tt/install-menu/ to read menu entry files outside the
standard user, etc, debian and default directories, and also the order
of the directories in <tt/process_menudirs/ has no effect. Also, as
<tt/update-menus/, when ran under root will not process the user's
(root) home dir, so the <tt/user/ setting in <tt/process_menudirs/
will simply have no effect.
-->
この機能の動きは、最初に受けた印象とは異なっているかもしれません。
ユーザまたはシステム管理者が <tt/update-menus/ を実行した場合、全ディレクトリ
(user、etc、debian と default) の全メニューエントリが読まれます。
次に <tt/update-menus/ は (インストールされているパッケージの)
それら全てをつなげた一つの大きなリストを作成し、そのファイルを
<tt>/etc/menu-methods/*</tt> 中の <tt/install-menu/
プログラムに標準入力経由で渡します。<tt/install-menu/ プログラムは次に
<tt/process_menudirs/ 変数を読み、<tt/update-menus/
から与えられた入力の処理を始めます。この際に、<tt/process_menudirs/
で指定していないディレクトリからのものである、と判断されたメニューエントリは捨てられます。
このような実装になっているため、<tt/install-menu/ が (user、etc、debian と
default) 以外のメニューエントリを読むことは出来ませんし、<tt/process_menudirs/
中のディレクトリの順番はなんの効果も持ちません。また、<tt/update-menus/
は root で実行している場合ユーザ (root)
のホームディレクトリ以下を処理しませんので、<tt/process_menudirs/
の <tt/user/ 設定はなんの効果もありません。
</P>
<P><!--
-->
<tag><tt/repeat_lang=""/
<ITEM><!--
If set to "LOCALE", then menu will automatically translate all title's
to the languages specified by the current LC_LOCALE setting. (LC_ALL,
...). It is intended to expand this to <tt/repeat_lang="en:es:eo:nl"/,
which would repeatedly run install-menus for the various specified
languages. But the latter hasn't yet been implemented.
-->
"LOCALE" の値が設定されていた場合、メニューは自動的に各タイトルを現在の
LC_LOCALE (及び、LC_ALL など) 設定に従って翻訳します。これを
<tt/repeat_lang="en:es:eo:nl"/ とした場合に install-menus
を指定した言語毎に繰り返し実行するよう拡張しようという意図はありますが、
これはまだ実装されていません。
<tag><tt/hint_optimize=false/
<ITEM><!--
If set to true, menu will try to generate an `optimal' tree, using
the variables below. If set to false, menu will keep the sections as
they are specified in the menu entry files (and ignore any hint stuff).
-->
true にセットした場合、メニューは以下の変数を用いて最適なツリーを作成しようとします。
false の場合、menu はメニューエントリファイルに指定したセクションをそのまま用い、ヒント情報は無視します。
<tag><tt/hint_nentry=6/
<ITEM><!--
Optimal number of entries in a submenu. It's a float, so you can set
it to 5.5 if you cannot decide between 5 and 6. Also, values less
than 3 probably don't work very well at the moment.
-->
サブメニュー中のエントリの最適値を指定します。これは浮動小数点値で、5 と 6
のどちらにしていいのか判断がつかなければ 5.5 とすることができます。
また、3 以下に設定した場合、現時点では多分望ましい動作にはならないでしょう。
<tag><tt/hint_topnentry=5/
<ITEM><!--
Same as hint_nentry, but for the top level menu. Often here are other
entries, added by the Window Manager itself (like Exit, Xterm,
whatever) that menu doesn't know about, so that you may want to
instruct menu to put less entries in the top level menu.
-->
hint_nentry 同様ですが、トップレベルのメニュー向けの指定です。
ここにはしばしばウィンドウマネージャ自体が追加したエントリ (例えば Exit
や Xterm など) があり、それについては menu は管理していませんので、
その分だけ少ないエントリ数を指定する必要があるかもしれません。
<tag><tt/hint_mixedpenalty=15.0/
<ITEM><!--
Penalty for `mixed' menus. Mixed menus are those with both submenus
and direct commands in them.
-->
混在メニューに対するペナルティ値を指定します。混在メニューは、サブメニューと直接のコマンド呼び出しの両方を持つメニューのことです。
<tag><tt/hint_minhintfreq=0.1/
<ITEM><!--
Minimal relative frequency for the hints before they are considered.
Internal variable to speed up the tree generation. If you find menu
slow, increase this value (to, say 0.2 or 0.3).
-->
ヒントを考慮する際にヒントを考慮する最小の頻度を指定するものです。
これはツリー生成に対する内部の速度関連の変数です。
メニューが遅く感じられる場合、この値を (例えば 0.2 か 0.3 に)
増やしてみてください。
<tag><tt/hint_mlpenalty=2000/
<ITEM><!--
`max local penalty',
while evaluating the possible trees, menu gives `penalties' for
submenus that don't contain the desired number of submenus. The
penalty is sqrt(n_entry_opt-n_entry), and eventually will be
calculated as a sum of all nodes. But to speed things up, menu will
discard possibilities in which any node has a `local' penalty of more
than hint_mlpenalty. Increase this value if you think menu is
overlooking your favorite tree (also decrease minhintfreq), decrease
this value if you think menu is wasting too much time.
Because of hint_max_ntry, the influence of this variable is nearly
zero nowadays.-->
ローカルのペナルティの最大値です。
可能性のあるメニューツリーを評価する際に、サブメニューが必要な数のサブメニューエントリを持っていなかった場合には
menu ではペナルティを与えています。このペナルティは sqrt(n_entry_opt-n_entry)
で、最終的に全ノードの和として計算されます。
ここで高速化のために、menu
ではどれかのノードのローカルペナルティが、ここで指定した hint_mlpenalty
の値を超えた場合に、そのツリーの探索をうち切ります。
もし、menu による好みのツリーの探索が不十分だと感じた場合には、この値を増やしてください
(同時に minhintfreq も減らしてみてください)。
また、メニューで時間が掛かりすぎていると思う場合には、この値を減らしてください。
hint_max_ntry による制約のため、この変数の影響は現在では殆どありません。
<tag><tt/hint_max_ntry=4/
<ITEM><!--
menu will recursively, for each node, try the hint_max_ntry best local
menu-divisions.
-->
メニューは、各ノードに対して、hint_max_ntry 回最適なローカルメニュー分割を再帰的に試行します。
<tag><tt/hints_max_iter_hint=5/
<ITEM><!--
The search for what hints to use in one menu is rather expensive. But
due to the way things are sorted, menu seems to always find the `best'
match in the first 2% of iterations. Thus, a way to speedup things is
simply to cut of menu searching after `some' iterations are
done. This value controls this, and limits the number of iterations to
5+hint_max_iter_hint*number_of_possible_hints. Set this value to
negative to disable this.
-->
各メニューに対してどのヒントを用いるのかを探索することは比較的コスト高です。
但し、個々のエントリがソートされるやり方のために、メニューは殆どの場合、最初の
2% の繰り返し探索処理の間に最適なものを見つけるようです。
このため、ある程度の探索を行った後はメニュー探索をうち切ることで、高速化が図れます。
この変数はこれを制御するためのもので、探索のループ回数を
5+hint_max_iter_hint*使用可能なヒント数 に抑えます。
この値を負に設定した場合、この機能は無効になります。
<tag><tt/hint_debug=false/
<ITEM><!--
Set to true if you want to see loads and loads of debug output.-->
重み付けと、重み付け関連のデバッグ情報を見たい場合には真にして下さい。
</taglist>

<sect id="hints"><heading>ヒントとメニューツリーの最適化</heading>
<P><!--
The hints actually work in a rather strange way: when
<tt/hint_optimize=true/ then all <tt/$section/ elements are added to
the specified <tt/$hints/ variable, and the order (/Apps/Editors or
/Editors/Apps) of the resulting hints is completely ignored. Then, the
hints for each menu entry are handed to the optimization routine, that
will calculate a reasonable tree for those hints. That tree must
comply with the following:
-->
ヒントは多少妙なやり方で動作しています。
<tt/hint_optimize=true/ との指定があるとき、全ての <tt/$section/
要素が指定された <tt/$hints/ 変数に加えられ、その結果のヒントの出現順序
(/Apps/Editors や /Editors/Apps) は完全に無視されます。
その後、各メニューエントリのヒントは最適化ルーチンで処理され、ヒントを用いた妥当なツリーが計算されます。
このツリーは以下の条件を満たしている必要があります。
</P>
<P><!--
When a user looks for a program "Program" with, say, hints
"Good,Bulky,Heaven", then, while walking through the tree, it should at
every node visited
be clear for the user what submenu to select (or the menu should have
"Program" directly in it). So, the toplevel menu may
look like-->
ユーザが "Program" という名前のプログラムを探そうとしている場合、例えばヒントが
"Good,Bulky,Heaven" となっているとすると、ツリー探索の際にユーザからみてどのサブメニューを選択するべきか (または、"Program" をそのメニュー直下に用意すべきか)
が明らかである必要があります。従って、トップレベルメニューが例えば
<example>
  Good
  Hell
  Microsoft
</example><!--
because then a searcher for a menu entry with hints "Good,Bulky,Heaven"
will know to select the submenu "Good". The toplevel menu may not look
like-->
となっているばあい、これはメニューエントリをヒント "Good,Bulky,Heaven"
に従って探している人が "Good" サブメニューを選ぶべきだと分かるように、
このようなヒントが設定されていると言うことです。
従って、トップレベルメニューは、
<example>
  Good
  Hell
  Heaven
</example><!--
as now it isn't clear whether to visit the Good or the Heaven submenu.
-->
のようなものであってはいけません。Good と Heaven
のどちらのサブメニューを選ぶべきかが明らかではないからです。
</P>
<P><!--
That rule allows usually for many different trees, and the task of the
optimization procedure is to select, in a finite amount of time, the
tree that best matches the user's desire about the optimum number of
menu entries.
-->
この規則により、多くの異なったツリーに対して、選択した最適化の処理作業を妥当な時間に抑え、
ユーザの要求にもっともあったツリー構成を最適な数のメニューエントリ数で実現することが通常の場合可能になっています。
</P>
<sect id="variableandfunctions">
<heading><!--Variables and functions in the install-menu scripts-->install-menu
scripts の変数と関数群</heading>
<P><!--

The supported "needs" definitions and "startmenu=", "endmenu="
and "submenutitle=" are interpreted as follows:
-->
サポート範囲を示す
&quot;needs&quot; と &quot;startmenu=&quot;, &quot;endmenu=&quot;
と &quot;submenutitle=&quot; は以下のように解釈されます。
<!--
<example>
String constants:
  Anything inside double quotes ("") is interpreted as a string, and
  is written verbatim to the output file.
  Stuff like \n, \t, ... will be substituted for their C expansions
  (But not \0xx, currently).

Variables:
  Anything matching $[a-z,A-Z,_]* is interpreted as a variable, and
  the corresponding definition from the menu entry is substituted.

Special variables:
    The following variables are treated in a special way by install-menus,
    either because they are used for other purposes too, or because they
    are modified by install-menus (the ones marked with a "!" are modified
    by install-menus).
-->
<sect1><heading>文字列定数</heading><P>
二重引用符で囲まれた (\&quot;&quot;) という形のものは文字列として扱われ,そのまま出力されます。 \n や
  \t, ...の類は C 言語での扱いと同じです (但し、\0xxの形式は除く)。
  </sect1>
<sect1 id="variablesubst"><heading>変数</heading>
<P>
$[a-z,A-Z,_]* の形のものは変数と解釈され、メニューエントリからの該当する定義は置換されます。
<sect1><heading>特別な変数</heading>
<P>
以下の変数は、install-menus 中で特別な扱いを受けます。
具体的には同時に別の目的に使われるか、install-menus 中で変更を受けるか、です
(&quot;!&quot; がついているものはinstall-menus 中で変更を受けます)。
<P>
<taglist>
<!--
    needs:   used to determine whether the window manager supports this
             menu entry.
    command: If this is undefined, this menu entry is taken as defining
             a sub-menu. (this way you can specify icons of sub-menus).
    title!:  Used for sorting (see section).
             For sub-menu entries (those with empty command), this
             is initialised to the last part of the section.
             Please, keep the title short (two words at maximum).
             The title is for people who already know what programme
             they want to start. See "longtitle" and "description" below
             for longer descriptions.
    sort:    used for sorting (see section). To make sure an entry is
             at the beginning, use something with a low ASCII number,
             like "$". For sorting at the end, use "|"
    section!:Used to determine the section of the menu entry.
             The menu entries that have a empty $command, ie those that
             define a submenu, have $title added to the end of $section
             The menu entries that have a non-empty $command have their
             $section modified to $section/$title, or $section/$sort:$title
             if $sort is defined. The menu entries within one submenu
             are sorted according to $section.
    hotkey!: Modified to reflect what install-menus thinks is the
             most suitable hotkey for this menu entry. The hotkey=
             in the menu entry file is taken as a suggestion, that could
             be overwritten if there is another entry with the same hotkey=.
             To suggest two possible hotkeys for an entry use
             hotkey="ab", with "a" being the most preferred hotkey.-->
  <tag>needs
  <item>対象のウィンドウマネージャが、このメニューエントリをサポートしているかを判定するのに使います。
  </item>
  <tag>command
  <item>これが未定義のとき、このメニューエントリはサブメニューを定義していると解釈されます (これをつかってサブメニューのアイコンを定義します)。
  </item>
  <tag>title!
  <item>並び順の制御に使います (関連節参照)。サブメニューエントリの場合
  (コマンドなし)、この変数はセクションの最後で定義されます。
  表題は努めて短くしてください (多くて2語)。
  表題は、自分の実行しようとしているプログラムのことをすでに知っている人のためのものです。
  以下 &quot;longtitle&quot; と &quot;description&quot; を参照のこと
  </item>
  <tag>sort
  <item>並び順の制御に使います (関連節参照)。
  エントリが最初の方に来るようにするには、ASCII 値で前の方の文字 ('$' など)
  を用いてください。最後の方に持って来るには、'|' を使ってください。
  </item>
  <tag>section!
  <item>メニューエントリのセクションを定義するために使います。
  $command 定義を持たないメニューエントリは、現在の階層を変更するために
  $section の変更が必要です。$command 定義をもつメニューエントリで は、$section
  定義は$section/$title か、$sort が定義されている場合には
  $section/$sort:$title に変更されます。
  一つのセクションしかないメニューエントリは $section
  の値に従い並べ替えられます。
  </item>
  <tag>hotkey!
  <item>install-menus にこのメニューエントリに最も適したホットキーを教えるた めに変更されます。メニューエントリ中の
    hotkey= 定義は参考値としてあつかわれ、同じホットキーを持つほかのエントリに上書きされます。
    2つのホットキーを当該エントリに対して提案するには、hotkey=&quot;ab&quot;
    という書式を、最も望ましいホットキーの定義である &quot;a&quot;
    と合わせて使ってください。
  </item>
 </taglist>
</sect1>
<!--
  Preferred variables:
    The following aren't special for install-menus, but it's nice
    (read: essential) to use the same variables for the same things.
    So, I'll suggest some here. If you want to invent new ones, please
    do so and mail them to me so that I can include them here.

    icon:    The location of the iconfile for this menu entry.
             If you don't have an iconfile, just leave out the icon=
             in the menu entry.
    longtitle: For people that like descriptive titles (about one line)
             It is probably best to include this in your menu entries,
             while the window-managers don't (by default) put it in the
             menus. That way, people who want descriptive titles can
             turn them on, but others don't need to use them.
    description:An even longer description (about 5 lines).
             For example, a description of the documentation in
             the dwww generated html pages.

  Suggested variables:
    The following variables probably shouldn't appear often (or at
    all) in the menu files supplied with packages. They are mostly
    intended for use by local system managers. Nevertheless, it is
    advised that all debian systems use the following variable names:

    visible: Some apps add entries to utmp the utmp file, so that
             "who" and friends know they are running (this is
             especially true for xterms etc). If $visible set
             (to anything other than "" or "none"), xterms etc will
             not write logging info to utmp. (may not work for
             your window manager).
    geometry: For X apps, this will be the size of the (main) window
             that will be created (units in either chars or pixels,
             depending on type of main window (xterm or graphic)).
             If you as package maintainer want to use this, you should
             probably think about setting this variable somewhere
             in an Xresources file.
-->
<sect1><heading>推奨される変数</heading>
<P>
以下は install-menu 専用のものではありませんが、同じ名前の変数は同じ内容としておくことが望ましいものです (本質的とも言う)。
その見地から、いくつかの変数をここで推奨しておきます。
もし新しいものを考案した場合は、私にメールを頂ければここに付け加えることができます。
<P>
 <taglist>
  <tag>icon
  <item>メニューエントリで使うアイコンの置き場所。
  アイコンファイルを用意していないなら、メニューエントリの icon=
    という部分はそのままにしておいてください。
  </item>
  <tag>longtitle
  <item>説明付きのタイトルを好む人むけ (大体1行)。
  これをメニューエントリに含めるのが恐らく最も好ましいやりかたです。但し、
  ウィンドウマネージャは (既定値としては) これをメニューには挿入しません。
  このやり方で、説明付きのタイトルが欲しい人は説明を有効化でき、そうでない人は使わないようにすることができます。
  </item>
  <tag>description
  <item>もう少し長い説明書き (大体5行)。例えば、dwww で作った html
  ページ形式の、ドキュメントの説明。
  </item>
 </taglist>
<sect1><heading>望ましい変数</heading>
<P>
以下の変数は恐らくパッケージ付属のメニューファイルのうちにはあまり (まず)
現れません。
これらは主にローカルなシステムマネージャで使うことを意図したものですが、全ての
Debian システムが (この目的のためには) 以下の変数名を使うことを推奨します。
<P>
 <taglist>
  <tag>visible
  <item>ある種のアプリケーションはロギング情報を utmp
  に書きこみ、あなたや友人が何を実行しているのかわかるようにします (xterm
    などをお考えください)。
    もし $visable が &quot;&quot; や &quot;none&quot;
    以外の値に設定されている場合、xterm
    のようなアプリケーションはロギング情報を utmp に書かないようになります
    (これはウィンドウマネージャによっては動かないかもしれません)。
  </item>
  <tag>geometry
  <item>X アプリケーションでは、これは作成される (主)
  ウィンドウの大きさを示します
  (単位は8キャラクタまたはピクセルで、主ウィンドウの種類 (xterm
    かグラフィックか) に依存します)。
    もしあなたがパッケージメンテナならば、恐らく X
    のリソースファイル中でこの変数を設定するよう考えるでしょう。
  </item>
 </taglist>

<!--
Functions:
  Anything matching [a-z,A-Z,_] is taken as a function (and an error
  is generated if the function doesn't exist). The arguments of the
  functions can be other functions, string constants or variables.-->
<sect1><heading>関数</heading>
<P>
[a-z,A-Z,_] の形式のものは関数として扱われ、その関数が存在しないならエラーになります。
関数の引数は他の関数か、文字列定数か、変数です。
<P>
 <taglist><!--
  prefix()
     returns the current prefix dir: either $rootprefix, or
     $HOME/$userprefix, depending on who runs install-menu
  ifroot($rootarg, $userarg)
     if(getuid()==0) print $rootarg, else print $userarg
  print($arg)
     Same as just $arg; if $arg is empty, generate an error.
  nstring($n, $string)
     write $string $n times. So, nstring(3,"Aa") writes "AaAaAa".
     (Useful in combination with level()).
  esc($arg1,$arg2)
     Print $arg1, but escape all occurrences of characters in $arg2
     with a \. (thus, if arg1="hello", arg2="lo", print "he\l\l\o").
 -->
   <tag>prefix()
   <item>現在の prefix ディレクトリの値を返します。install-menu
   を実行したユーザ依存で、 $rootprefix か $HOME/$userprefix のどちらかです。
   </item>
   <tag>ifroot($rootarg, $userarg)
   <item>getuid() の結果が0なら $rootarg を出力、そうでないなら $userarg
   を出力します。
   </item>
   <tag>print($arg)
   <item>単なる $arg と同じです。$arg が空の場合エラーを発生します。
   </item>
   <tag>nstring($n, $string)
   <item>$string を $n 回出力します。従って、nstring(3,"Aa") とすると
   "AaAaAa" が出力されます (level() と組み合わせて使うと便利です)。
   </item>
   <tag>esc($arg1,$arg2)
   <item>$arg1 を出力しますが、$arg2 に含まれる文字が現れた場合にはエスケープ文字 \ でエスケープ処理を行ないます (どういうことかというと、もし
    arg1=&quot;hello&quot; で arg2= &quot;lo&quot; だったときには
    &quot;he\l\l\o&quot; が出力されます)。
   </item>
<!--
  escwith($arg1, $arg2, $arg3)
     Same as esc, but use $arg3 as escape sequence.

  escfirst($arg1, $arg2, $arg3)
     Same as escwith, but only escapes thirst occurrence of $arg2.

  cppesc($arg1)
     Escape anything that isn't a letter, number or _ with
     $&lt;hex-ascii-code&gt;. So, for example, a '-' is replaced by '$2D'.
     This way, $arg1 can be used as a #define in cpp.

  tolower($arg)
  toupper($arg)
     Returns the argument set in lowercases resp uppercases.

  replacewith($s, $replace, $with)
     Search s for occurrences of characters from string replace, and
     replace them by the corresponding character in $with.
     Example:
      replacewith_string("hello $world, %dir", "$% ", "123")
      returns:   "hello31world,32dir"

  ifempty($arg1, $arg2)
     If $arg1 is empty, print $arg2, otherwise print nothing.
     For compatibility, $arg1="none" is interpreted as empty.-->
   <tag>escwith($arg1, $arg2, $arg3)
   <item>esc と同様の処理ですが,$arg3を escape sequence として用いることが異なります。
   </item>
   <tag>escfirst($arg1, $arg2, $arg3)
   <item>escwith と同様の処理ですが、$arg2 が最初に出てきたときのみ escape 処理を 行ないます。
   </item>
   <tag>tolower($arg)
   <tag>toupper($arg)
   <item>順に引数を小文字/大文字にして返します。
   </item>
   <tag>replacewith($s, $replace, $with)
   <item>文字列引数 $replace 中から引数 $s を探し,それを引数 $with で置き換えます。<P>例:
    replacewith_string(&quot;hello $world, %dir&quot;, &quot;$% &quot;,
    &quot;123&quot;) は、次の値を返します。
    <example>&quot;hello31world,32dir&quot;</example>
   </item>
   <tag>ifempty($arg1, $arg2)
   <item>$arg1 が空なら $arg2 を出力,そうでないなら何も出力しません。
   互換性のため、文字列 &quot;none&quot; は空とみなします。
   </item>
<!--
  ifnempty($arg1, $arg2)
     If $arg1 is not empty, print $arg2.
     For compatibility, the string "none" is seen as empty.

  ifelse($arg1,$arg2,$arg3)
     If $arg1 is non-empty, print $arg2, otherwise $arg3.
     For compatibility, the string "none" is seen as empty.

  ifeq($arg1, $arg2, $arg3)
     If ($arg1==$arg2) then print $arg3
  ifneq($arg1, $arg2, $arg3)
     If ($arg1!=$arg2) then print $arg3
  ifeqelse($arg1, $arg2, $arg3, $arg4)
     If ($arg1==$arg2) then print $arg3 else print $arg4

  cond_surr($arg1, $arg2, $arg3)
     If $arg1 is non-empty print $arg2$arg1$arg3, otherwise print nothing.
     For compatibility, $arg1="none" is interpreted as empty.

  iffile($arg1, $arg2)
     If file $arg1 exists, and can be opened for reading by whoever
     started the current process, return $arg2, otherwise return nothing.-->
   <tag>ifnempty($arg1, $arg2)
   <item>$arg1 が空でないなら $arg2 を出力します。
   互換性のため、文字列 &quot;none&quot; は空とみなします。
   </item>
   <tag>ifelse($arg1,$arg2)
   <item>$arg1 が空でないなら $arg1 を出力,そうでないなら $arg2 を出力します。
   互換性のため、文字列 &quot;none&quot; は空とみなします。
   </item>
   <tag>ifeq($arg1, $arg2, $arg3)
   <item>($arg1==$arg2) なら $arg3 を出力します。
   </item>
   <tag>ifneq($arg1, $arg2, $arg3)
   <item>($arg1!=$arg2) なら $arg3 を出力します。
   </item>
   <tag>ifeqelse($arg1, $arg2, $arg3, $arg4)
   <item>($arg1==$arg2) なら $arg3 を出力、そうでないなら $arg4 を出力します。
   </item>
   <tag>cond_surr($arg1, $arg2, $arg3)
   <item>もし $arg1 が空でないなら、$arg2$arg1$arg3 を出力します。
   空なら何も出力しません。
   互換性のため、文字列 &quot;none&quot; は空とみなします。
   </item>
   <tag>iffile($arg1, $arg2)
   <item>もし $arg1 にあるファイルが存在し、現在のプロセスを実行したユーザの権限で
    open できるなら $arg2 を返します。そうでないときは何も返しません。
   </item>
<!--
  ifelsefile($arg1, $arg2, $arg3)
     If file $arg1 exists, and can be opened for reading by whoever
     started the current process, return $arg2, otherwise return $arg3.

  catfile($arg1)
     Return the contents of file $arg1.

  forall($array, "var", $exec)
     For each element of the column separated array $array, set
     $var to that element, and print $exec.
     Example:
      forall("eo:nl", "lang", " name[" $lang "]=\"" translate($lang, title()) "\"\n")
     will print:
      name[eo]="Mi estas titolo"
      name[nl]="Ik ben een titel"

  parent($arg)
     for $arg a "directory", return parent directory:
     parent("/Debian/Apps/Editors") = "/Debian/Apps".-->
   <tag>ifelsefile($arg1, $arg2,$arg3)
   <item>$arg1 にあるファイルが存在し、現在のプロセスを実行したユーザの権限で
   open できるなら $arg2 を返します。そうでないときは $arg3 を返します。
   </item>
   <tag>catfile($arg1)
   <item>$arg1 の名称のファイルの内容を返します。
   </item>
   <tag>forall($array, "var", $exec)
   <item>$array 中の各要素に対して、その要素を $var にセットして $exec
   を出力します。<P>例:
   <example>forall("eo:nl", "lang", " name[" $lang "]=\"" translate($lang, title()) "\"\n")
   </example>は
   <example>
      name[eo]="Mi estas titolo"
      name[nl]="Ik ben een titel"
   </example>を出力します。
   </item>
   <tag>parent($arg)
   <item>&quot;directory&quot;を引数にとり、上位ディレクトリを返します。例:parent(&quot;/Debian/Apps/Editors&quot;) = &quot;/Debian/Apps&quot;
   </item>
<!--
  basename($arg)
     return the last part of the parent directory:
     basename("/Debian/Apps/Editors") = "Apps".

  stripdir($arg)
     everything after the last slash, i.e. what basename()
     should have returned: stripdir("/Debian/Apps/Editors") = "Editors".

  entrycount()
     the number of entries in this menu.

  entryindex()
     returns relative position of this entry. Start with 0,
     last entry is entrycount() - 1.
     BUG: if sort= anything other than $title, then this
     entryindex() will return incorrect values.

  firstentry($arg)
     return $arg if this is the first entry of this menu
     (that is, entryindex() = 0). Else, return nothing.
-->
   <tag>basename($arg)
   <item>上位ディレクトリの最後の部分を返します。例えば、basename(&quot;/Debian/Apps/Editors&quot;)= &quot;Apps&quot; です。
   </item>
   <tag>stripdir($arg)
   <item>最後のスラッシュの後の部分を返します。例えば、
   stripdir("/Debian/Apps/Editors") = "Editors" です。
   これは basename() が本来返すべきものでしょう。
   </item>
   <tag>entrycount()
   <item>このメニューのエントリ数です。
   </item>
   <tag>entryindex()
   <item>現在のエントリの相対的位置を返します。<P>
   </item>
   <tag>firstentry($arg)
   <item>このメニューの最初のエントリであるとき、$arg を返します
   (つまり、entryindex() = 0 のとき)。そうでなければ、何も返しません。
   </item>
<!--
  lastentry()
     return $arg if this is the last entry in this menu
     (that is, entryindex() = entrycount() -1). Else, return nothing.

  level()
     return nesting of this menu in the total menu tree.

  add($arg1,$arg2)
  sub($arg1,$arg2)
  mult($arg1,$arg2)
  div($arg1,$arg2)
     returns the sum, difference, product or quotient of $arg1 and
     $arg2. Note that the arguments are strings, that are converted
     to integers.
     example: mult("24", entryindex())

  rcfile() examplercfile()  mainmenutitle() rootsection() rootprefix()
  userprefix() treewalk() postoutput() preoutput()
     These functions all output whatever they were defined to be in
     the menu-method file.

  translate($lang, $text)
     translate $text into $lang.
     example:
       translate("eo", "Apps")
     prints:
       Aplikoj-->
   <tag>lastentry()
   <item>このメニューの最後のエントリであるとき、$arg を返します
   (つまり、entryindex() = entrycount() -1 のとき)。
   そうでなければ、何も返しません。
   </item>
   <tag>level()
   <item>現在のメニューの、メニューツリー全体に対してのネストの深さを返します。
   </item>
   <tag>add($arg1,$arg2)
   <tag>sub($arg1,$arg2)
   <tag>mult($arg1,$arg2)
   <tag>div($arg1,$arg2)
   <item>$arg2 の和・差・積・商を返します。もし引数が文字列であった場合には、整数に変換されます。例: mult(&quot;24&quot;,entryindex())
   </item>
   <tag>rcfile()
   <tag>examplercfile()
   <tag>mainmenutitle()
   <tag>rootsection()
   <tag>rootprefix()
   <tag>userprefix()
   <tag>treewalk()
   <tag>postoutput()
   <tag>preoutput()
   <item>これら関数は、menu-method 中の各々の値の設定値を返します。
   </item>
   <tag>translate($lang, $text)
   <item>$text を $lang で指定した言語に翻訳します。例えば、
   <example>
       translate("eo", "Apps")
   </example> は
   <example>
       Aplikoj
   </example> を返します。
   </item>
 </taglist>

<P>
<!--
String constants, variables and functions can be concatenated
by placing them after each other with a space in between, like:-->
文字列定数、変数、関数は空白をはさんで並べることによって連結できます。例えば以下をご覧ください。
&quot;hello&quot; $ifelse($comma, $comma, &quot;sorry&quot;
$period &quot; no comma def&quot;) &quot; world&quot;
<!--</example>-->
</P>
</sect1>
</book>

------>8------------>8------------>8------------>8------------>8
-- 
Seiji Kaneko                              skaneko@xxxxxxxxxxxx
--------------------------- http://plaza25.mbn.or.jp/~efialtes
足跡 = 55A4 898A C765 F20A 1693  7882 579A 3339 D6ED 97E8