モード


unset-minor-mode-map

type: Function
arguments: unset-minor-mode-map KEYMAP &optional BUFFER
package: editor
file: builtin.l
マイナーモード用のキーマップを解除します。

SeeAlso: set-minor-mode-map
[ Intro | 目次 | 索引 | 目的別 | モード ]

toggle-over

type: Function
arguments: toggle-over &optional (ARG () SV)
package: editor
file: cmds.l
上書き用マイナーモードを制御します。 [Insert]

  nil以外  上書きモードにする
  nil      挿入モードにする
  省略時   モードをトグルする

SeeAlso: overwrite-mode
[ Intro | 目次 | 索引 | 目的別 | モード ]

set-minor-mode-map

type: Function
arguments: set-minor-mode-map KEYMAP &optional BUFFER
package: editor
file: builtin.l
マイナーモード用のキーマップを設定します。

SeeAlso: unset-minor-mode-map
[ Intro | 目次 | 索引 | 目的別 | モード ]

run-hooks

type: Function
arguments: run-hooks &rest HOOKLIST
package: editor
file: builtin.l
フック変数を順番に実行します。フック変数の詳細はadd-hookを参照して下さい。

  HOOKLIST : フック変数を指定します。複数個並べて書けます。
             並べて書いた順番に実行します。

フック変数の実行には引数をつけることが出来ません。
どうしてもつけたい場合には、run-hook-with-argsを使いましょう。

使用例:
  ;;; c-mode.l
  (run-hooks 'c-mode-hook)

SeeAlso: run-hook-with-args
[ Intro | 目次 | 索引 | 目的別 | モード ]

run-hook-with-args-while-success

type: Function
arguments: run-hook-with-args-while-success HOOK &rest ARGS
package: editor
file: builtin.l
run-hooksと同じように関数を実行します。run-hooksと異なり戻り値
がnon-nilの間だけ順番に実行します。

SeeAlso: run-hook-with-args
[ Intro | 目次 | 索引 | 目的別 | モード ]

run-hook-with-args-until-success

type: Function
arguments: run-hook-with-args-until-success HOOK &rest ARGS
package: editor
file: builtin.l
run-hooksと同じように関数を実行します。run-hooksと異なり戻り値
がnon-nilになるまで順番に実行します。

SeeAlso: run-hook-with-args
[ Intro | 目次 | 索引 | 目的別 | モード ]

run-hook-with-args

type: Function
arguments: run-hook-with-args HOOK &rest ARGS
package: editor
file: builtin.l
run-hooksと同じように関数を実行します。run-hooksと異なり引数を
指定できます。

SeeAlso: run-hooks
[ Intro | 目次 | 索引 | 目的別 | モード ]

quietly-read-abbrev-file

type: Function
arguments: quietly-read-abbrev-file &optional FILE
package: editor
file: abbrev.l
Q.現在、モードを切り替えて且つ abbrev を有効にするには、
  ┌───────────────────────────────┐
  │M-x: sql-mode,                                                │
  │M-x: abbrev-mode                                              │
  │M-x: read-abbrev-file,                                        │
  │Read-abbrev-file: C:/xyzzy/.abbrev_defs                       │
  └───────────────────────────────┘
  のように4段階踏まなくてはなりません。最初の M-x: sql-mode の時か、
  ファンクションキーに割り当てて一度に行う方法はないもんでしょうか?

A.[xyzzy:02017]赤塚慶さん
  .xyzzy に
  ┌───────────────────────────────┐
  │; 起動時に abbrev file を読み込む                             │
  │(quietly-read-abbrev-file)                                    │
  └───────────────────────────────┘
  とかいておくと、  .abbrev_defs を呼んでくれます。

  [xyzzy:02020]亀井哲弥さん
  これに加えて、
  ┌───────────────────────────────┐
  │(add-hook 'ed::*sql-mode-hook* #'(lambda () (abbrev-mode t))) │
  └───────────────────────────────┘
  も書いておけば、M-x sql-mode だけでいけると思います(たぶん)。

SeeAlso: abbrev-mode
[ Intro | 目次 | 索引 | 目的別 | モード ]

overwrite-mode

type: Function
arguments: overwrite-mode &optional (ARG () SV)
package: editor
file: cmds.l
上書き用マイナーモードを制御します。 toggle-over と同じです。

SeeAlso: toggle-over
[ Intro | 目次 | 索引 | 目的別 | モード ]

mode-specific-indent-command

type: BufferLocal
package: editor
indent-regionを参照のこと

使用例:
  ;;; 適当なモードで以下をevalしてみると、
  ;;; "ラベル:" のような行は行頭からになり、それ以外の行は8桁目からになる。
  (progn
    (make-local-variable 'mode-specific-indent-command)
    (setq mode-specific-indent-command
        #'(lambda () (save-excursion
                       (goto-bol)
                       (delete-horizontal-spaces)
                       (or (looking-at "^\\w+:") (indent-to 8))))))

