Emacs関係覚え書き
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
RIGHT:[[覚え書き]]
*Emacs のたち上げ時のログをとる [#p17da136]
**Emacs を batch モードでたちあげる. [#g4d6e950]
% emacs -batch -l ~/.emacs
**.emacs のデバッグ [#k0699ae0]
1) .emacs を読み込まないで起動.
% emacs -q
2) debug-on-error を ON にする
M-x set-variable
debug-on-error
t
3) 手動で .emacs をロードする
M-x load-file
~/.emacs
これでエラーが発生した時点でスタックトレースが表示される.
ちなみに .emacs の所々に
(message "point(1) passed")
といった行をいれておくと,どこまでうまくいったかがわかる.
**.emacs に新しい設定をいれる時の鉄則 [#d78919f2]
新しい設定は必ずファイルの最後にいれる.
というのは,エラーが起こるとそれ以後の行が実行されないから.
----
*Emacs の起動オプション [#u5e687db]
Emacs の起動オプションは,以下のようなものがあるみたいで...
(標準ライブラリの startup.el より引用)
;;; Commentary:
; These are processed only at the beginning of the arg...
; -batch execute noninteractively (message...
; variable noninteractive set to t)
; This option must be the first in...
; Processed by `main' in emacs.c -...
; -t file Specify to use file rather than s...
; as the terminal.
; This option must be the first in...
; Processed by `main' in emacs.c -...
; -nw Inhibit the use of any window-sys...
; code; use the current virtual te...
; This option must be the first in...
; Processed by `main' in emacs.c -...
; -q load no init file
; -no-init-file same
; -u user load user's init file
; -user user same
; -debug-init Don't catch errors in init file; ...
; These are processed in the order encountered.
; -f function execute function
; -funcall function same
; -l file load file
; -load file same
; -insert file same
; file visit file
; -kill kill (exit) emacs
----
*scratch buffer [#f7ff945c]
NetNews に流れていた Emacs Lisp プログラミングを行うため...
Emacs で,Lisp のプログラムを実行または評価(eval)する方法
(1) *scratch* バッファに行きます.(Emacs を起動した時の最...
(2) モードラインに "(Lisp Interaction)" という(モード名)...
M-x lisp-interaction-mode RET
を入力して,Lisp Interaction モードにします。
(3) *scratch* バッファの任意の場所(通常は最後)に,実行し...
例: (find-file "~/.emacs")
(4) Lisp の式の後ろにカーソルを持っていきます.
例: (find-file "~/.emacs")■
↑
カーソル
(5) ここで,C-j (LFD とも呼ぶ)を入力します. Lisp Interac...
(6) この時、*scratch* バッファには,以下のように表示され...
例: (find-file "~/.emacs")
#<buffer .emacs>
**参考: [#h2bd5ae6]
(call-interactively 'find-file) を実行すると, C-x C-f を...
終了行:
RIGHT:[[覚え書き]]
*Emacs のたち上げ時のログをとる [#p17da136]
**Emacs を batch モードでたちあげる. [#g4d6e950]
% emacs -batch -l ~/.emacs
**.emacs のデバッグ [#k0699ae0]
1) .emacs を読み込まないで起動.
% emacs -q
2) debug-on-error を ON にする
M-x set-variable
debug-on-error
t
3) 手動で .emacs をロードする
M-x load-file
~/.emacs
これでエラーが発生した時点でスタックトレースが表示される.
ちなみに .emacs の所々に
(message "point(1) passed")
といった行をいれておくと,どこまでうまくいったかがわかる.
**.emacs に新しい設定をいれる時の鉄則 [#d78919f2]
新しい設定は必ずファイルの最後にいれる.
というのは,エラーが起こるとそれ以後の行が実行されないから.
----
*Emacs の起動オプション [#u5e687db]
Emacs の起動オプションは,以下のようなものがあるみたいで...
(標準ライブラリの startup.el より引用)
;;; Commentary:
; These are processed only at the beginning of the arg...
; -batch execute noninteractively (message...
; variable noninteractive set to t)
; This option must be the first in...
; Processed by `main' in emacs.c -...
; -t file Specify to use file rather than s...
; as the terminal.
; This option must be the first in...
; Processed by `main' in emacs.c -...
; -nw Inhibit the use of any window-sys...
; code; use the current virtual te...
; This option must be the first in...
; Processed by `main' in emacs.c -...
; -q load no init file
; -no-init-file same
; -u user load user's init file
; -user user same
; -debug-init Don't catch errors in init file; ...
; These are processed in the order encountered.
; -f function execute function
; -funcall function same
; -l file load file
; -load file same
; -insert file same
; file visit file
; -kill kill (exit) emacs
----
*scratch buffer [#f7ff945c]
NetNews に流れていた Emacs Lisp プログラミングを行うため...
Emacs で,Lisp のプログラムを実行または評価(eval)する方法
(1) *scratch* バッファに行きます.(Emacs を起動した時の最...
(2) モードラインに "(Lisp Interaction)" という(モード名)...
M-x lisp-interaction-mode RET
を入力して,Lisp Interaction モードにします。
(3) *scratch* バッファの任意の場所(通常は最後)に,実行し...
例: (find-file "~/.emacs")
(4) Lisp の式の後ろにカーソルを持っていきます.
例: (find-file "~/.emacs")■
↑
カーソル
(5) ここで,C-j (LFD とも呼ぶ)を入力します. Lisp Interac...
(6) この時、*scratch* バッファには,以下のように表示され...
例: (find-file "~/.emacs")
#<buffer .emacs>
**参考: [#h2bd5ae6]
(call-interactively 'find-file) を実行すると, C-x C-f を...
ページ名: