Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 57ff1cc9 authored by Kyle Hargraves's avatar Kyle Hargraves

el-get-describe: guess a project's github URL if no website was defined in the recipe

parent e8edbf7f
......@@ -64,6 +64,12 @@ matching REGEX with TYPE and ARGS as parameter."
(re-search-backward regex nil t)
(apply #'help-xref-button 1 type args))))
(defun el-get-guess-github-website (url)
"If a package's URL is on Github, return the project's Github URL."
(when (and url (string-match "github\\.com/" url))
(replace-regexp-in-string "\\.git$" ""
(replace-regexp-in-string "\\(git\\|https\\)://" "http://" url))))
(defun el-get-describe-1 (package)
(let* ((psym (el-get-as-symbol package))
(pname (symbol-name psym))
......@@ -92,9 +98,11 @@ matching REGEX with TYPE and ARGS as parameter."
'el-get-help-install package)))
(princ ".\n\n")
(when website
(el-get-describe-princ-button (format "Website: %s\n" website)
": \\(.+\\)" 'help-url website))
(let ((website (or website
(and (eq 'git type) (el-get-guess-github-website url)))))
(when website
(el-get-describe-princ-button (format "Website: %s\n" website)
": \\(.+\\)" 'help-url website)))
(when descr
(princ (format "Description: %s\n" descr)))
(when depends
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment