From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62767: 29.0.90; [PATCH] *lisp/emacs-lisp/package.el: set variables after info package Date: Mon, 17 Apr 2023 14:53:50 +0800 Message-ID: References: <1181651021.466162.1581309285621.ref@mail.yahoo.com> <1181651021.466162.1581309285621@mail.yahoo.com> <87sfd2ns6d.fsf@posteo.net> <833551ecb2.fsf@gnu.org> <87ttxh4e9i.fsf@posteo.net> Reply-To: Ruijie Yu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10644"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.22; emacs 30.0.50 Cc: 62767@debbugs.gnu.org, philipk@posteo.net, eliz@gnu.org To: lin Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 17 08:59:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1poIph-0002eM-3q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Apr 2023 08:59:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poIpW-0001cE-Mt; Mon, 17 Apr 2023 02:59:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poIpL-0001aL-5b for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2023 02:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poIpK-0000ho-T3 for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2023 02:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1poIpK-0004BF-Bk for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2023 02:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Apr 2023 06:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: 62767@debbugs.gnu.org, Philip Kaludercic , bug-gnu-emacs@gnu.org, Eli Zaretskii Original-Received: via spool by submit@debbugs.gnu.org id=B.168171471216023 (code B ref -1); Mon, 17 Apr 2023 06:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Apr 2023 06:58:32 +0000 Original-Received: from localhost ([127.0.0.1]:52978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poIoq-0004AN-Dd for submit@debbugs.gnu.org; Mon, 17 Apr 2023 02:58:32 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poIoo-0004AF-L8 for submit@debbugs.gnu.org; Mon, 17 Apr 2023 02:58:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poIoo-0001Z3-9q for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2023 02:58:30 -0400 Original-Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poIok-0000V8-1H; Mon, 17 Apr 2023 02:58:29 -0400 Original-Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id c4417944 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 17 Apr 2023 06:58:20 +0000 (UTC) In-reply-to: Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260172 Archived-At: lin Sun via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Hi Philip, > > I had researched these three calls with the "require 'info", and > updated the patch for better performance. > The 1 th and 3rd can be rewritten with the new form, but the 2nd one > is necessary, and should not be changed. > @@ -4427,7 +4426,7 @@ package-quickstart-refresh > "(Re)Generate the `package-quickstart-file'." > (interactive) > (package-initialize 'no-activate) > - (require 'info) > + (require 'info) ; insure Info-directory-list avaliable for package-activate "insure" -> "ensure"? > (let ((package--quickstart-pkgs ()) > ;; Pretend we haven't activated anything yet! > (package-activated-list ()) > @@ -4472,10 +4471,10 @@ package-quickstart-refresh > (current-buffer)) > (let ((info-dirs (butlast Info-directory-list))) > (when info-dirs > - (pp `(progn (require 'info) > - (info-initialize) > - (setq Info-directory-list > - (append ',info-dirs Info-directory-list))) > + (pp `(with-eval-after-load 'info > + (info-initialize) > + (setq Info-directory-list > + (append ',info-dirs Info-directory-list))) > (current-buffer)))) I did some testing, and noticed that `with-eval-after-load' returns nil to its caller when the feature is not loaded. That is, when `info' is not already loaded, you are effectively calling (pp nil). This is not feature-equivalent to the original code, so this might require the `require' form. -- Best, RY