use cl-assoc-if instead of assoc-if.
revert the last change to avoid circular dependency.
fix the problem unexpected switch of current buffer in Emacs 24.2 and later.