1.2.6 Installation for non-privileged users

Often people without system administration privileges want to install software for their private use. In that case you need to pass more options to the configure script.

The main expedient is using the --prefix option to the configure script, and let it point to the personal home directory. In that way, resulting binaries will be installed under the bin subdirectory of your home directory, manual pages under man and so on. It is reasonably easy to maintain a bunch of personal software, since the prefix argument is supported by most configure scripts.

You often need to specify --with-lispdir option as well. If you haven’t installed Emacs under your home directory and use Emacs installed in system directories, the configure script might not be able to figure out suitable place to install lisp files under your home directory. In that case, the configure script would silently choose, by default, the site-lisp directory within load-path for the place, where administration privileges are usually required to put relevant files. Thus you will have to tell the configure script explicitly where to put those files by, e.g., --with-lispdir=‘/home/myself/share/emacs/site-lisp.

You’ll have to add something like ‘/home/myself/share/emacs/site-lisp’ to your load-path variable, if it isn’t there already.

In addition, you will have to tell configure script where to install TeX-related files such as preview.sty if preview-latex isn’t disabled. It is enough to specify --with-texmf-dir=$HOME/texmf for most typical cases, but you have to create the direcotry $HOME/texmf in advance if it doesn’t exist. If this prescription doesn’t work, consider using one or more of the options --with-texmf-dir=/dir, --without-texmf-dir, --with-tex-dir=/dir and --with-doc-dir=/dir. See Configure for detail of these options.

Now here is another thing to ponder: perhaps you want to make it easy for other users to share parts of your personal Emacs configuration. In general, you can do this by writing ‘~myself/’ anywhere where you specify paths to something installed in your personal subdirectories, not merely ‘~/’, since the latter, when used by other users, will point to non-existent files.

For yourself, it will do to manipulate environment variables in your .profile resp. .login files. But if people will be copying just Elisp files, their copies will not work. While it would in general be preferable if the added components where available from a shell level, too (like when you call the standalone info reader, or try using preview.sty for functionality besides of Emacs previews), it will be a big help already if things work from inside of Emacs.

Here is how to do the various parts:

Making the Elisp available

In GNU Emacs, it should be sufficient if people just do

(load "~myself/share/emacs/site-lisp/auctex.el" nil t t)
(load "~myself/share/emacs/site-lisp/preview-latex.el" nil t t)

where the path points to your personal installation. The rest of the package should be found relative from there without further ado.

Making the Info files available

For making the info files accessible from within Elisp, something like the following might be convenient to add into your or other people’s startup files:

(eval-after-load 'info
   '(add-to-list 'Info-directory-list "~myself/info"))

Making the LaTeX style available

If you want others to be able to share your installation, you should configure it using --without-texmf-dir, in which case things should work as well for them as for you.

1.2.6.1 Using AUCTeX from local Git repo

With the techniques described above, it is also possible to use AUCTeX directly from a local Git repository. Let’s assume you have your Git repositories under ‘~/development/’.

First, you have to fetch a copy of the AUCTeX Git repository. In a shell, change directory to ‘~/development/’ and do:

git clone https://git.savannah.gnu.org/git/auctex.git

Now change directory to ‘~/development/auctex’ and run ‘./autogen.sh’. Next thing is to run configure like this:

./configure --without-texmf-dir --with-lispdir=.

When finished, simply enter

make

and you’re finished. Note that the ‘make install’ step is not necessary.

Now you have to tell Emacs about the plan. The following variables must be set in your init file because their normal values are only correct when AUCTeX is installed:

(setq TeX-data-directory "~/development/auctex"
      TeX-lisp-directory TeX-data-directory)

The info files will be available with this:

(eval-after-load 'info
   '(add-to-list 'Info-additional-directory-list
                 "~/development/auctex/doc"))

Now you’re ready to load auctex.el and preview-latex.el out of this directory:

(load "~/development/auctex/auctex.el" nil t t)
(load "~/development/auctex/preview-latex.el" nil t t)