summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-05-09 20:04:41 +0100
committerAndrea Corallo <akrl@sdf.org>2020-05-09 20:04:41 +0100
commitbc50c0c57eca22cb290465ae5df93d48326eeb05 (patch)
treeee2d35699a5307cf43c03c7788bac8b637db0174 /lisp/emacs-lisp
parentbd8be64ce3f314c152d009f5bf88bcfadf6daef7 (diff)
parent9d8fc3a598090da518fcdd5c0503ed0f7faa41a9 (diff)
downloademacs-bc50c0c57eca22cb290465ae5df93d48326eeb05.tar.gz
emacs-bc50c0c57eca22cb290465ae5df93d48326eeb05.tar.bz2
emacs-bc50c0c57eca22cb290465ae5df93d48326eeb05.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-run.el11
-rw-r--r--lisp/emacs-lisp/package.el31
2 files changed, 37 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index fa769adb061..88e21b73fed 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -536,11 +536,12 @@ wrong number of parameters, say
(zot 1 2))
The warnings that can be suppressed are a subset of the warnings
-in `byte-compile-warning-types'; see this variable for a fuller
-explanation of the warning types. The types that can be
-suppressed with this macro are `free-vars', `callargs',
-`redefine', `obsolete', `interactive-only', `lexical', `mapcar',
-`constants' and `suspicious'.
+in `byte-compile-warning-types'; see the variable
+`byte-compile-warnings' for a fuller explanation of the warning
+types. The types that can be suppressed with this macro are
+`free-vars', `callargs', `redefine', `obsolete',
+`interactive-only', `lexical', `mapcar', `constants' and
+`suspicious'.
For the `mapcar' case, only the `mapcar' function can be used in
the symbol list. For `suspicious', only `set-buffer' can be used."
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index b33e4897a01..95659840ad5 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2692,6 +2692,7 @@ either a full name or nil, and EMAIL is a valid email address."
(define-key map (kbd "/ n") 'package-menu-filter-by-name)
(define-key map (kbd "/ s") 'package-menu-filter-by-status)
(define-key map (kbd "/ v") 'package-menu-filter-by-version)
+ (define-key map (kbd "/ m") 'package-menu-filter-marked)
map)
"Local keymap for `package-menu-mode' buffers.")
@@ -2722,6 +2723,7 @@ either a full name or nil, and EMAIL is a valid email address."
["Filter by Name" package-menu-filter-by-name :help "Filter packages by name"]
["Filter by Status" package-menu-filter-by-status :help "Filter packages by status"]
["Filter by Version" package-menu-filter-by-version :help "Filter packages by version"]
+ ["Filter Marked" package-menu-filter-marked :help "Filter packages marked for upgrade"]
["Clear Filter" package-menu-clear-filter :help "Clear package list filter"])
["Hide by Regexp" package-menu-hide-package :help "Hide all packages matching a regexp"]
@@ -3855,6 +3857,35 @@ If VERSION is nil or the empty string, show all packages."
(funcall fun (package-desc-version pkg-desc) ver)))
(format "versions:%s%s" predicate version)))))
+(defun package-menu-filter-marked ()
+ "Filter \"*Packages*\" buffer by non-empty upgrade mark.
+Unlike other filters, this leaves the marks intact."
+ (interactive)
+ (package--ensure-package-menu-mode)
+ (widen)
+ (let (found-entries mark pkg-id entry marks)
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (eobp))
+ (setq mark (char-after))
+ (unless (eq mark ?\s)
+ (setq pkg-id (tabulated-list-get-id))
+ (setq entry (package-menu--print-info-simple pkg-id))
+ (push entry found-entries)
+ ;; remember the mark
+ (push (cons pkg-id mark) marks))
+ (forward-line))
+ (if found-entries
+ (progn
+ (setq tabulated-list-entries found-entries)
+ (package-menu--display t nil)
+ ;; redo the marks, but we must remember the marks!!
+ (goto-char (point-min))
+ (while (not (eobp))
+ (setq mark (cdr (assq (tabulated-list-get-id) marks)))
+ (tabulated-list-put-tag (char-to-string mark) t)))
+ (user-error "No packages found")))))
+
(defun package-menu-clear-filter ()
"Clear any filter currently applied to the \"*Packages*\" buffer."
(interactive)