From a9d9b66ebbf8a9797137c873bb2d194c529e9384 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Mon, 22 Jun 2015 16:20:46 +0100 Subject: [PATCH] * lisp/emacs-lisp/package.el: Rename hide-obsolete to toggle-hiding --- etc/NEWS | 2 +- lisp/emacs-lisp/package.el | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index bab1b41e759..b68a4b28c30 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -316,7 +316,7 @@ always respect that. priority (as per `package-archive-priorities') only that one is listed. This can be configured with `package-menu-hide-low-priority'. -*** `package-menu-hide-obsolete' now toggles the hiding of packages. +*** `package-menu-toggle-hiding' now toggles the hiding of packages. This includes the above-mentioned low-priority packages, as well as available packages whose version is lower than the currently installed version (which were previously impossible to display). diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 62900e08360..d6a3832016d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -237,8 +237,8 @@ This variable has three possible values: archive: only criteria (a) is used; t: both criteria are used. -This variable has no effect if `package-menu--hide-obsolete' is -nil, so it can be toggled with \\ \\[package-menu-hide-obsolete]." +This variable has no effect if `package-menu--hide-packages' is +nil, so it can be toggled with \\ \\[package-menu-toggle-hiding]." :type '(choice (const :tag "Don't hide anything" nil) (const :tag "Hide per package-archive-priorities" archive) @@ -2379,7 +2379,7 @@ will be deleted." (define-key map "x" 'package-menu-execute) (define-key map "h" 'package-menu-quick-help) (define-key map "?" 'package-menu-describe-package) - (define-key map "(" #'package-menu-hide-obsolete) + (define-key map "(" #'package-menu-toggle-hiding) (define-key map [menu-bar package-menu] (cons "Package" menu-map)) (define-key menu-map [mq] '(menu-item "Quit" quit-window @@ -2538,26 +2538,26 @@ of these dependencies, similar to the list returned by (cond ;; Installed obsolete packages are handled in the `dir' ;; clause above. Here we handle available obsolete, which - ;; are displayed depending on `package-menu--hide-obsolete'. + ;; are displayed depending on `package-menu--hide-packages'. ((and ins (version-list-<= version ins-v)) "avail-obso") (t (if (memq name package-menu--new-package-list) "new" "available")))))))) -(defvar package-menu--hide-obsolete t +(defvar package-menu--hide-packages t "Whether available obsolete packages should be hidden. -Can be toggled with \\ \\[package-menu-hide-obsolete]. +Can be toggled with \\ \\[package-menu-toggle-hiding]. Installed obsolete packages are always displayed.") -(defun package-menu-hide-obsolete () +(defun package-menu-toggle-hiding () "Toggle visibility of obsolete available packages." (interactive) (unless (derived-mode-p 'package-menu-mode) (user-error "The current buffer is not a Package Menu")) - (setq package-menu--hide-obsolete - (not package-menu--hide-obsolete)) (message "%s available-obsolete packages" (if package-menu--hide-obsolete "Hiding" "Displaying")) + (setq package-menu--hide-packages + (not package-menu--hide-packages)) (revert-buffer nil 'no-confirm)) (defun package--remove-hidden (pkg-list) @@ -2567,8 +2567,8 @@ same name, sorted by decreasing `package-desc-priority-version'. Return a list of packages tied for the highest priority according to their archives." (when pkg-list - ;; Variable toggled with `package-menu-hide-obsolete'. - (if (not package-menu--hide-obsolete) + ;; Variable toggled with `package-menu-toggle-hiding'. + (if (not package-menu--hide-packages) pkg-list (let ((installed (cadr (assq (package-desc-name (car pkg-list)) package-alist)))) -- 2.39.5