GNU bug report logs - #28607
27.0.50; help-fns unsolicited elisp loading

Previous Next

Package: emacs;

Reported by: Mark Oteiza <mvoteiza <at> udel.edu>

Date: Tue, 26 Sep 2017 12:50:01 UTC

Severity: normal

Tags: fixed, patch

Merged with 28048

Found in versions 26.0.50, 26.0.90, 27.0.50

Fixed in version 26.3

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mvoteiza <at> udel.edu, rgm <at> gnu.org, 28607 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#28607: 27.0.50; help-fns unsolicited elisp loading
Date: Sat, 18 May 2019 12:00:52 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I made a new option instead of extending help-enable-auto-load
>> because otherwise I would have to think about how to dis/enable them
>> each individually, which is annoying to encode in a single option.
>
> Thanks, this LGTM.  I wonder whether we should document
> definition-prefixes (together with the mechinery it is part of) and
> this new option in the ELisp manual.

Yeah, I think the machinery deserves a mention in the Elisp manual at
least.  Though the user option should go in the Emacs manual.

--- c/doc/emacs/building.texi
+++ i/doc/emacs/building.texi
@@ -1499,6 +1499,12 @@ Lisp Libraries
 buffer).  To disable this feature, change the variable
 @code{help-enable-auto-load} to @code{nil}.
 
+@vindex help-enable-completion-auto-load
+Automatic loading also occurs when completing names for
+@code{describe-variable} and @code{describe-function}, based on the
+prefix being completed.  To disable this feature, change the variable
+@code{help-enable-completion-auto-load} to @code{nil}.
+
 @vindex load-dangerous-libraries
 @cindex Lisp files byte-compiled by XEmacs
   By default, Emacs refuses to load compiled Lisp files which were
diff --git c/doc/lispref/loading.texi i/doc/lispref/loading.texi
index f0cc689d1f..947f1fa6a5 100644
--- c/doc/lispref/loading.texi
+++ i/doc/lispref/loading.texi
@@ -466,9 +466,11 @@ Autoload
 order to install the real definition and other associated code, then
 runs the real definition as if it had been loaded all along.
 Autoloading can also be triggered by looking up the documentation of
-the function or macro (@pxref{Documentation Basics}).
+the function or macro (@pxref{Documentation Basics}), and completion
+of variable and function names (@pxref{Autoload by Prefix} below).
 
 @menu
+* Autoload by Prefix:: Autoload by Prefix.
 * When to Autoload::   When to Use Autoload.
 @end menu
 
@@ -703,6 +705,23 @@ Autoload
 function, only a macro.
 @end defun
 
+@node Autoload by Prefix
+@subsection Autoload by Prefix
+
+@vindex definition-prefixes
+@findex register-definition-prefixes
+@vindex autoload-compute-prefixes
+During completion for the commands @code{describe-variable} and
+@code{describe-function}, Emacs will try to load files which may
+contain definitions matching the prefix being completed.  The variable
+@code{definition-prefixes} holds a hashtable which maps a prefix to
+the corresponding list of files to load for it.  Entries to this
+mapping are added by calls to @code{register-definition-prefixes}
+which are generated by @code{update-file-autoloads}.  Files which
+don't contain any definitions worth loading (test files, for
+examples), should set @code{autoload-compute-prefixes} to @code{nil}
+as a file-local variable.
+
 @node When to Autoload
 @subsection When to Use Autoload
 @cindex autoload, when to use






This bug report was last modified 6 years and 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.