バッファ
type: Variable
package: editor
file: buffer.l
バッファ・バー上で右クリックしたときに出てくるコンテキストメニューです。
define-popup-menu で作成されています。(作成は app-menu.l)
type: Variable
package: editor
file: buffer.l
バッファバー上で選択されているバッファです。ただし、バッファバー上の
コンテキストメニューで取得専用くらいしか使用できません。
type: Variable
package: editor
file: buffer.l
デフォルトのバッファバー用コンテキストメニューハンドラです。
setq-default によって定義されている標準の動作は、
*buffer-bar-context-menu-buffer* を定義し、*buffer-bar-context-menu* を
返します。
seealso: *buffer-bar-context-menu*
type: Variable
package: editor
non-nil なら、選択されたバッファがバッファバー上で一番先頭になります。
キーでタブを移動した場合は移動されません。デフォルトは nil です。
(setq *buffer-bar-selected-buffer-to-first* t) とやって、バッファバーを
クリックすれば分かると思います。
type: Variable
package: editor
file: session.l
セッションファイルに保存しておくバッファローカル変数のリストです。
このリストに含まれる変数のバッファごとの値はセッションファイルに保存さ
れ、ロードした際に復元されます。(正確には、バッファローカルになってい
る場合だけそのバッファの情報として保存されます)
seealso: save-session
type: BufferLocal
package: editor
file: lispmode.l
ファイルの先頭のパラメータリストの Package で指定したパッケージ名が保
存されます。
seealso: *auto-mode-parameter-alist*
type: Variable
package: editor
file: defs.l
dabbrev-expand時のundoの方法を設定します。
dabbrev-expandを行なった際に候補が順次挿入されますが...
non-nil dabbrev-expandの直前まで一気に取り消す
nil 途中の挿入過程を順番に取り消す
seealso: undo
seealso: dabbrev-expand
type: Variable
package: editor
file: defs.l
新しくバッファを作成した場合のモードを指定します。
例えば、lisp-modeを指定しておけば、新しく作成したバッファは全てlisp-mode
になります。
使用例:
(setq *default-buffer-mode* 'lisp-mode)
=> lisp-mode
(switch-to-buffer "*new*")
=> #<buffer: *new*>
buffer-mode
=> lisp-mode
type: Variable
package: editor
新規に作ったバッファの改行コードのデフォルト値です。
seealso: buffer-eol-code
seealso: *default-fileio-encoding*
type: Variable
package: editor
新規に作ったバッファの文字エンコーディングのデフォルト値です。
seealso: buffer-fileio-encoding
seealso: *default-eol-code*
type: Variable
package: editor
file: session.l
セッションファイルの保存・ロードの際にファイル名を読むときにデフォルト
で表示されるディレクトリです。
seealso: load-session
seealso: save-session
seealso: ed::session-directory
type: Variable
package: editor
削除をundoした場合のカーソルの位置を制御します。
non-nil 削除範囲の最後尾
nil 削除範囲の先頭
seealso: undo
type: Variable
package: editor
file: buffer.l
next-bufferで次に移動するバッファを、タブでの順番どおりにするか否かを設
定します。もちろんprevious-bufferにも影響します。
t バッファバーでの次のバッファに移動する。
nil どうなるでしょうか?
type: Variable
package: editor
カレントでないウィンドウでもカーソルラインを表示します。
使用例:
(setq *show-cursor-line-always* t)
seealso: toggle-cursor-line
seealso: inverse-cursor-line
type: Variable
package: editor
file: cmds.l
対応する括弧の表示を制御します。括弧に使用する文字は
set-syntax-match で指定します。
non-nil 対応する括弧を表示する
nil 対応する括弧を表示しない
seealso: set-syntax-match
type: BufferLocal
package: editor
ファイル保存時のバックアップファイルの作成方法を指定する変数です。
nil : 元のファイルをリネームしてバックアップファイルを作成してから、
バッファを新しいファイルとして保存します。
元のファイルのハードリンクはバックアップファイルを指すため
ハードリンクは切れます。
デフォルトは nil です。
t : 元のファイルをコピーしてバックアップファイルを作成してから、
バッファをファイルに保存します。元のファイルのハードリンクは
切れません。
:remote : ファイルがリモートにある場合のみ元のファイルをコピーして
バックアップファイルを作成します。
使用例:
;;; ファイル保存時にハードリンクが切れないように
;;; 常にコピーしてバックアップファイルを作成
(setq backup-by-copying t)
=> t
seealso: file-precious-flag
Link: [xyzzy:05968]
type: Function
arguments: backward-sexp &optional (ARG 1) NOERROR
package: editor
file: sexp.l
lisp-modeでS式を1つ戻します。[ESC C-b]
使用例:
(backward-sexp)
seealso: forward-sexp
seealso: down-list
type: Function
arguments: buffer-can-redo-p BUFFER
package: editor
file: builtin.l
バッファがredo可能な状態ならt、そうでなければnilを返します。
seealso: redo
type: Function
arguments: buffer-can-undo-p BUFFER
package: editor
file: builtin.l
bufferがundo可能ならt、そうでなければnilを返します。
seealso: undo
type: Function
arguments: buffer-eol-code &optional BUFFER
package: editor
file: builtin.l
バッファの改行コードを返します。変更する場合はset-buffer-eol-codeを使用
します。
BUFFER: 改行コードを返すバッファ
指定が無ければ現在のバッファ
戻り値:
0 *eol-lf* LF
1 *eol-cr* CR
2 *eol-crlf* CRLF
seealso: set-buffer-eol-code
seealso: *default-eol-code*
type: Function
arguments: buffer-fileio-encoding &optional BUFFER
package: editor
file: builtin.l
バッファの文字エンコーディングを返します。変更する場合には、
set-buffer-fileio-encodingを使用します。
使用例:
(buffer-fileio-encoding)
=> #.(make-iso2022-encoding "jis" ... )
参照:
kanji.l
seealso: set-buffer-fileio-encoding
seealso: *default-fileio-encoding*
type: Function
arguments: buffer-lines &optional BUFFER
package: editor
file: builtin.l
バッファの物理行数を返します。
使用例:
(buffer-lines)
=> 5014
type: Function
arguments: buffer-list &key :buffer-bar-order
package: editor
file: builtin.l
全バッファをリストで返します。
使用例:
(buffer-list)
=>(#<buffer: *Minibuf0*> #<buffer: *grep*> #<buffer: *scratch*> #<buffer: *untitled*> #<buffer: addref.xml> #<buffer: reference.xml>)
(buffer-list :buffer-bar-order t)
=>(#<buffer: *scratch*> #<buffer: reference.xml> #<buffer: *untitled*> #<buffer: addref.xml> #<buffer: *grep*> #<buffer: *Minibuf0*>)
;;ミニバッファの名前はスペースで始まる点に注意
(mapcar #'buffer-name (buffer-list))
=>(" *Minibuf0*" "*grep*" "*scratch*" "*untitled*" "addref.xml" "reference.xml")
seealso: enum-buffers
type: Function
arguments: buffer-local-value BUFFER SYMBOL
package: editor
file: builtin.l
指定されたバッファのローカル変数の値を返します。
BUFFER : ローカルな値を取得したいバッファ
SYMBOL : ローカル変数
使用例:
(buffer-local-value (selected-buffer) 'mode-name)
=> "xmldoc"
seealso: symbol-value
seealso: make-local-variable
seealso: defvar-local
type: Function
arguments: buffer-menu
package: editor
file: buf-menu.l
バッファ一覧を表示します。
一覧の中ではバッファの選択、削除などができます。
type: BufferLocal
package: editor
カレントバッファのモードを格納しています。
使用例:
;;; list-interaction-modeの場合
buffer-mode
=> lisp-interaction-mode
seealso: mode-name
type: Function
arguments: buffer-modified-count &optional BUFFER
package: editor
file: builtin.l
(バッファが修正されたカウント数?)
seealso: buffer-modified-p
type: Function
arguments: buffer-modified-p &optional BUFFER
package: editor
file: builtin.l
バッファ BUFFER が変更を加えられているかどうかを返します。
バッファが変更されていない時は nil を、変更されている時はバッファの編集
回数(buffer-modified-count の値)を返します。
BUFFER が指定されない、もしくは nil が指定された時はカレントバッファの結
果を返します。
seealso: set-buffer-modified-p
seealso: buffer-modified-count
type: Function
arguments: buffer-name BUFFER
package: editor
file: builtin.l
バッファの名前を返します。
BUFFER : 名前を返すバッファを指定します。
使用例:
;;; カレントバッファの名前を返します。
(buffer-name (selected-buffer))
=> "reference.xml"
seealso: create-new-buffer
seealso: get-buffer-create
seealso: rename-buffer
seealso: find-name-buffer
type: Function
arguments: buffer-process BUFFER
package: editor
file: builtin.l
バッファに結び付けられているプロセスを返します。
プロセスはmake-processで作成します。
seealso: make-process
type: Function
arguments: buffer-selector
package: editor
file: builtin.l
バッファ選択ウィンドウを表示します。
バッファ選択されればそのバッファを、そうでなければnilを返します。
seealso: select-buffer
type: Function
arguments: buffer-size &optional BUFFER
package: editor
file: builtin.l
バッファのサイズを返します。2バイト文字があるので buffer-size の返す値と
ファイルサイズは一致しません。
使用例:
(buffer-size)
=> 200170
type: Function
arguments: bufferp OBJECT
package: editor
file: builtin.l
OBJECTがバッファならばt、そうでないならnilを返します。
type: Function
arguments: bury-buffer &optional BUFFER
package: editor
file: builtin.l
other-bufferの候補の最後にします。
seealso: other-buffer
type: Function
arguments: clear-undo-boundary &optional BUFFER
package: editor
file: builtin.l
UNDO情報から直近の境界を削除します。
使用例:
(defun self-insert-space (&optional (arg 1))
(interactive "*")
(when (eq *last-command* 'self-insert-space)
(clear-undo-boundary))
(self-insert-command arg))
(define-key ed::*lisp-mode-map* #\SPC 'self-insert-space)
seealso: undo
seealso: undo-boundary
seealso: kept-undo-information
type: Function
arguments: close-session &optional NOASK (CREATE-NEW t) (FN #'write-file)
package: editor
file: session.l
すべてのフレームと *scratch* を除くすべてのバッファを削除します。
保存していないバッファがあれば保存します。 [C-x 6 k]
ed::*auto-save-session-file* が non-nil であり、現在セッションを開いて
いるならば同時にセッションファイルを上書きします。
NOASK : nil の場合ファイルごとに保存するかどうか確認
CREATE-NEW : non-nil であれば最後に新しいフレームをひとつ作る
FN : ファイルの保存に使われる関数
seealso: ed::auto-save-session-file
type: Function
arguments: close-session-dialog &optional NOASK
package: editor
file: session.l
close-session とほぼ同じですが、変更されたバッファを保存する際に
ダイアログを表示して保存先を指定します。 [C-x 6 K]
NOASK : nil の場合ファイルごとに保存するかどうか確認
seealso: close-session
type: Function
arguments: count-buffers &optional ALL
package: editor
file: builtin.l
全バッファの数を返します。
ALL : " *Completion*"や" *Minibuf0*"等の先頭が空白のバッファも数えるか?
t 先頭が空白のバッファも数える。
nil 先頭が空白のバッファは数えない。
使用例:
;;; バッファの数を数えてみる。
(count-buffers)
=> 20
(count-buffers t)
=> 23
seealso: count-modified-buffers
type: Function
arguments: create-file-buffer FILENAME
package: editor
file: builtin.l
ファイルを参照するバッファを作成して返します。
seealso: get-file-buffer
seealso: create-new-buffer
type: Function
arguments: create-new-buffer NAME
package: editor
file: builtin.l
名前がNAMEのバッファを作成して返します。もしその名前のバッファが存在すれ
ば、name<1>, name<2>...と番号を付けた名前になります。
使用例:
(create-new-buffer "test")
=> #<buffer: test>
(create-new-buffer "test")
=> #<buffer: test<2>>
seealso: create-file-buffer
seealso: get-buffer-create
seealso: *create-buffer-hook*
seealso: find-buffer
seealso: バッファの内部構造
type: Function
arguments: delete-buffer BUFFER
package: editor
file: builtin.l
バッファを削除しますが、kill-bufferと違い対話的に削除するかどうかは聞き
ません。kill-bufferも内部的にはdelete-bufferを使っています。
delete-bufferでは以下の二つのフックが順番に実行されます。
*before-delete-buffer-hook*
delete-bufferを継続するかどうかを制御します。登録された関数が一
つでもnilを返すとdelete-bufferを中止します。
*delete-buffer-hook*
delete-bufferされるバッファで何か処理を行う場合に使用します。
seealso: *before-delete-buffer-hook*
seealso: *delete-buffer-hook*
seealso: kill-buffer
seealso: deleted-buffer-p
type: Function
arguments: deleted-buffer-p BUFFER
package: editor
file: builtin.l
バッファが削除されているかどうかを調べます。
BUFFERにはバッファ型のものしか指定できません。
t 指定されたバッファは既に削除されています。
nil 指定されたバッファは未だ削除されていません。
seealso: delete-buffer
type: Variable
package: editor
file: session.l
セッションの自動保存フラグです。
nil : 自動保存しない
non-nil : 自動保存する
seealso: toggle-session-auto-save
seealso: close-session
type: Function
arguments: enum-buffers FN
package: editor
file: builtin.l
関数がnil以外を返すまでバッファを列挙し続けます。
使用例:
;;; バッファを列挙し続ける。
(enum-buffers #'(lambda (x) (and (yes-or-no-p "~S" x) x)))
=> #<buffer: *Completion*>
seealso: buffer-list
type: Function
arguments: erase-buffer BUFFER
package: editor
file: builtin.l
バッファの内容を削除します。
以下の内容がクリアされます。
・バッファ上のテキスト
・変更フラグ
・修正日付
・restriction
・UNDO情報
type: Function
arguments: fast-scroll-down
package: editor
file: cmds.l
高速に下スクロールします。[C-Up]
seealso: fast-scroll-up
seealso: scroll-window
type: Function
arguments: fast-scroll-up
package: editor
file: cmds.l
高速に上スクロールします。[C-Down]
seealso: fast-scroll-down
seealso: scroll-window
type: BufferLocal
package: editor
ファイル保存時にバックアップファイルを作成するかどうかを指定する変数です。
nil : ファイル保存時にバックアップファイルを作成しません。
t : ファイルを保存するときにバックアップファイルを作成してから
バッファをファイルに保存します。ディスク容量の不足等でファイルの
保存に失敗した場合でも元のファイルを壊すことはありません。
デフォルトは t です。
使用例:
;;; ファイル保存時にバックアップファイルを作成しない
(setq file-precious-flag nil)
=> nil
補足:
xyzzy 0.2.2.244 から利用可能です。
seealso: backup-by-copying
type: Function
arguments: file-visited-p &optional BUFFER
package: editor
file: builtin.l
BUFFER がファイル名を持つとき t となります。
デフォルトでは BUFFER は 現在のバッファです。
type: Function
arguments: find-buffer BUFFER-NAME
package: editor
file: builtin.l
名前がBUFFER-NAMEなバッファが存在すればそのバッファを返します。
存在しなければnilを返します。
使用例:
(find-buffer "*scratch*")
=> #<buffer: *scratch*>
(find-buffer "*hoge hoge*")
=> nil
seealso: find-name-buffer
seealso: get-file-buffer
seealso: get-buffer-create
type: Function
arguments: find-buffer BUFFER-NAME
package: editor
file: builtin.l
名前がBUFFER-NAMEもしくはBUFFER-NAME<数字>なバッファのリストを返します。
存在しなければnilを返します。
使用例:
(find-name-buffer " *TAGS*")
=> (#<buffer: *TAGS*<2>> #<buffer: *TAGS*>)
(find-name-buffer "*hoge hoge*")
=> nil
seealso: find-buffer
seealso: get-file-buffer
seealso: create-new-buffer
type: Function
arguments: forward-sexp &optional ARG NO-ERRORS
package: editor
file: builtin.l
lisp-modeでS式を1つ進めます。[ESC C-f]
使用例:
(forward-sexp)
seealso: backward-sexp
seealso: up-list
type: Function
arguments: get-alternate-file-buffer FILENAME &key (:test #'equalp)
package: editor
file: buffer.l
ファイル名の別名が FILENAME であるようなバッファを返します。
seealso: get-buffer-alternate-file-name
seealso: set-buffer-alternate-file-name
type: Function
arguments: get-buffer-alternate-file-name &optional BUFFER
package: editor
file: builtin.l
バッファBUFFERに設定されたファイル名の別名を取得します。
seealso: set-buffer-alternate-file-name
type: Function
arguments: get-buffer-colors &optional BUFFER
package: editor
file: builtin.l
バッファの色をBGRを表す数値をベクタで返します。
使用例:
(ed:get-buffer-colors)
=> #(0 16777215 12639424 16777215 16750899 16711680 8421376 8388736 32768 128 255 8388736 0 128 0 0 0 15790320)
補足:
xyzzy 0.2.2.236 から利用可能です。
seealso: set-buffer-colors
type: Function
arguments: get-buffer-create NAME
package: editor
file: buffer.l
指定した名前のバッファを返します。名前を指定しますが、同じ名前のバッファ
が既にあればそれを返します。無ければcreate-new-bufferで新しく作ります。
switch-to-bufferも良く似た動きをしますが、switch-to-bufferは
get-buffer-createを用いて実装されています。
NAME : バッファの名前
使用例:
;;; *calc*がなければ作成する。
(get-buffer-create "*calc*")
=> #<buffer: *calc*>
seealso: create-new-buffer
seealso: find-buffer
seealso: new-file
seealso: switch-to-buffer
seealso: バッファの内部構造
type: Function
arguments: get-buffer-file-name &optional BUFFER
package: editor
file: builtin.l
バッファが参照しているファイルのフルパスを返します。
ファイルを参照していなければnilを返します。
BUFFER : ファイルのフルパスを返すバッファを指定します。
使用例:
;;; カレントバッファのファイルのフルパスを返します。
(get-buffer-file-name)
=> "C:/xyzzy/site-lisp/xmldoc/reference.xml"
seealso: set-buffer-file-name
seealso: get-file-buffer
type: Function
arguments: get-file-buffer FILENAME
package: editor
file: builtin.l
ファイルを表示しているバッファを返します。
なければnilを返します。
使用例:
(get-file-buffer "not-documented.xml")
=> #<buffer: not-documented.xml>
seealso: get-buffer-file-name
type: Function
arguments: get-next-buffer &optional BUFFER REVERSE TAB-ORDER INTERNAL
package: editor
file: builtin.l
次のバッファを返します。
BUFFER :
:top 先頭のバッファを返します。
:bottom 最後尾のバッファを返します。
バッファ 指定したバッファの次のバッファを返します。
REVERSE : non-nil なら一つ前のバッファを返します。
TAB-ORDER : nil ならバッファの生成順で、non-nil ならバッファタブ順で
次のバッファを返します。
INTERNAL : non-nil なら非表示バッファも含めて次のバッファを返します。
seealso: next-buffer
seealso: buffer-list
type: Function
arguments: get-selection-type
package: editor
file: builtin.l
バッファの選択状態を返します。
nil 選択なし、
1 行モード選択状態
2 文字モード選択状態
3 矩形選択状態
seealso: set-selection-type
seealso: start-selection
type: Function
arguments: goto-last-modified-line
package: editor
file: cmds.l
現在のバッファで最近変更された行の先頭に移動します。
seealso: last-modified-point
seealso: exchange-point-and-mark
type: Function
arguments: insert-buffer BUFFER
package: editor
file: buffer.l
指定されたバッファの内容を現在のバッファに挿入します。
seealso: insert-buffer-substring
seealso: insert-file
seealso: insert-file-contents
seealso: insert
type: Function
arguments: insert-buffer-substring BUFFER &optional FROM TO
package: editor
file: buffer.l
指定されたバッファの内容を現在のバッファに挿入します。
リージョンが指定されていればその領域を挿入します。
seealso: insert-buffer
seealso: insert
type: Function
arguments: insert-file-contents FILENAME &optional VISIT-P OFFSET SIZE
package: editor
file: builtin.l
ファイルの内容をカーソル位置に挿入します。
FILENAME : 挿入するファイル名
VISIT-P : ファイルを挿入後の動作を指定します。
t 変更フラグ・UNDO情報のクリア、ファイルの日付の変更等を行います。
nil 特に何もしません。
OFFSET : 挿入するオフセット
SIZE : 挿入する長さ
使用例:
;;; 簡単なテンプレートの挿入例
;;; site-lisp/template.lを用意しておくこと
(defun insert-template ()
(and (get-buffer-file-name)
(not (file-exist-p (get-buffer-file-name)))
(insert-file-contents (merge-pathnames "site-lisp/template.l" (si:system-root)) t)
(message "template inserted")))
=> insert-template
(add-hook '*lisp-mode-hook* 'insert-template)
=> (insert-template lisp-load-keyword-file)
seealso: insert-file
type: BufferLocal
package: editor
undo 可能回数を指定する変数です。
<integer> : 指定回数分の undo 情報を保持します。
上記以外 : undo 情報を保持しません。(undo できません。)
使用例:
;;; 現在開いているファイルではundoできないようにします。
(make-local-variable 'kept-undo-information)
=> t
(setq kept-undo-information nil)
=> nil
seealso: undo
seealso: undo-boundary
seealso: clear-undo-boundary
seealso: setup-temp-buffer
type: Function
arguments: kill-all-buffers &optional NOT-VERBOSE
package: editor
file: buffer.l
全バッファをkill-bufferします。
NOT-VERBOSEで保存するか否かを指定できます。
NOT-VERBOSE :
t 何も確認せずに保存しようとします。
nil 変更があるバッファは確認のダイアログ表示されます。
type: Function
arguments: kill-all-local-variables
package: editor
file: builtin.l
全てのローカル変数が現在のバッファで独自の値を持てないようにします。
setq-defaultされていなかったローカル変数は参照できなくなります。
使用例:
;;; defvar-localした変数の値を設定してからkillしてみる。
(defvar-local abc 123) => abc
(setq abc 456) => 456
abc => 456
(kill-all-local-variables) => t
abc => 123
type: Function
arguments: kill-buffer BUFFER
package: editor
file: buffer.l
バッファを削除します。[C-x k]
ただし、kill-bufferはバッファが変更されていると削除していいかどうか聞
いてきます。マクロ中で使う際には、delete-bufferを使ったほうがいいでし
ょう。(ユーザに聞かずにいきなり削除します)
また、*query-kill-buffer-hook*にフック関数を設定すると、独自の用件でバ
ッファの破棄を確認できます。
使用例:
;;; 現在のバッファを削除する。
(kill-buffer (selected-buffer))
=> t
seealso: delete-buffer
seealso: deleted-buffer-p
seealso: kill-selected-buffer
seealso: *query-kill-buffer-hook*
seealso: *kill-buffer-kills-scratch*
type: Function
arguments: kill-local-variable SYMBOL
package: editor
file: builtin.l
SYMBOLが現在のバッファで独自の値を持てない様にします。
kill-local-variableを実行した後では、SYMBOLの値はグローバルなSYMBOLの値
になります。setq-defaultされていなかったローカル変数は参照できなくなります。
使用例:
;;; defvar-localした変数の値を設定してからkillしてみる。
(defvar-local abc 123) => abc
(setq abc 456) => 456
abc => 456
(kill-local-variable 'abc) => t
abc => 123
seealso: kill-all-local-variables
seealso: make-local-variable
seealso: make-variable-buffer-local
type: Function
arguments: kill-selected-buffer
package: editor
file: buffer.l
名前のとおりselected-bufferをkill-bufferします。
参考:
;;; buffer.l
(defun kill-selected-buffer ()
(interactive)
(kill-buffer (selected-buffer)))
seealso: kill-buffer
type: Function
arguments: load-session FILENAME &optional NOT-CLOSE
package: editor
file: session.l
セッションファイルに保存されている状態を復元します。 [C-x 6 f]
NOT-CLOSE : ロード前に開いているバッファを削除するかどうか
nil *scratch* を除いてすべて削除してからロード
non-nil 残したままロード
seealso: save-session
seealso: *default-session-directory*
type: BufferLocal
package: editor
ロックファイルを作るかどうかを指定する変数です。
t : ロックファイルを作る。
nil : ロックファイルを作らない。
使用例:
;;; 現在開いているファイルではロックファイルを作らないようにする。
(make-local-variable 'lock-file)
=> t
(setq lock-file nil)
=> nil
seealso: unlock-file
seealso: file-locked-p
type: BufferLocal
package: editor
バックアップファイルを作るかどうかを指定する変数です。
t : バックアップファイルを作る
nil : バックアップファイルを作らない
使用例:
;;; 現在開いているファイルをバックアップとらないようにする。
(make-local-variable 'make-backup-files)
=> t
(setq make-backup-files nil)
=> nil
type: Function
arguments: make-local-variable SYMBOL
package: editor
file: builtin.l
SYMBOLを現在のバッファで独自の値を持てるようにローカル変数にします。
make-variable-buffer-localとは異なり、現在のバッファだけです。
使用例:
;;; 現在のバッファは自動保存しないようにする。
(make-local-variable 'auto-save)
=> t
(setq auto-save nil)
=> nil
seealso: make-variable-buffer-local
seealso: defvar-local
seealso: local-variable-p
seealso: kill-local-variable
seealso: kill-all-local-variables
seealso: buffer-local-value
type: Function
arguments: make-variable-buffer-local SYMBOL
package: editor
file: builtin.l
SYMBOLを個々のバッファで独自の値を持てるようにローカル変数にします。
make-local-variableとは異なり、全てのバッファが対象です。
余程のことが無い限りdefvar-localを使えば良いと思います。
seealso: make-local-variable
type: Function
arguments: need-buffer-save-p BUFFER
package: editor
file: builtin.l
バッファが保存が必要かを返します。
need-not-saveと関連しています。
t バッファの保存が必要
nil バッファの保存が必要ではない
seealso: need-not-save
type: Function
arguments: next-buffer
package: editor
file: buffer.l
次のバッファに切替えます。 [Home]
エディタ上で現在選択されているウィンドウの中のバッファが変わるだけです。
バッファタブの順番にそってnext-bufferしたいのならば、
*next-buffer-in-tab-order*を参照して下さい。
seealso: previous-buffer
seealso: *next-buffer-in-tab-order*
seealso: other-buffer
type: Function
arguments: not-modified
package: editor
file: buffer.l
バッファの変更フラグをクリアします。[ESC ~]
つまり変更されてないことになります。
(set-buffer-modified-p nil)のinteractive版です。
seealso: set-buffer-modified-p
type: Function
arguments: open-session-dialog
package: editor
file: session.l
ダイアログからセッションファイル名を指定してセッションを開きます。
[C-x 6 F]
seealso: load-session
type: Function
arguments: other-buffer &optional BUFFER
package: editor
file: builtin.l
最近、表示されていたバッファを返します。
seealso: bury-buffer
seealso: next-buffer
type: Function
arguments: previous-buffer
package: editor
file: buffer.l
一つ前のバッファに切替えます。next-bufferの反対です。[S-Home]
seealso: next-buffer
type: Function
arguments: print-buffer &optional BUFFER
package: editor
file: builtin.l
バッファを印刷します。
seealso: print-dialog
type: Function
arguments: redo
package: editor
file: builtin.l
元に戻した処理を再度実行します。[C-_],[S-End],[F12]
buffer-can-redo-p が t の時のみ実行可能です。
seealso: undo
seealso: buffer-can-redo-p
type: Function
arguments: rename FILENAME &optional NOWARN
package: editor
file: buffer.l
バッファに関連づけられたファイル名を変更します。バッファ名も同時に変更されます。
変更に成功したらnil以外の値を、失敗したらnilを返します。[C-x C-n]
使用例:
;;; カレントバッファのファイル名が"c:/foo.baz"に変更されます。
;;; 同時に、バッファ名も"foo.baz"になります。
(rename "c:/foo.baz")
seealso: rename-buffer
seealso: set-buffer-file-name
seealso: rename-file
type: Function
arguments: rename-buffer BUFFER-NAME &optional BUFFER
package: editor
file: builtin.l
ファイル名は変えずにバッファ名だけを変更します。
seealso: rename
seealso: buffer-name
type: Function
arguments: save-session FILENAME &optional NOWARN
package: editor
file: session.l
現在のバッファと各フレームのウィンドウの状態をセッションファイルに保存
します。ただし file-visited でないバッファと save-p が nil なフレーム
は保存されません。 [C-x 6 s]
保存した状態は load-session で復元することができます。
NOWARN : 指定されたファイルがすでに存在するときの動作
non-nil 黙って上書きする
nil メッセージボックスを表示して確認する
seealso: load-session
type: Function
arguments: save-session-dialog
package: editor
file: session.l
ダイアログからセッションファイル名を指定してセッションを保存します。
[C-x 6 S]
seealso: save-session
type: Function
arguments: select-buffer
package: editor
file: buffer.l
バッファを選択するダイアログを表示します。 [F2]
デフォルトではC-p/C-nで上下し、C-mで選択します。
buffer-menuのようなバッファの削除などはできません。
※正確には*std-control-xxx-char*の設定に依ります。
seealso: buffer-menu
type: Function
arguments: selected-buffer
package: editor
file: builtin.l
現在操作中のバッファ(カレントバッファ)を返します。
使用例:
(selected-buffer)
=> #<buffer: reference.xml>
互換性:
この関数はmuleにはありません。
muleでのcurrent-bufferに相当します。
type: Function
arguments: set-buffer BUFFER
package: editor
file: builtin.l
バッファを選択します。
seealso: switch-to-buffer
seealso: with-set-buffer
type: Function
arguments: set-buffer-alternate-file-name NAME &optional BUFFER
package: editor
file: builtin.l
バッファBUFFERにファイル名の別名NAMEをつけます。set-buffer-file-nameでは、
ありえないパスを指定するとエラーになります。
set-buffer-alternate-file-nameではどのような文字列でも指定可能です。
使用例:
; c:/abc/は存在しないパス
(set-buffer-file-name "c:/abc/def.txt")
=> c:/abc/def.txt
指定されたパスが見つかりません。
; URLでもなんでも任意の文字列を設定可
(set-buffer-alternate-file-name "http://www.asahi.com")
=> t
指定した文字列は、バッファのファイル名がnilの場合(つまり、
get-buffer-file-nameの戻り値がnilの場合)に限り、
以下の個所で使用されます
1)select-bufferで表示されるダイアログのファイル名
2)mode-line-format/title-bar-formatのファイル名
seealso: get-buffer-alternate-file-name
seealso: set-buffer-file-name
type: Function
arguments: set-buffer-colors COLORS &optional BUFFER
package: editor
file: builtin.l
バッファの色を設定します。設定した色は現状のバッファにだけ適用されます。
COLORS : BGRを表す数値をベクタで指定します。
seealso: get-buffer-colors
type: Function
arguments: set-buffer-eol-code CODE &optional BUFFER
package: editor
file: builtin.l
バッファの改行コードを設定します。
引数として改行コードの種類を表す定数が用意されています。
昔は、set-buffer-newline-codeという名称でしたが、xyzzy 0.2.0.121 からこ
の名前に変更されました。
CODE:バッファの改行コードの種類を指定します。
LFの場合 *eol-lf* 0
CRLFの場合 *eol-crlf* 1
CRの場合 *eol-cr* 2
使用例:
;;; バッファの改行コードをLFに変更する。
(set-buffer-eol-code *eol-lf*)
=> t
参考:
Changelogのxyzzy 0.2.0.121を参照のこと
seealso: *eol-lf*
seealso: *eol-crlf*
seealso: *eol-cr*
seealso: set-buffer-fileio-encoding
type: Function
arguments: set-buffer-file-name FILE-NAME &optional BUFFER
package: editor
file: builtin.l
バッファと結び付けられているファイルをFILE-NAMEにします。
seealso: get-buffer-file-name
seealso: rename
seealso: set-buffer-alternate-file-name
type: Function
arguments: set-buffer-fileio-encoding CODE &optional BUFFER
package: editor
file: builtin.l
バッファの文字エンコーディングをCODEにします。設定した文字エンコーディングは
buffer-fileio-encodingで参照することができます。
CODE : 文字エンコーディングを指定します。
BUFFER : 変更するバッファを指定します。
使用例:
(set-buffer-fileio-encoding *encoding-sjis*)
(set-buffer-fileio-encoding *encoding-euc-jp*)
(set-buffer-fileio-encoding *encoding-jis*)
(set-buffer-fileio-encoding *encoding-utf8*)
参照:
kanji.l
seealso: buffer-fileio-encoding
seealso: *char-encoding-list*
seealso: set-buffer-eol-code
type: Function
arguments: set-buffer-fold-type-column
package: editor
file: window.l
カレントバッファを指定位置で折り返しします。
seealso: set-buffer-fold-type-window
seealso: set-buffer-fold-type-none
type: Function
arguments: set-buffer-fold-type-column-update
package: editor
file: window.l
カレントバッファが指定位置で折り返しになっているかどうかを返します。
戻り値は以下のとおりです。
:check なっている
nil なっていない
seealso: set-buffer-fold-type-column
type: Function
arguments: set-buffer-fold-type-none
package: editor
file: window.l
カレントバッファを折り返しなしにします。
seealso: set-buffer-fold-type-window
seealso: set-buffer-fold-type-column
type: Function
arguments: set-buffer-fold-type-none-update
package: editor
file: window.l
カレントバッファが折り返し無しになっているかどうかを返します。
戻り値は以下のとおりです。
:check なっている
nil なっていない
seealso: set-buffer-fold-type-none
type: Function
arguments: set-buffer-fold-type-window
package: editor
file: window.l
カレントバッファをウィンドウ幅で折り返します。
seealso: set-buffer-fold-type-none
seealso: set-buffer-fold-type-column
type: Function
arguments: set-buffer-fold-type-window-update
package: editor
file: window.l
カレントバッファがウィンドウ幅で折り返しになっているかどうかを返します。
戻り値は以下のとおりです。
:check なっている
nil なっていない
seealso: set-buffer-fold-type-window
type: Function
arguments: set-buffer-modified-p FLAG &optional BUFFER
package: editor
file: builtin.l
バッファが変更されたかどうかのフラグを設定します。
FLAG : フラグを指定します。
t 変更されている状態にします。
nil 変更が存在しない状態にします。
BUFFER : 対象のバッファ
使用例:
;;; 変更フラグの設定・クリア
(set-buffer-modified-p t)
(set-buffer-modified-p nil)
seealso: buffer-modified-p
seealso: not-modified
type: Function
arguments: set-buffer-package PACKAGE-NAME
package: editor
file: cmds.l
*buffer-package*を設定するコマンドです。
補足:
xyzzy 0.2.2.239 から利用可能です。
seealso: eval-region
seealso: *buffer-package*
type: Function
arguments: setup-temp-buffer BUFFER
package: editor
file: misc.l
BUFFER を一時バッファ用に初期化します。
具体的には以下のようにバッファローカル変数を設定します。
buffer-read-only -> nil
need-not-save -> t
kept-undo-information -> nil
auto-save -> nil
seealso: buffer-read-only
seealso: need-not-save
seealso: kept-undo-information
seealso: auto-save
type: Function
arguments: switch-to-buffer BUFFER &optional NOWARN
package: editor
file: buffer.l
指定されたバッファに移動し、ウィンドウに移動します。 [C-x b]
バッファが存在しなければバッファを作成します。そのバッファを操作中のウ
ィンドウに表示するところ以外は、get-buffer-createのinteractive版と言え
ます。
使用例:
;;; *calc*があろうとなかろうと*calc*に移動する。
(switch-to-buffer "*calc*")
=> #<buffer: *calc*>
seealso: get-buffer-create
seealso: set-buffer
seealso: verify-visited-file-modtime
seealso: switch-to-buffer-other-window
type: Function
arguments: switch-to-buffer-other-window BUFFER &optional NOWARN
package: editor
file: buffer.l
他のウィンドウに移ってからバッファを切り替えます。[C-x 4 b]
ウィンドウ数が1の時は、ウィンドウを分割します。
BUFFER : このバッファにカレントウィンドウを切り替えます。
NOWARN : non-nilならば、指定したバッファが他のアプリケーションにより更
新されているかのチェックを行いません。
seealso: switch-to-buffer
type: Function
arguments: toggle-read-only &optional (ARG () SV)
package: editor
file: buffer.l
バッファの書き込み禁止をトグルします。 [C-x C-q]
seealso: buffer-read-only
type: Function
arguments: toggle-session-auto-save &optional (ARG () SV)
package: editor
file: session.l
セッションの自動保存フラグ (ed::*auto-save-session-file*) を切り替え
ます。 non-nil のときは、セッションを終了する際に自動でセッションファ
イルを上書きします。
ARG が与えられたとき (SV が non-nil のとき) は
nil または負の整数 : nil にする
それ以外 : t にする
seealso: close-session
seealso: ed::*auto-save-session-file*
type: Function
arguments: undo
package: editor
file: builtin.l
直前の操作を取り消します。[End], [C-\]
UNDO情報の直近の境界まで戻ります。
seealso: buffer-can-undo-p
seealso: undo-boundary
seealso: clear-undo-boundary
seealso: kept-undo-information
seealso: redo
seealso: last-modified-point
seealso: *move-forward-after-undo-deletion*
type: Function
arguments: undo-boundary
package: editor
file: builtin.l
UNDO情報に境界を設定します。
以後undoを実行すると、この境界まで戻ります。
seealso: clear-undo-boundary
seealso: undo
type: Function
arguments: verify-visited-file-modtime &optional BUFFER
package: editor
file: builtin.l
バッファがファイルに関連付けられていない、もしくはバッファとそれに関連付
けられたファイルとの更新時間が一致していると t を返します。バッファとそ
れに関連付けられたファイルとの更新時間が一致していない時、つまり他のプロ
セスによってファイルが変更された時などに nil を返します。
seealso: verify-buffers-file-modtime
seealso: switch-to-buffer
seealso: find-file-verify
seealso: clear-visited-file-modtime
seealso: update-visited-file-modtime
type: BufferLocal
package: editor
file: buffer.l
activate 時のバッファの最終更新日チェックを制御します。
:auto 更新されていれば自動的に読み直す
non-nil チェックする
nil チェックしない
seealso: verify-buffers-file-modtime
seealso: switch-to-buffer
type: Function
arguments: window-buffer WINDOW
package: editor
file: builtin.l
ウィンドウが表示しているバッファを返します。
使用例:
(window-buffer (selected-window))
seealso: get-buffer-window
type: Macro
arguments: with-set-buffer &body BODY
package: editor
file: misc.l
BODY を実行する際に、ポイントがミニバッファ以外にあることを保証します。
ポイントがミニバッファにあった場合、BODY を実行した後ポイントはミニバッファに戻ります。
ミニバッファで set-buffer するとエラーが起きるので、それを回避するためにあるようです。
使用例:
;; lisp/misc.l より
(defun setup-temp-buffer (buffer)
(with-set-buffer
(save-excursion
(set-buffer buffer)
(setq buffer-read-only nil)
(setq need-not-save t)
(setq kept-undo-information nil)
(setq auto-save nil))))
seealso: set-buffer
type: Tips