unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Mark Oteiza <mvoteiza@udel.edu>
Cc: 28607@debbugs.gnu.org
Subject: bug#28607: 27.0.50; help-fns unsolicited elisp loading
Date: Wed, 15 May 2019 22:12:34 -0400	[thread overview]
Message-ID: <874l5vf8q5.fsf@gmail.com> (raw)
In-Reply-To: <CAKyxw13--qefNuxLQNjvsH7WRQHs0ucGmT9bXeZ3eVvtE-rdXA@mail.gmail.com> (Mark Oteiza's message of "Mon, 16 Jul 2018 09:03:36 -0400")

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 2333 bytes --]

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'.
 \f
 * 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'.
+
 \f
 * 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


  reply	other threads:[~2019-05-16  2:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26 12:49 bug#28607: 27.0.50; help-fns unsolicited elisp loading Mark Oteiza
2017-09-26 15:40 ` Glenn Morris
2017-09-26 15:51   ` Mark Oteiza
2018-07-02 17:57     ` Eli Zaretskii
2018-07-02 18:05       ` Mark Oteiza
2018-07-02 18:16         ` Eli Zaretskii
2018-07-03  1:29         ` Glenn Morris
2018-07-16 13:03           ` Mark Oteiza
2019-05-16  2:12             ` Noam Postavsky [this message]
2019-05-16 13:38               ` Eli Zaretskii
2019-05-18 16:00                 ` Noam Postavsky
2019-05-18 16:15                   ` Eli Zaretskii
2019-05-20 17:49                     ` Noam Postavsky
2019-05-20 19:01                       ` Eli Zaretskii
2019-05-21 11:45                         ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874l5vf8q5.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=28607@debbugs.gnu.org \
    --cc=mvoteiza@udel.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).