Next: , Previous: , Up: abbrev(略語)   [Contents][Index]


31.5 abbrevのテストと編集

M-x list-abbrevs

すべてのabbrev定義のリストを表示します。数引数を指定した場合は、ローカルなabbrevのリストだけを表示します。

M-x edit-abbrevs

abbrevのリストを編集します。定義の追加、変更、削除ができます。

M-x list-abbrevsの出力は以下のようなものです:

various other tables…
(python-mode-skeleton-abbrev-table)
"class" (sys)	    0 "" python-skeleton-class
(lisp-mode-abbrev-table)
"ks"          0    "keymap-set"
(global-abbrev-table)
"dfn"         0    "definition"

(空行に意味はありません。また他のabbrevテーブルは省略しています。)

カッコで括られた名前を含む行は、特定のabbrevテーブルのabbrevにたいするヘッダーです。global-abbrev-tableはすべてのグローバルなabbrevを含み、その他のメジャーモードの後ろについたabbrevテーブルは、モード特有のabbrevを含みます。

それぞれのabbrevテーブルで、空行でない行は1つのabbrevの定義です。行の先頭の単語はabbrevです。その後ろの数字は、そのabbrevが展開された回数です。Emacsはこれを追跡することにより、実際に使用されているabbrevを調べて、ときどきしか使わないものを削除するのを助けます。行の最後の文字列はabbrevの展開結果です。

Some abbrevs are marked with ‘(sys)’. These system abbrevs (see Abbrevs in The Emacs Lisp Reference Manual) are pre-defined by various modes, and are not saved to your abbrev file. To disable a system abbrev, define an abbrev of the same name that expands to itself, and save it to your abbrev file. The system abbrevs have an associated hook function, which is called to perform the abbrev expansion; the name of that function follows the abbrev expansion in the buffer shown by list-abbrevs.

M-x edit-abbrevsを使うと、Emacsバッファーでabbrevのリストを編集することにより、abbrev定義の追加、変更、killができます。リストの書式は、上記で説明した書式を同じです。abbrevのバッファーは*Abbrevs*と呼ばれ、モードはEdit-Abbrevsモードです。このバッファーでC-c C-cをタイプすると、そのバッファーで指定されたabbrev定義がインストールされ、リストに定義されていないabbrevは削除されます。

コマンドedit-abbrevsは、実際にはlist-abbrevsと同じですが、list-abbrevsが単に*Abbrevs*を他のウィンドウに表示するのに比べ、このコマンドはそのバッファーを選択する点が異なります。

This page has generated for branch:master, commit:762705fb24fd90db318f2e51c1e762452d26f7e2 to check Japanese translation.