EmacsLisp
(defun foo (x y &optional z &rest r) (insert (format "%S\n" x)) (insert (format "%S\n" y)) (insert (format "%S\n" z)) (insert (format "%S\n" r))) => foo (defadvice foo (before foo-before activate) (ad-set-arg 1 10) (ad-set-arg 2 20) (ad-se…
(defun foo (x y &optional z &rest r) ) => foo (defadvice foo (before foo-before activate) (insert (format "%S\n" (ad-get-arg 0))) (insert (format "%S\n" (ad-get-arg 1))) (insert (format "%S\n" (ad-get-arg 2))) (insert (format "%S\n" (ad-ge…
ad-activate-regexp, ad-deactivate-regexp とは何が違うんだっけ? activate, enable の違い?「活性」と「有効」。へ?
(setq x "*") => "*" (defun foo () (format "%s %s" "foo" x)) => foo (defadvice foo (before foo-before activate) (insert "*before*")) => foo (defadvice foo (around foo-around activate) (let ((x "*around*")) ad-do-it)) => foo (defadvice foo (…
ad-default-compilation-action => maybe
(setq x "*") => "*" (defun foo () (format "%s %s" "foo" x)) => foo (defadvice foo (around foo-around activate) (let ((x "hoge")) ad-do-it)) => foo (foo) => "foo hoge" (defadvice foo (around foo-around activate) (let ((x "HOGE")) ad-do-it))…
(setq x "*") => "*" (defun foo () (format "%s %s" "foo" x)) => foo (defadvice foo (around foo-around) (let ((x "hoge")) ad-do-it)) => foo (foo) => "foo *" (ad-start-advice) => documentation (foo) => "foo *" (defadvice foo (around foo-aroun…
(setq x "*") => "*" (defun foo () (format "%s %s" "foo" x)) => foo (defadvice foo (around foo-around activate) (let ((x "hoge")) ad-do-it)) => foo (defun bar () (format "%s %s" "bar" x)) => bar (defadvice bar (around bar-around activate) (…
(defun foo () (format "%s %s" "foo" x)) => foo (defadvice foo (around foo-around activate) (let ((x "hoge")) ad-do-it)) => foo (foo) => "foo hoge" (ad-deactivate 'foo) => foo (foo) error--> Symbol's value as variable is void: x
(defun foo () (format "%s %s" "foo" x)) => foo (ad-add-advice 'foo '(foo-around t t (let ((x "baz")) ad-do-it)) 'around 'first) => ((active) (origname . ad-Orig-foo) (around (foo-around t t (let ((x "baz")) ad-do-it)))) (foo) error--> Symb…
(defun foo () (format "%s %s" "foo" x)) => foo (defadvice foo (around foo-around activate) (let ((x "hoge")) ad-do-it)) => foo (foo) => "foo hoge"
http://lc.linux.or.jp/lc2002/papers/komatsu0920h.pdf が分かりやすかったまんま (defun ad-return-value-test () "Original") => ad-return-value-test (defadvice ad-return-value-test (around ad-return-value-test-advice activate) "An advice to te…
まんま (defadvice previous-line (before next-line-at-end (arg)) "Insert an empty line when moving up from the top line." (if (and next-line-add-newlines (= arg 1) (save-excursion (beginning-of-line) (bobp))) (progn (beginning-of-line) (new…
edebug-setup-hook => nil edebug-all-defs => nil edebug-all-forms => nil edebug-save-windows => t edebug-save-displayed-buffer-points => nil edebug-initial-mode => step edebug-trace => nil edebug-test-coverage => nil edebug-continue-kbd-mac…
そんなものが用意されているのか edebug-test-coverage => nil (setq edebug-test-coverage t) => t「(fact 3)」実行後、「M-x edebug-display-freq-count」「Not inside instrumented form」とか言われちゃうぞ?
edebug-print-circle => t「デフォルト値は`nil'」って書いてあるのに?
edebug-print-level => 50
edebug-print-length => 50
e EXP RET M-: EXP RET C-x C-e
「M-x edebug-defun」との違いは? 「C-M-x」(eval-defun)は「いったんedebugをロードすると再定義」らしい
command-debug-status => nilデバッガが内部で使うもの???
debug-on-next-call => nil
(backtrace) backtrace() eval((backtrace)) eval-last-sexp(t) eval-print-last-sexp() call-interactively(eval-print-last-sexp) => nil まんま (with-output-to-temp-buffer "backtrace-output" (let ((var 1)) (save-excursion (setq var (eval '(progn…
debugger => debug