mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 19:17:27 +00:00
Extract :url and :keywords to package info
This commit is contained in:
parent
f59685b098
commit
b7d29cb544
1 changed files with 24 additions and 6 deletions
|
@ -836,13 +836,31 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
"Return a vector of package info.
|
||||
`package-buffer-info' returns a vector in older Emacs versions,
|
||||
and a cl struct in Emacs HEAD. This wrapper normalises the results."
|
||||
(let ((desc (package-buffer-info)))
|
||||
(let ((desc (package-buffer-info))
|
||||
(keywords (lm-keywords-list)))
|
||||
(if (fboundp 'package-desc-create)
|
||||
(vector (package-desc-name desc)
|
||||
(package-desc-reqs desc)
|
||||
(package-desc-summary desc)
|
||||
(package-desc-version desc))
|
||||
desc)))
|
||||
(let ((extras (package-desc-extras desc)))
|
||||
(when (and keywords (not (assq :keywords extras)))
|
||||
;; Add keywords to package properties, if not already present
|
||||
(push (cons :keywords keywords) extras))
|
||||
(vector (package-desc-name desc)
|
||||
(package-desc-reqs desc)
|
||||
(package-desc-summary desc)
|
||||
(package-desc-version desc)
|
||||
extras))
|
||||
;; The regexp and the processing is taken from `lm-homepage' in Emacs 24.4
|
||||
(let* ((page (lm-header "\\(?:x-\\)?\\(?:homepage\\|url\\)"))
|
||||
(homepage (if (and page (string-match "^<.+>$" page))
|
||||
(substring page 1 -1)
|
||||
page))
|
||||
extras)
|
||||
(when keywords (push (cons :keywords keywords) extras))
|
||||
(when homepage (push (cons :url homepage) extras))
|
||||
(vector (aref desc 0)
|
||||
(aref desc 1)
|
||||
(aref desc 2)
|
||||
(aref desc 3)
|
||||
extras)))))
|
||||
|
||||
|
||||
;;; Public interface
|
||||
|
|
Loading…
Reference in a new issue