Skip to content

Instantly share code, notes, and snippets.

@tarsius
Last active December 25, 2020 13:16
Show Gist options
  • Save tarsius/ee51369ee7e07821e45e123f4067a5db to your computer and use it in GitHub Desktop.
Save tarsius/ee51369ee7e07821e45e123f4067a5db to your computer and use it in GitHub Desktop.
(dolist (dir (directory-files "elpa" t "^[^.]"))
(let ((name (file-name-nondirectory dir)))
(when (string-match "\\(.+\\)-[^-]+\\'" name)
(let ((file (expand-file-name (concat (match-string 1 name) "-pkg.el") dir)))
(with-temp-file file
(save-excursion (insert-file-contents file))
(when (looking-at "(define-package \\([^\" ]+\\)")
(message "Fixing %s..." file)
(replace-match "\"\\1\"" t nil nil 1)
(message "Fixing %s...done" file)))))))
@tarsius
Copy link
Author

tarsius commented Dec 25, 2020

$ cd ~/.emacs.d    # or ~/.config/emacs
$ wget https://gist.githubusercontent.com/tarsius/ee51369ee7e07821e45e123f4067a5db/raw/d8c569a82089a8a53c08ee9621211e29a2264737/fix-pkg.el
$ emacs -Q --batch --load fix-pkg.el

This assumes that the default installation location is used. If you use something else, then you have to replace the "elpa" with whatever is correct in your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment