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: [Emacs-diffs] malabarba/package.el-reload-files-on-upgrade 300dbb1 1/2: * emacs-lisp/package.el (package--list-loaded-files): New function Date: Wed, 10 Dec 2014 22:15:38 -0500 Message-ID: References: <20141211001200.20245.22729@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418267769 25537 80.91.229.3 (11 Dec 2014 03:16:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Dec 2014 03:16:09 +0000 (UTC) Cc: Artur Malabarba To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 11 04:16:02 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 1XyuES-0002w4-68 for ged-emacs-devel@m.gmane.org; Thu, 11 Dec 2014 04:16:00 +0100 Original-Received: from localhost ([::1]:48924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyuER-0004yp-Ev for ged-emacs-devel@m.gmane.org; Wed, 10 Dec 2014 22:15:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyuEH-0004yX-9h for emacs-devel@gnu.org; Wed, 10 Dec 2014 22:15:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyuE9-0001fC-Qr for emacs-devel@gnu.org; Wed, 10 Dec 2014 22:15:49 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:53107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyuE9-0001f5-HC for emacs-devel@gnu.org; Wed, 10 Dec 2014 22:15:41 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sBB3Fcud027842; Wed, 10 Dec 2014 22:15:38 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 51972660F3; Wed, 10 Dec 2014 22:15:38 -0500 (EST) In-Reply-To: (Artur Malabarba's message of "Thu, 11 Dec 2014 00:12:00 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered LNG_SB_1=0.2, RV5151=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5151> : inlines <1625> : streams <1354969> : uri <1838087> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:179718 Archived-At: > -(defun package-built-in-p (package &optional min-version) > - "Return true if PACKAGE is built-in to Emacs. > -Optional arg MIN-VERSION, if non-nil, should be a version list > -specifying the minimum acceptable version." > - (if (package-desc-p package) ;; was built-in and then was converted > - (eq 'builtin (package-desc-dir package)) > - (let ((bi (assq package package--builtin-versions))) > - (cond > - (bi (version-list-<= min-version (cdr bi))) > - ((remove 0 min-version) nil) > - (t > - (require 'finder-inf nil t) ; For `package--builtins'. > - (assq package package--builtins)))))) Why remove this function? > +(defun package-list-loaded-files (dir) > + "List all files in DIR which correspond to loaded features. > +Returns the `file-name-base' of each file, sorted by most recently > +loaded last." I don't really like the assumption that package names don't have slash in them (this is false for CEDET, for example, and I think that AUCTeX also uses names with slash for its style files). But I guess it's OK for now. > + (mapcar (lambda (x) (let* ((path (file-name-sans-extension > + (file-truename > + (find-library-name (file-name-base x))))) We follow the convention to only use "path" to mean a list of directories such as $PATH, load-path, and things like that. I.e. "/foo/bar/baz" is a *file* name, not a "path". Stefan