From: Eshel Yaron Date: Sun, 30 Jun 2024 18:48:05 +0000 (+0200) Subject: (describe-library): Mention package that library is part of X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c46f1d959b42f97b93571b6fabd0ee22536c87fa;p=emacs.git (describe-library): Mention package that library is part of --- diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 826198f0833..d6d18b3ba2d 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -502,6 +502,10 @@ distribution." (lm-with-file file (lm-header "adapted-by"))) +(defun lm-package (&optional file) + "Return the package that FILE belongs to." + (lm-with-file file (lm-header "package"))) + (defun lm-commentary (&optional file) "Return the commentary in file FILE, or current buffer if FILE is nil. Return the value as a string. In the file, the commentary diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 630b2110902..9469d73b7d5 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -2580,6 +2580,7 @@ to find out more details about the symbols." (declare-function lm-summary "lisp-mnt" (&optional file)) (declare-function lm-keywords "lisp-mnt" (&optional file)) (declare-function lm-commentary "lisp-mnt" (&optional file)) +(declare-function lm-package "lisp-mnt" (&optional file)) ;;;###autoload (defun describe-library (library) @@ -2600,7 +2601,10 @@ to find out more details about the symbols." (if-let (keywords (lm-keywords file)) (concat "\n\nKeywords: [" (replace-regexp-in-string ",? " "] [" keywords) - "]") + "]" + (when-let (package (lm-package file)) + (concat "\nPart of package " + (substitute-quotes (format "`%s'" package))))) "") "\n\n" (substitute-quotes (or (lm-commentary file)