SeeAlso: indent-region
[ Intro | 目次 | 索引 | 目的別 | モード ]

minor-mode-map

type: Function
arguments: minor-mode-map &optional BUFFER
package: editor
file: builtin.l
set-minor-mode-mapで設定したキーマップを取得します。

SeeAlso: set-minor-mode-map
[ Intro | 目次 | 索引 | 目的別 | モード ]

ed::toggle-mode

type: Function
arguments: toggle-mode VAR ARG SV
package: editor
file: cmds.l
マイナーモードの状態を表す変数VARを設定します。
SVがnilならば状態は反転します。
ARGが負数もしくはnilならば無効になります。
ARGが非負数値もしくはnon-nilならば有効になります。

[ Intro | 目次 | 索引 | 目的別 | モード ]

delete-hook

type: Function
arguments: delete-hook HOOK FN
package: editor
file: misc.l
フック変数から関数を削除します。

  HOOK : フック変数のシンボルを指定します。
  FN   : 関数のシンボルを指定します。

SeeAlso: add-hook
[ Intro | 目次 | 索引 | 目的別 | モード ]

define-abbrev-table

type: Function
arguments: define-abbrev-table TABNAME &optional DEFS
package: editor
file: abbrev.l
abbrev-tableを定義します。
(詳細不明)

[ Intro | 目次 | 索引 | 目的別 | モード ]

add-hook

type: Function
arguments: add-hook HOOK FN &optional APPEND
package: editor
file: misc.l
フック変数に関数を追加します。

  HOOK : フック変数のシンボルを指定します。
  FN   : 関数のシンボルを指定します。

フックとは特定の処理においてユーザが望む処理を追加するための仕組みです。
xyzzyには「ユーザが修正したいだろうなぁ」と思うところにフックが仕掛けら
れています。例えば「find-fileするときには何か関数を実行したい」と思った
ら、「find-fileを上書き」したり、「xxx-find-fileを作ったり」するのではな
く、その用途に使えるフック変数がないかどうかを確認しましょう。

