Skip to content

Instantly share code, notes, and snippets.

@darrik
Created March 27, 2016 20:31
Show Gist options
  • Save darrik/4ec18259b27d4a1435ad to your computer and use it in GitHub Desktop.
Save darrik/4ec18259b27d4a1435ad to your computer and use it in GitHub Desktop.
Unmark packages matching REGEXP from being upgraded.
(defun darrik/package-install-unmark-regexp (pattern)
"Unmark packages matching REGEXP from being upgraded."
(interactive "sPattern: ")
(let* ((_prefix "^\\(I\\|D\\)\\\s+.*")
(_re (concat _prefix pattern)))
(while (re-search-forward _re nil t)
(beginning-of-line)
;; (message "%s" "I unmarked something!")
(package-menu-mark-unmark)))
(message "%s" "Finished unmarking packages."))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment