From: Philip Kaludercic Date: Thu, 11 Aug 2022 12:05:01 +0000 (+0200) Subject: * package.el (describe-package-1): Add news if avaliable X-Git-Tag: emacs-29.0.90~1616^2~307^2~91 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dd98fedd0c7f27bfba046d761042c19181cb461d;p=emacs.git * package.el (describe-package-1): Add news if avaliable --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0145306dc4e..ab1a652188f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2658,7 +2658,10 @@ Helper function for `describe-package'." (incompatible-reason (package--incompatible-p desc)) (signed (if desc (package-desc-signed desc))) (maintainer (cdr (assoc :maintainer extras))) - (authors (cdr (assoc :authors extras)))) + (authors (cdr (assoc :authors extras))) + (news (and-let* ((file (expand-file-name "news" pkg-dir)) + ((file-readable-p file))) + file))) (when (string= status "avail-obso") (setq status "available obsolete")) (when incompatible-reason @@ -2857,6 +2860,14 @@ Helper function for `describe-package'." t) (insert (or readme-string "This package does not provide a description."))))) + + ;; Insert news if available. + (when news + (insert "\n" (make-separator-line) "\n" + (propertize "* News" 'face 'package-help-section-name) + "\n\n") + (insert-file-contents news)) + ;; Make library descriptions into links. (goto-char start-of-description) (package--describe-add-library-links)