モード


*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 | 目次 | 索引 | 目的別 | モード ]

*command-output-mode-hook*

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

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

*diff-mode-hook*

Type: Variable
Package: editor
File: diff.l
diff起動時に実行されます。 

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

*ime-mode-hook*

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

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

*tail-f-mode-hook*

Type: Variable
Package: editor
File: tail-f.l
tail-f起動時に実行されます。 

SeeAlso: tail-f
[ 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 | 目次 | 索引 | 目的別 | モード ]

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
SeeAlso: run-hooks
[ Intro | 目次 | 索引 | 目的別 | モード ]

define-abbrev-table

Type: Function
Arguments: define-abbrev-table TABNAME &optional DEFS
Package: editor
File: abbrev.l
abbrev-tableを定義します。 
(詳細不明) 

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

delete-hook

Type: Function
Arguments: delete-hook HOOK FN
Package: editor
File: misc.l
フック変数から関数を削除します。 

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

SeeAlso: add-hook
[ 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 | 目次 | 索引 | 目的別 | モード ]

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 | 目次 | 索引 | 目的別 | モード ]

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 | 目次 | 索引 | 目的別 | モード ]

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 | 目次 | 索引 | 目的別 | モード ]

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 | 目次 | 索引 | 目的別 | モード ]

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
SeeAlso: run-hook-with-args-while-success
[ 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
SeeAlso: run-hook-with-args-until-success
[ 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
SeeAlso: run-hook-with-args-until-success
SeeAlso: run-hook-with-args-while-success
[ 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 | 目次 | 索引 | 目的別 | モード ]

toggle-over

Type: Function
Arguments: toggle-over &optional (ARG () SV)
Package: editor
File: cmds.l
上書き用マイナーモードを制御します。 
  nil以外  上書きモードにする
  nil      挿入モードにする
  省略時   モードをトグルする

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

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 | 目次 | 索引 | 目的別 | モード ]