added .emacs check, fixed link bug