diff options
| author | Philip Kaludercic | 2022-08-11 14:05:01 +0200 |
|---|---|---|
| committer | Philip Kaludercic | 2022-08-11 14:06:43 +0200 |
| commit | dd98fedd0c7f27bfba046d761042c19181cb461d (patch) | |
| tree | ba56ff0ae8910e9f50cca6ef24d4378f9ed5c81b | |
| parent | fb87d5008e21d1bc03547c1edf2280fb4cb8311e (diff) | |
| download | emacs-dd98fedd0c7f27bfba046d761042c19181cb461d.tar.gz emacs-dd98fedd0c7f27bfba046d761042c19181cb461d.zip | |
* package.el (describe-package-1): Add news if avaliable
| -rw-r--r-- | lisp/emacs-lisp/package.el | 13 |
1 files changed, 12 insertions, 1 deletions
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'." | |||
| 2658 | (incompatible-reason (package--incompatible-p desc)) | 2658 | (incompatible-reason (package--incompatible-p desc)) |
| 2659 | (signed (if desc (package-desc-signed desc))) | 2659 | (signed (if desc (package-desc-signed desc))) |
| 2660 | (maintainer (cdr (assoc :maintainer extras))) | 2660 | (maintainer (cdr (assoc :maintainer extras))) |
| 2661 | (authors (cdr (assoc :authors extras)))) | 2661 | (authors (cdr (assoc :authors extras))) |
| 2662 | (news (and-let* ((file (expand-file-name "news" pkg-dir)) | ||
| 2663 | ((file-readable-p file))) | ||
| 2664 | file))) | ||
| 2662 | (when (string= status "avail-obso") | 2665 | (when (string= status "avail-obso") |
| 2663 | (setq status "available obsolete")) | 2666 | (setq status "available obsolete")) |
| 2664 | (when incompatible-reason | 2667 | (when incompatible-reason |
| @@ -2857,6 +2860,14 @@ Helper function for `describe-package'." | |||
| 2857 | t) | 2860 | t) |
| 2858 | (insert (or readme-string | 2861 | (insert (or readme-string |
| 2859 | "This package does not provide a description."))))) | 2862 | "This package does not provide a description."))))) |
| 2863 | |||
| 2864 | ;; Insert news if available. | ||
| 2865 | (when news | ||
| 2866 | (insert "\n" (make-separator-line) "\n" | ||
| 2867 | (propertize "* News" 'face 'package-help-section-name) | ||
| 2868 | "\n\n") | ||
| 2869 | (insert-file-contents news)) | ||
| 2870 | |||
| 2860 | ;; Make library descriptions into links. | 2871 | ;; Make library descriptions into links. |
| 2861 | (goto-char start-of-description) | 2872 | (goto-char start-of-description) |
| 2862 | (package--describe-add-library-links) | 2873 | (package--describe-add-library-links) |