From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Elpa packages and macro dependencies. Date: Thu, 13 Nov 2014 12:34:48 -0500 Message-ID: References: <87h9yz5d9h.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415900184 20224 80.91.229.3 (13 Nov 2014 17:36:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2014 17:36:24 +0000 (UTC) Cc: emacs-devel To: Artur Malabarba Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 13 18:36:06 2014 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 1XoyJP-0003Dm-Ic for ged-emacs-devel@m.gmane.org; Thu, 13 Nov 2014 18:36:03 +0100 Original-Received: from localhost ([::1]:33117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoyJO-000158-UO for ged-emacs-devel@m.gmane.org; Thu, 13 Nov 2014 12:36:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoyIl-0000qf-P5 for emacs-devel@gnu.org; Thu, 13 Nov 2014 12:35:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoyId-0006hU-Ez for emacs-devel@gnu.org; Thu, 13 Nov 2014 12:35:23 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:49765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoyId-0006hC-4X for emacs-devel@gnu.org; Thu, 13 Nov 2014 12:35:15 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 6A3EC850AE; Thu, 13 Nov 2014 12:35:14 -0500 (EST) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 7FD081E5B8A; Thu, 13 Nov 2014 12:34:48 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 65181B40E9; Thu, 13 Nov 2014 12:34:48 -0500 (EST) In-Reply-To: (Artur Malabarba's message of "Thu, 13 Nov 2014 11:57:06 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:176973 Archived-At: > + ;; Call `load' on all files in `pkg-dir' which correspond to > + ;; provided features. Skip autoloads file since we already > + ;; evaluated it above. Please add a to this comment a short explanation for why we do those loads. Also I think we should not pay attention to features here, only to file names. One more thing: we should do those loads *after* the code that updates load-path. > + (lambda (x) (let* ((name (file-name-base x)) > + (hist (memq (intern-soft name) features))) I.e. here we should use `load-history' rather than `features'. One other thing: we could probably get something more reliable by doing the following: 1- before loading the autoloads file (and before updating load-path), get do the `directory-files' call 2- use `locate-library' to see which of those files have previous "conflicting" files. 3- check in load-history which of those conflicting files have been already loaded. 4- then load autoloads and updates load-path. 5- then load those files identified at step 3. Maybe we could use the same mechanism after byte-compilation, so as to re-re-load the file after it's been byte-compiled. Tho this might just be asking for trouble. Stefan