下の例はfind-fileする時にfunc1とfunc2を呼び出して何らかの処理をする例です。

  【準備処理】
        ;;; find-fileで呼び出される*before-find-file-hook*に
        ;;; ユーザが作った関数func1とfunc2が呼び出されるように登録する。
        (add-hook '*before-find-file-hook* 'func1)
        (add-hook '*before-find-file-hook* 'func2)

  【find-file実行時】
        ;;; find-fileを実行すると、ファイルの読み込みの前で
        ;;; *before-find-file-hook*に登録されている関数が実行される。
        (find-file ...)
          └(run-hooks '*before-find-file-hook*)
              ├(func1)
              └(func2)

  【後片付け】
        ;;; find-fileで呼び出される*before-find-file-hook*から
        ;;; ユーザが作った関数func1とfunc2を取り除く
        (delete-hook '*before-find-file-hook* 'func1)
        (delete-hook '*before-find-file-hook* 'func2)

なお、フック変数は用途に応じて呼び出され方や戻す値の意味が異なります。注
意しましょう。

使用例:
  ;;; lispmode.l
  (add-hook '*query-kill-buffer-hook* 'kill-scratch-hook)

SeeAlso: delete-hook
[ Intro | 目次 | 索引 | 目的別 | モード ]

abbrev-mode

type: Function
arguments: abbrev-mode &optional (ARG () SV)
package: editor
file: abbrev.l
abbrev-modeを開始します。

使用例:
  (abbrev-mode t)

SeeAlso: quietly-read-abbrev-file
[ Intro | 目次 | 索引 | 目的別 | モード ]

*tail-f-mode-hook*

type: Variable
package: editor
file: tail-f.l
tail-f起動時に実行されます。

SeeAlso: tail-f
[ Intro | 目次 | 索引 | 目的別 | モード ]

*minor-mode-alist*

type: Variable
package: editor
マイナモードがオンのときにモードラインに表示する文字列の連想リストです。
各要素の car はシンボル、 cdr は文字列かシンボルです。

car に指定したシンボルの値が non-nil であって、 cdr が文字列かまたは値が
文字列であるようなシンボルならば、その文字列がモードラインに表示されます。

使用例:
  (pushnew '(edict-mode . "Edict") *minor-mode-alist* :key #'car)

  (pushnew '(async-grep-mode . async-grep-status)
           *minor-mode-alist* :key #'car)

[ Intro | 目次 | 索引 | 目的別 | モード ]

*ime-mode-hook*

type: Variable
package: editor
IMEの切替え時に呼び出されます。

SeeAlso: toggle-ime
[ Intro | 目次 | 索引 | 目的別 | モード ]

*find-file-auto-mode-function*

type: Variable
package: editor
file: files.l
find-file の際にモードを設定するための関数を登録します。

ファイルの先頭のパラメータ(-*- Mode: LISP -*- など)や 
*auto-mode-alist* よりも優先されます。

SeeAlso: *auto-mode-parameter-alist*
[ Intro | 目次 | 索引 | 目的別 | モード ]

*diff-mode-hook*

type: Variable
package: editor
file: diff.l
diff起動時に実行されます。

[ Intro | 目次 | 索引 | 目的別 | モード ]

*command-output-mode-hook*

type: Variable
package: editor
file: process.l
execute-subprocessの中でcommand-output-mode起動時に実行されます。

[ Intro | 目次 | 索引 | 目的別 | モード ]

*auto-mode-parameter-alist*

type: Variable
package: editor
file: files.l
ファイルの先頭のパラメータに対し、実行する関数を指定する alist です。
書式は (文字列 . 関数) となっています。

ファイルの先頭にパラメータ -*- aaa: bbb -*- がある場合、
"aaa" に string-equal な文字列が *auto-mode-parameter-alist* に登録されていれば、
対応する関数を "bbb" を引数にして funcall します。

デフォルト値は
  '(("mode" . find-file-auto-mode)
    ("package" . find-file-buffer-package))
です。

SeeAlso: *find-file-auto-mode-function*
[ Intro | 目次 | 索引 | 目的別 | モード ]

*auto-mode-alist*

type: Variable
package: editor
file: defs.l
モード判定用の連想リストです。(key . datum)の組で登録します。
(string-matchp key filename)がnon-nilになった場合に、
datumをfuncallします。

datumにdecode-auto-modeのプロパティが存在する場合には、バッファを
第一引数にしてdatumをfuncallします。
cc-mode.lのdecode-c-modeを参照

使用例:
  (pushnew '("\\.asp" . basic-mode) *auto-mode-alist* :test 'equal)

[ Intro | 目次 | 索引 | 目的別 | モード ]