I'm trying to advise a function in emacs, but nothing happens.
(defadvice save-place-find-file-hook (after recenter activate)
"Recenter after getting to saved place."
(recenter))
Recentering doesn't happen, that is. If have a (message "foo") instead, foo is indeed displayed. What is it that I don't know about defadvice?
find-file-hookis run before the buffer is displayed, so your recentering does not apply to the buffer you think it does and is undone immediately after it happened, whenfind-filereplaces the current buffer with the new buffer in the selected window.