]> git.eshelyaron.com Git - emacs.git/commitdiff
Advertise https for homepage of gnu.org packages
authorGlenn Morris <rgm@gnu.org>
Tue, 4 Apr 2017 23:39:57 +0000 (19:39 -0400)
committerGlenn Morris <rgm@gnu.org>
Tue, 4 Apr 2017 23:39:57 +0000 (19:39 -0400)
* lisp/emacs-lisp/package.el (describe-package-1):
Use https, if supported, for the homepage of packages on gnu.org.

lisp/emacs-lisp/package.el

index fadd869c9d908951c3f7f90458d0d3512216dc42..85acf60d08edcabbcf8e8f42dadcfe62ff76cc68 100644 (file)
@@ -2354,6 +2354,13 @@ Otherwise no newline is inserted."
                                      (package-desc-name pkg))))
         (insert "\n")))
     (when homepage
+      ;; Prefer https for the homepage of packages on gnu.org.
+      (let ((gnu (cdr (assoc "gnu" package-archives))))
+        (and gnu
+             (string-match-p "^https" gnu)
+             (string-match-p "^http://\\(elpa\\|www\\)\\.gnu\\.org/" homepage)
+             (setq homepage
+                   (replace-regexp-in-string "^http" "https" homepage))))
       (package--print-help-section "Homepage")
       (help-insert-xref-button homepage 'help-url homepage)
       (insert "\n"))