[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Elisp - Store path only once
From: |
Drew Adams |
Subject: |
RE: Elisp - Store path only once |
Date: |
Sat, 9 Jan 2021 13:34:12 -0800 (PST) |
> >(load 'g-eshell)
> >(load 'g-utils)
>
> (require 'something)
There are (at least) 3 functions you can use to load a list file: `require',
`load-library', and `load'.
1. `require' loads the library (*.elc or *.el) only once,
i.e., only if it hasn't yet been loaded.
2. `load-library' and `load' (also `load-file') load the
library (*.elc or *.el) unconditionally, i.e., each time.
3. `load-library' looks for a library name in your `load-path'.
`load' and `load-file expect a file name, not a library
name, but `load' does search directories in `load-path',
and `load' does try adding suffixes .elc and .el.
This is explained better than I've done here in the Emacs manual, node `Lisp
Libraries' (ask Emacs).
https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html