I am trying to make my Emacs configuration file written for OS X work on Ubuntu. I have this line:
(add-to-list 'load-path "/usr/local/Cellar/emacs/23.3/share/emacs/site-lisp/w3m")
It is used to load emacs-w3m. On OS X I installed Emacs using Homebrew, thus it is in /usr/local/Cellar/.The site-lisp directory on Ubuntu is in a different place. How can I write this line in a way that will work on both operating systems? Is there an Emacs Lisp function to retrieve the site-lisp directory?
No, there’s no way. The site-lisp directory is a convention and only its existence not its path is agreed on.
Either you set a symbolic link on your Mac/Ubuntu or you use a system switch:
and then