What’s the difference between `/usr/share/emacs/site-lisp/` directory and `/usr/share/emacs23/site-lisp/` directory

directory-structureemacs

I use Emacs 23 on my system. I received a file from a colleague (who has a different Linux distro) to add to the /usr/share/emacs/site-lisp/ directory.

As I worked to do this, I noticed another, similarly-named, directory: /usr/share/emacs23/site-lisp/. When viewing their contents, I notice that they are not identical.

Is this common with all Emacs configurations on all distros? Are there distinct purposes for when I should add into one over the other? Which one? How do I know?

In short, what is the difference between these 2 directories?

Best Answer

It's possible to have multiple versions of Emacs installed on the same machine. Only Emacs 23 would load files from /usr/share/emacs23/site-lisp/. All versions of Emacs would load files from /usr/share/emacs/site-lisp/.

Generally, you just use /usr/share/emacs/site-lisp/, unless there's some reason the code applies only to a particular version of Emacs.

To see where your Emacs is loading code from, type Control+h    v load-path Enter.