From ec918aabb3f24f37af0db937446d269273a390c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=BCdiger=20Sonderfeld?= Date: Thu, 9 Jan 2014 18:25:48 +0100 Subject: [PATCH] Document `load-prefer-newer'. * doc/emacs/building.texi (Lisp Libraries): Document `load-prefer-newer'. It is already documented in lispref. --- doc/emacs/ChangeLog | 2 ++ doc/emacs/building.texi | 15 +++++++++------ etc/NEWS | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 3b81e73164..7f0ca7184e 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,5 +1,7 @@ 2014-01-09 Rüdiger Sonderfeld + * building.texi (Lisp Libraries): Document `load-prefer-newer'. + * files.texi (File Conveniences): Document `image-next-frame', `image-previous-frame', `image-goto-frame', `image-increase-speed', `image-decrease-speed', diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index fdb38bfd4d..1df4dcdf83 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1348,6 +1348,7 @@ not from an existing Emacs buffer. @findex load @findex load-library +@vindex load-prefer-newer @cindex load path for Emacs Lisp If an Emacs Lisp file is installed in the Emacs Lisp @dfn{load path} (defined below), you can load it by typing @kbd{M-x load-library}, @@ -1356,15 +1357,17 @@ command prompts for a @dfn{library name} rather than a file name; it searches through each directory in the Emacs Lisp load path, trying to find a file matching that library name. If the library name is @samp{@var{foo}}, it tries looking for files named -@file{@var{foo}.elc}, @file{@var{foo}.el}, and lastly just -@file{@var{foo}}; the first one found is loaded. This command prefers -@file{.elc} files over @file{.el} files because compiled files load -and run faster. If it finds that @file{@var{lib}.el} is newer than -@file{@var{lib}.elc}, it issues a warning, in case someone made +@file{@var{foo}.elc}, @file{@var{foo}.el}, and @file{@var{foo}}. The +default behaviour is to load the first file found. This command +prefers @file{.elc} files over @file{.el} files because compiled files +load and run faster. If it finds that @file{@var{lib}.el} is newer +than @file{@var{lib}.elc}, it issues a warning, in case someone made changes to the @file{.el} file and forgot to recompile it, but loads the @file{.elc} file anyway. (Due to this behavior, you can save unfinished edits to Emacs Lisp source files, and not recompile until -your changes are ready for use.) +your changes are ready for use.) However setting +@code{load-prefer-newer} to a non-@code{nil} value will Emacs load the +newest version of the file found. Emacs Lisp programs usually load Emacs Lisp files using the @code{load} function. This is similar to @code{load-library}, but is diff --git a/etc/NEWS b/etc/NEWS index 7677991b90..4463d69007 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -242,6 +242,7 @@ etc. You can customize this to specify a function that provides a default value from the regexp last history element, or from the symbol found at point. ++++ *** `load-prefer-newer', affects how the `load' function chooses the file to load. If this is non-nil, then when both .el and .elc versions of a file exist, and the caller did not explicitly specify -- 2.20.1