[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] malabarba/package.el-reload-files-on-upgrade 37cbe15 1/4:
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] malabarba/package.el-reload-files-on-upgrade 37cbe15 1/4: Revert accidental deletion of package-built-in-p |
Date: |
Thu, 11 Dec 2014 08:33:44 +0000 |
branch: malabarba/package.el-reload-files-on-upgrade
commit 37cbe156f5092b8889d47584219cfa06bcc6295a
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
Revert accidental deletion of package-built-in-p
This partially reverts commit 300dbb1e183afd63721ee4e83e105e494b83d8d7.
Conflicts:
lisp/ChangeLog
---
lisp/emacs-lisp/package.el | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6c795e1..f4fd33d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -577,6 +577,20 @@ loaded last."
;; Sort the files by ascending HISORY-POSITION.
(lambda (x y) (< (cdr x) (cdr y)))))))
+(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))))))
+
(defun package--from-builtin (bi-desc)
(package-desc-create :name (pop bi-desc)
:version (package--bi-desc-version bi-desc)