From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: Noam Postavsky <npostavs@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#28607: 27.0.50; help-fns unsolicited elisp loading
Date: Wed, 15 May 2019 22:12:34 -0400
Message-ID: <874l5vf8q5.fsf@gmail.com>
References: <87efqtoc9u.fsf@udel.edu> <3cvak51n96.fsf@fencepost.gnu.org>
	<20170926155126.kujypxt33oxbzxsq@logos.localdomain>
	<83in5xjzak.fsf@gnu.org>
	<CAKyxw10XCzp1fY96vcm_Ep_hZsF3a-YQeUnSkUc1p5WvPtDYhw@mail.gmail.com>
	<bjk1qdds39.fsf@fencepost.gnu.org>
	<CAKyxw13--qefNuxLQNjvsH7WRQHs0ucGmT9bXeZ3eVvtE-rdXA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
	logging-data="113387"; mail-complaints-to="usenet@blaine.gmane.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
Cc: 28607@debbugs.gnu.org
To: Mark Oteiza <mvoteiza@udel.edu>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 16 04:13:12 2019
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256)
	(Exim 4.89)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1hR5tQ-000TMW-BP
	for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 May 2019 04:13:12 +0200
Original-Received: from localhost ([127.0.0.1]:47079 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1hR5tO-0006sW-Ct
	for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 22:13:10 -0400
Original-Received: from eggs.gnu.org ([209.51.188.92]:34359)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hR5tH-0006rv-Vv
	for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 22:13:05 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hR5tG-0006A5-Pa
	for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 22:13:03 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:40274)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
	id 1hR5tG-0006A1-LQ
	for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 22:13:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hR5tG-0002sq-Cg
	for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 22:13:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Noam Postavsky <npostavs@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 16 May 2019 02:13:02 +0000
Resent-Message-ID: <handler.28607.B28607.155797276911065@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 28607
X-GNU-PR-Package: emacs
Original-Received: via spool by 28607-submit@debbugs.gnu.org id=B28607.155797276911065
	(code B ref 28607); Thu, 16 May 2019 02:13:02 +0000
Original-Received: (at 28607) by debbugs.gnu.org; 16 May 2019 02:12:49 +0000
Original-Received: from localhost ([127.0.0.1]:53818 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1hR5t2-0002sP-Qy
	for submit@debbugs.gnu.org; Wed, 15 May 2019 22:12:49 -0400
Original-Received: from mail-io1-f45.google.com ([209.85.166.45]:35759)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <npostavs@gmail.com>)
	id 1hR5sx-0002rx-UT; Wed, 15 May 2019 22:12:45 -0400
Original-Received: by mail-io1-f45.google.com with SMTP id p2so1320729iol.2;
	Wed, 15 May 2019 19:12:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; 
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version;
	bh=zVR/QS3Y7ktsjdh3FV2Kfogu2pXAAnkm2az6nU1vYVE=;
	b=toATQMG3I8GWfAhj9+T6m6FWEoEoxJBFv50cst7Cdg1e6YC0ZF91YjmLHnNwEWYCBK
	uvRVKEuTifVZ5kEJ9FPuocW0mf+wGXMYga7zDZPXOrEUu4bfiPEIPZK5K03zpOzntDzc
	rdjRCR36qFvkI6qTaFvLJLeCiW8TmiYKvWBGRm8zmWw1K6MKbyipsZAaQfmhyz5JbcOM
	PjUq/0a7bnCsi67XciSxdAjXnEXxiDaBqGD4YhJwKhmkZCD/tbBMgS04NxeKTRBaPugn
	dEC9zcicEWxQcxjFIIXjlVRkDW4GnfkhXRANNRDFyCwNgpfXja4Regj2hIbHAw91UCZ8
	Mycw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
	:message-id:user-agent:mime-version;
	bh=zVR/QS3Y7ktsjdh3FV2Kfogu2pXAAnkm2az6nU1vYVE=;
	b=CeXyimR5Fp1GBq/9wO6CKIdXT0ZRjG95bi8sYQ/L1FohTAlLRwBHXmxKq/8DkvqxW2
	sVm3GovZbVbaLi3Yy37UBYfaLMn0WlLlhZTta3hjK/aHNc/EREhNlQaAOEB0qp0Lh/g6
	W1Ncix4wNYm5xxkE4Y4g5fhq+NYHKv/YkrDKl2/XQ2vgv+d2S9AyDz7eeynAHth6h4nu
	0k4u+l56Gwt8vqG1XWuB7ixcWOPnr9qMsOFv8YypdVzI1aCITET7/JsH2afpCXh9Y3/+
	d4RK6fZpgGNTVi2PrCe7rw9kgOJlAbOYxbcaVMvq+5ZQ4sW5AaQHHClwC32eBvA0pD3c
	RrfQ==
X-Gm-Message-State: APjAAAWkVqZ4vCrlkw1bkiLttiODnNZZeI4OYWZkVGTV1LvRpPXpYw2x
	5cntuEiNpu5lMwe0hgORZ5F7YlW0
X-Google-Smtp-Source: APXvYqyqpYlpPU7dBqx2OGF7uQjRRlMgG4QL3AONQbM+v96XUxWHT4x1C+wxR1OPyJze5UDaSVL/bA==
X-Received: by 2002:a5d:93da:: with SMTP id j26mr25739535ioo.170.1557972757426;
	Wed, 15 May 2019 19:12:37 -0700 (PDT)
Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
	by smtp.gmail.com with ESMTPSA id
	s4sm1383225ioc.76.2019.05.15.19.12.34
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Wed, 15 May 2019 19:12:35 -0700 (PDT)
In-Reply-To: <CAKyxw13--qefNuxLQNjvsH7WRQHs0ucGmT9bXeZ3eVvtE-rdXA@mail.gmail.com>
	(Mark Oteiza's message of "Mon, 16 Jul 2018 09:03:36 -0400")
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.51.188.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
	the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs/>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "bug-gnu-emacs"
	<bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Xref: news.gmane.org gmane.emacs.bugs:159371
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/159371>

--=-=-=
Content-Type: text/plain

tags 28607 + patch
unarchive 28048
notfixed 28048 26.1
forcemerge 28607 28048
quit

Mark Oteiza <mvoteiza@udel.edu> writes:

> On Mon, Jul 2, 2018 at 9:29 PM, Glenn Morris <rgm@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.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Add-option-to-disable-help-completion-autoloading-Bu.patch
Content-Description: patch

>From 2e3d84fc1d8457046a0aceed7e1f9837330a4365 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@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


--=-=-=--