add refheap support for emacs