GNU bug report logs - #62767
29.0.90; [PATCH] *lisp/emacs-lisp/package.el: set variables after info package

Previous Next

Package: emacs;

Reported by: lin Sun <sunlin7 <at> yahoo.com>

Date: Tue, 11 Apr 2023 05:17:02 UTC

Severity: wishlist

Tags: patch

Found in version 29.0.90

Full log


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

From: Philip Kaludercic <philipk <at> posteo.net>
To: lin Sun <sunlin7 <at> yahoo.com>
Cc: 62767 <at> debbugs.gnu.org, eliz <at> gnu.org
Subject: Re: bug#62767: 29.0.90; [PATCH] *lisp/emacs-lisp/package.el: set
 variables after info package
Date: Fri, 14 Apr 2023 20:07:54 +0000
[Message part 1 (text/plain, inline)]
lin Sun <sunlin7 <at> yahoo.com> writes:

> Hi,
>
> The package.el will always require the entire `info.el` on its package
> activating function.
> Using the `with-eval-after-load` to arrange the work can avoid the
> unnecessary loading the `info` package.

Note that this is not the only place where info is required.  If this is
an acceptable solution (which I am not sure since `with-eval-after-load'
is something I usually encounter in user configurations), then we should
think about consistently addressing the issue:

[Message part 2 (text/plain, inline)]
3 matches for "require 'info" in buffer: package.el
       :        (add-to-list 'load-path (directory-file-name pkg-dir)))
       :      ;; Add info node.
       :      (when (file-exists-p (expand-file-name "dir" pkg-dir))
       :        ;; FIXME: not the friendliest, but simple.
    896:        (require 'info)
       :        (info-initialize)
       :        (add-to-list 'Info-directory-list pkg-dir))
       :      (push name package-activated-list)
       :      ;; Don't return nil.
-------
       :(defun package-quickstart-refresh ()
       :  "(Re)Generate the `package-quickstart-file'."
       :  (interactive)
       :  (package-initialize 'no-activate)
   4444:  (require 'info)
       :  (let ((package--quickstart-pkgs ())
       :        ;; Pretend we haven't activated anything yet!
       :        (package-activated-list ())
       :        ;; Make sure we can load this file without load-source-file-function.
-------
       :                          package-activated-list)))
       :          (current-buffer))
       :      (let ((info-dirs (butlast Info-directory-list)))
       :        (when info-dirs
   4489:          (pp `(progn (require 'info)
       :                      (info-initialize)
       :                      (setq Info-directory-list
       :                            (append ',info-dirs Info-directory-list)))
       :              (current-buffer))))
[Message part 3 (text/plain, inline)]

> Please help review the patch. Thanks.
>
> Best regards
> Lin
>
> From 4908999eefa315cfa1a1434baf891ce98ee8d871 Mon Sep 17 00:00:00 2001
> From: Lin Sun <sunlin7 <at> hotmail.com>
> Date: Tue, 11 Apr 2023 00:00:13 +0000
> Subject: [PATCH] *lisp/emacs-lisp/package.el: set variables after info package
>  be loaded
>
> ---
>  lisp/emacs-lisp/package.el | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index f92afe56b7..bb0491e509 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -892,10 +892,9 @@ package-activate-1
>          (add-to-list 'load-path (directory-file-name pkg-dir)))
>        ;; Add info node.
>        (when (file-exists-p (expand-file-name "dir" pkg-dir))
> -        ;; FIXME: not the friendliest, but simple.
> -        (require 'info)
> -        (info-initialize)
> -        (add-to-list 'Info-directory-list pkg-dir))
> +        (with-eval-after-load 'info
> +          (info-initialize)
> +          (add-to-list 'Info-directory-list pkg-dir)))
>        (push name package-activated-list)
>        ;; Don't return nil.
>        t)))

This bug report was last modified 1 year and 235 days ago.

Previous Next


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