From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master add49b6: * lisp/emacs-lisp/package.el: Reduce autoloading before compiling Date: Tue, 8 Sep 2015 02:59:20 +0100 Message-ID: References: <20150907225246.18328.36154@vcs.savannah.gnu.org> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1441677569 13454 80.91.229.3 (8 Sep 2015 01:59:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 01:59:29 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 08 03:59:28 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZZ8By-0006Li-LQ for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 03:59:26 +0200 Original-Received: from localhost ([::1]:59575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ8By-00023Q-AC for ged-emacs-devel@m.gmane.org; Mon, 07 Sep 2015 21:59:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ8Bv-00023F-Fh for emacs-devel@gnu.org; Mon, 07 Sep 2015 21:59:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZ8Bu-0007ur-IQ for emacs-devel@gnu.org; Mon, 07 Sep 2015 21:59:23 -0400 Original-Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]:36818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ8Bu-0007uG-BI for emacs-devel@gnu.org; Mon, 07 Sep 2015 21:59:22 -0400 Original-Received: by lbcao8 with SMTP id ao8so45568464lbc.3 for ; Mon, 07 Sep 2015 18:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=/l033HsYMzGv4U4T90Tb5iXuIdFow/fToQjX9vpW0q0=; b=RrPQo6Vdd4Ef4mn/x8vkONTz1zj95BMPtvQ8K5Djay/X03HEeJdq/4c+JofsYSJTeX Uz9dxBrRBnVQBwBgaQcqu9Q3wIoda6zwoKrLg73Eltsh6/qPp7TkFRHFUL6kk33ySoXS X511svqrbuizfRdVPyTQ37geA+8Yns6C+goIHC9hNCLT2xWD7Y/B0OjZoNn4d39mFIuX rMp3W4J6H4llodgvh+BTcuOAUKK9AURA2MmR/Ypnikfe5AirRZWLlbnadtdQsUPzFIg1 f0AdNhf9IX+wRVaaa7+thQCU0Cr+UvB8R4FC1Hcre9wTs1Np0eUxR6Wd7qoXcVLmbFWO AW4A== X-Received: by 10.112.25.69 with SMTP id a5mr19574347lbg.16.1441677560580; Mon, 07 Sep 2015 18:59:20 -0700 (PDT) Original-Received: by 10.25.213.202 with HTTP; Mon, 7 Sep 2015 18:59:20 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 0BULpTeVR-L_SYKrQUMuATGPNro X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189694 Archived-At: package-activate-1 was being called twice during installation. Once before compilation and once after. IIUC, there are only two things in package-activate-1 that affect byte-compilation: setting the load-path and loading the autoloads file. So I refactored those two functionalities into `package--activate-autoloads-and-load-path'. Now, instead of calling `package-activate-1' before compilation, we call this new simpler function. `package-activate-1' is still called after compilation, and it's functionality has not changed (it still sets the load-path and loads autoloads by calling this new function, in addition to the other stuff that it does). 1) `package-activate-1' has a couple of line that shouldn't be called twice, like (push name package-activated-list) and (push pkg-dir Info-directory-list). It wasn't the end of the world, but it was wrong (again, IIUC) and it could get worse if we extend this function in the future. 2) It's just confusing to see a package being activated twice throughout a single installation. I find it more informative to do specifically what we want (i.e., load autloads and set load-path before compilation). 3) The name package-activate-1 gives the impression that it's an implementation function for package-activate, which made it confusing that it was being called outside package-activate. 2015-09-08 2:33 GMT+01:00 Stefan Monnier : >> (package--autoloads-file-name) >> (package--activate-autoloads-and-load-path): New function. >> (package-activate-1): Delegate autoloading and load-path >> configuration to `package--activate-autoloads-and-load-path'. >> (package--compile): Before compilation, call >> `package--activate-autoloads-and-load-path' instead of >> `package-activate-1'. > > Not sure I follow what this is doing, nor why. Can you explain? > > > Stefan