diff options
| author | Bruno Félix Rezende Ribeiro <oitofelix@gnu.org> | 2019-10-08 04:32:18 -0300 |
|---|---|---|
| committer | Stefan Kangas <stefankangas@gmail.com> | 2020-01-23 22:57:23 +0100 |
| commit | 963a9ffd66cb29f0370e9a4b854dddda242c54a6 (patch) | |
| tree | ffd9b49f7c97d33d8f2a909785654bd28220bd8f /lisp/emacs-lisp/package.el | |
| parent | cd2d812ec1745a7e6de2b29db1a9bf9f1125b501 (diff) | |
| download | emacs-963a9ffd66cb29f0370e9a4b854dddda242c54a6.tar.gz | |
Globally sanitize single-file package long descriptions (Bug#37548)
Consistent with multi-file package descriptions which don’t have
commentary sections nor double semicolon prefixes.
* lisp/emacs-lisp/lisp-mnt.el (lm-commentary): Remove commentary
header, double semicolon prefixes of each line, trailing new-lines and
trailing white-space from commentary.
* lisp/emacs-lisp/package.el (package--get-description)
(describe-package-1):
* lisp/finder.el (finder-commentary):
* lisp/info.el (Info-finder-find-node): Remove ad-hoc sanitation.
Diffstat (limited to 'lisp/emacs-lisp/package.el')
| -rw-r--r-- | lisp/emacs-lisp/package.el | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4f182fd5227..a9508c1bdc5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2376,18 +2376,9 @@ The description is read from the installed package files." result ;; Look for Commentary header. - (let ((mainsrcfile (expand-file-name (format "%s.el" (package-desc-name desc)) - srcdir))) - (when (file-readable-p mainsrcfile) - (with-temp-buffer - (insert (or (lm-commentary mainsrcfile) "")) - (goto-char (point-min)) - (when (re-search-forward "^;;; Commentary:\n" nil t) - (replace-match "")) - (while (re-search-forward "^\\(;+ ?\\)" nil t) - (replace-match "")) - (buffer-string)))) - ))) + (lm-commentary (expand-file-name + (format "%s.el" (package-desc-name desc)) srcdir)) + ""))) (defun describe-package-1 (pkg) "Insert the package description for PKG. @@ -2582,16 +2573,10 @@ Helper function for `describe-package'." (if built-in ;; For built-in packages, get the description from the ;; Commentary header. - (let ((fn (locate-file (format "%s.el" name) load-path - load-file-rep-suffixes)) - (opoint (point))) - (insert (or (lm-commentary fn) "")) - (save-excursion - (goto-char opoint) - (when (re-search-forward "^;;; Commentary:\n" nil t) - (replace-match "")) - (while (re-search-forward "^\\(;+ ?\\)" nil t) - (replace-match "")))) + (insert (or (lm-commentary (locate-file (format "%s.el" name) + load-path + load-file-rep-suffixes)) + "")) (if (package-installed-p desc) ;; For installed packages, get the description from the |
