[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/package+vc 7640b0751b 1/4: Add auxiliary function to query packa
From: |
Philip Kaludercic |
Subject: |
feature/package+vc 7640b0751b 1/4: Add auxiliary function to query package specifications |
Date: |
Sun, 23 Oct 2022 12:05:11 -0400 (EDT) |
branch: feature/package+vc
commit 7640b0751ba1065f43ff93ed7ad2cc0d9dff9a97
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Add auxiliary function to query package specifications
* lisp/emacs-lisp/package-vc.el (package-vc-query-spec): Add
inline function.
---
lisp/emacs-lisp/package-vc.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 562c534002..769f9ac5dc 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -38,6 +38,7 @@
;;; Code:
(eval-when-compile (require 'rx))
+(eval-when-compile (require 'inline))
(require 'package)
(require 'lisp-mnt)
(require 'vc)
@@ -140,6 +141,13 @@ name for PKG-DESC."
nil nil #'string=)))
spec))
+(define-inline package-vc-query-spec (pkg-desc prop)
+ "Query the property PROP for the package specification for PKG-DESC.
+If no package specification can be determined, the function will
+return nil."
+ (inline-letevals (pkg-desc prop)
+ (inline-quote (plist-get (pacakge-vc-desc->spec ,pkg-desc) ,prop))))
+
(defun package-vc--read-archive-data (archive)
"Update `package-vc-archive-spec-alist' with the contents of ARCHIVE.
This function is meant to be used as a hook for