「このモードでは `*pre/post-command-hook*` で何かしたい」という時。 とりあえずそれを実現する方法。 A: `*pre/post-command-hook*` を buffer-local に そのモードのフック(かなにか)で `*pre/post-command-hook*` を buffer-local にしておいて `add-hook` する。 問題点は後で。 (add-hook '*hoge-mode-hook* (defun enable-local-post-command-hook () (make-local-variable '*post-command-hook*) (add-hook '*post-command-hook* (defun my-local-hook-fn () (do-something ...))))) B: major-