modified os detection functions to work with emacs 24