Subject: Re: bug#39436: closed (Re: bug#39436: 27.0.60; Documentaion error for package-menu-hide-package)

From: Stefan Kangas <[email-masked]>
Date: Wed, 11 Mar 2020 21:37:07 +0100

Pieter van Oostrum <[email-masked]> writes:

> This could be interpreted that only this regexp is saved. In reality
> it is the collective list of the regexps that have been entered in
> this way, that is saved, until the option is cleared/changed.

Good point, thanks.  I've attached a revised version which goes a bit
further to document how this works.  Feedback welcome.

Best regards,
Stefan Kangas

>From 5d3131c6658183863bc80b873f334bb5a70b152e Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Wed, 11 Mar 2020 03:05:12 +0100
Subject: [PATCH] Improve Package Menu hiding docstrings

* lisp/emacs-lisp/package.el (package-menu-toggle-hiding): Add
reference to 'package-menu-hidden-regexps'.
* lisp/emacs-lisp/package.el (package-menu-hide-package): Improve
docstring to say that hiding is saved in a user option.  Fix a
typo.  (Bug#39436)
---
 lisp/emacs-lisp/package.el | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 43eb038a86..076129f57a 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2861,7 +2861,11 @@ package-menu--hide-packages
 Installed obsolete packages are always displayed.")
 
 (defun package-menu-toggle-hiding ()
-  "In Package Menu, toggle visibility of obsolete available packages."
+  "In Package Menu, toggle visibility of obsolete available packages.
+
+Also hide packages whose name matches a regexp in user option
+`package-hidden-regexps' (a list).  To add regexps to this list,
+use `package-menu-hide-package'.."
   (interactive)
   (package--ensure-package-menu-mode)
   (setq package-menu--hide-packages
@@ -3190,8 +3194,16 @@ 'package-menu-refresh
 
 (defun package-menu-hide-package ()
   "Hide in Package Menu packages that match a regexp.
-Prompts for the regexp to match against package names.
-The default regexp will hide only the package whose name is at point."
+Prompt for the regexp to match against package names.
+The default regexp will hide only the package whose name is at point.
+
+The regexp is added to the list in the user option
+`package-hidden-regexps' and saved for future sessions.
+
+To unhide a package, type
+`\\[customize-variable] RET package-hidden-regexps'.
+
+Type \\[package-menu-toggle-hiding] to toggle package hiding."
   (interactive)
   (package--ensure-package-menu-mode)
   (declare (interactive-only "change `package-hidden-regexps' instead."))
@@ -3210,7 +3222,7 @@ package-menu-hide-package
                              package-archive-contents)))
       (message "Packages to hide: %d.  Type `%s' to toggle or `%s' to customize"
                (length hidden)
-               (substitute-command-keys "\\[package-menu-toggle-hidding]")
+               (substitute-command-keys "\\[package-menu-toggle-hiding]")
                (substitute-command-keys "\\[customize-variable] RET package-hidden-regexps")))))

-- 
2.25.1