;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/elpa.el (require 'cl-lib) (require 'close) (require 'package) (require 'scroll) (cl-pushnew '("melpa" . "https://melpa.org/packages/") package-archives :test #'equal) (let*((pack-status '#1=("" "available" "built-in" "dependency" "incompat" "installed" "new" . #1#) )) (defun pack-filter (&optional status) (interactive) (or status (setq status (pop pack-status))) (package-menu-filter-by-status status) (message (if (string-empty-p status) "all" status) ))) (declare-function pack-filter nil) (defun elpa (&optional get) (interactive "P") (if get (list-packages) (let ((buf (get-buffer "*Packages*"))) ; hardcoded in package.el 28 times (if (and buf (bufferp buf)) (pop-to-buffer buf) (list-packages) )))) (defalias 'melpa #'elpa) (let ((kmap package-menu-mode-map)) (set-close-key kmap) (set-pane-scroll-keys kmap) (set-vertical-keys kmap) (define-key kmap "\t" #'pack-filter) ) (provide 'elpa)