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


Message #39 received at control <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: Glenn Morris <rgm <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>,
 28607 <at> debbugs.gnu.org
Subject: Re: bug#28607: 27.0.50; help-fns unsolicited elisp loading
Date: Wed, 15 May 2019 22:12:34 -0400
[Message part 1 (text/plain, inline)]
tags 28607 + patch
unarchive 28048
notfixed 28048 26.1
forcemerge 28607 28048
quit

Mark Oteiza <mvoteiza <at> udel.edu> writes:

> On Mon, Jul 2, 2018 at 9:29 PM, Glenn Morris <rgm <at> gnu.org> wrote:
>>
>> What do you actually want to happen with this report?
>> The feature is working as designed.
>> Do you eg want an option to turn it off?
>> (The existing help-enable-auto-load could perhaps be extended for this.)
>
> At minimum an option to disable it, which is what I'm already doing as
> a workaround.

Right, here's patch for that.  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.

[0001-Add-option-to-disable-help-completion-autoloading-Bu.patch (text/x-diff, inline)]
From 2e3d84fc1d8457046a0aceed7e1f9837330a4365 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Wed, 15 May 2019 20:29:38 -0400
Subject: [PATCH] Add option to disable help completion autoloading (Bug#28607)

* lisp/help-fns.el (help-enable-completion-auto-load): New option.
(help--symbol-completion-table): Consult it.
* etc/NEWS: Announce it.
---
 etc/NEWS         |  6 ++++++
 lisp/help-fns.el | 18 +++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 573c8236b2..286f9ee275 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -24,6 +24,12 @@ with a prefix argument or by typing 'C-u C-h C-n'.
 
 * Changes in Emacs 26.3
 
+---
+** New option 'help-enable-completion-auto-load'.
+This allows disabling the new feature introduced in Emacs 26.1 which
+loads files during completion of 'C-h f' and 'C-h v' according to
+'definition-prefixes'.
+
 
 * Editing Changes in Emacs 26.3
 
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index a7812e3b4b..8684a853af 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -89,11 +89,23 @@ help--load-prefixes
       (unless (help--loaded-p file)
         (load file 'noerror 'nomessage)))))
 
+(defcustom help-enable-completion-auto-load t
+  "Whether completion for Help commands can perform autoloading.
+If non-nil, whenever invoking completion for `describe-function'
+or `describe-variable' load files that might contain definitions
+with the current prefix.  The files are chosen according to
+`definition-prefixes'."
+  :type 'boolean
+  :group 'help
+  :version "26.3")
+
 (defun help--symbol-completion-table (string pred action)
-  (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string)))
-    (help--load-prefixes prefixes))
+  (when help-enable-completion-auto-load
+    (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string)))
+      (help--load-prefixes prefixes)))
   (let ((prefix-completions
-         (mapcar #'intern (all-completions string definition-prefixes))))
+         (and help-enable-completion-auto-load
+              (mapcar #'intern (all-completions string definition-prefixes)))))
     (complete-with-action action obarray string
                           (if pred (lambda (sym)
                                      (or (funcall pred sym)
-- 
2.11.0


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.