more robust auto-installation sequence (package name may differ from
major mode name now)
This commit is contained in:
parent
fe89220fca
commit
22be13f741
1 changed files with 27 additions and 22 deletions
|
@ -64,27 +64,31 @@
|
||||||
|
|
||||||
(prelude-install-packages)
|
(prelude-install-packages)
|
||||||
|
|
||||||
(defmacro prelude-auto-install (ext mode)
|
(defmacro prelude-auto-install (extension package mode)
|
||||||
`(add-to-list 'auto-mode-alist
|
`(add-to-list 'auto-mode-alist
|
||||||
`(,ext . (lambda ()
|
`(,extension . (lambda ()
|
||||||
(package-install ',mode)
|
(package-install ',package)
|
||||||
(,mode)))))
|
(,mode)))))
|
||||||
|
|
||||||
(defvar prelude-auto-install-alist
|
(defvar prelude-auto-install-alist
|
||||||
'(("\\.markdown\\'" . markdown-mode)
|
'(("\\.markdown\\'" markdown-mode markdown-mode)
|
||||||
("\\.md\\'" . markdown-mode)
|
("\\.md\\'" markdown-mode markdown-mode)
|
||||||
("\\.haml\\'" . haml-mode)
|
("\\.haml\\'" haml-mode haml-mode)
|
||||||
("\\.scss\\'" . scss-mode)
|
("\\.scss\\'" prelude-scss scss-mode)
|
||||||
("\\.sass\\'" . sass-mode)
|
("\\.sass\\'" sass-mode sass-mode)
|
||||||
("\\.groovy\\'" . groovy-mode)
|
("\\.groovy\\'" groovy-mode groovy-mode)
|
||||||
("\\.yml\\'" . yaml-mode)
|
("\\.yml\\'" yaml-mode yaml-mode)
|
||||||
("\\.php\\'" . php-mode)
|
("\\.php\\'" php-mode php-mode)
|
||||||
("\\.hs\\'" . haskell-mode)
|
("\\.hs\\'" prelude-haskell haskell-mode)
|
||||||
("\\.less\\'" . less-css-mode)
|
("\\.less\\'" less-css-mode less-css-mode)
|
||||||
("\\.lua\\'" . lua-mode)
|
("\\.lua\\'" lua-mode lua-mode)
|
||||||
("\\.coffee\\'" . coffee-mode)
|
("\\.coffee\\'" prelude-coffe coffee-mode)
|
||||||
("\\.erl\\'" . erlang)
|
("\\.erl\\'" erlang erlang-mode)
|
||||||
("\\.feature\\'" . feature-mode)))
|
("\\.feature\\'" feature-mode feature-mode)
|
||||||
|
("\\.css\\'" prelude-css css-mode)
|
||||||
|
("\\.rb\\'" prelude-ruby ruby-mode)
|
||||||
|
("\\.pl\\'" prelude-perl cperl-mode)
|
||||||
|
("\\.clj\\'" prelude-clojure clojure-mode)))
|
||||||
|
|
||||||
;; markdown-mode doesn't have autoloads for the auto-mode-alist
|
;; markdown-mode doesn't have autoloads for the auto-mode-alist
|
||||||
;; so we add them manually if it's already installed
|
;; so we add them manually if it's already installed
|
||||||
|
@ -93,10 +97,11 @@
|
||||||
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)))
|
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)))
|
||||||
|
|
||||||
(dolist (entry prelude-auto-install-alist)
|
(dolist (entry prelude-auto-install-alist)
|
||||||
(let ((ext (car entry))
|
(let ((extension (first entry))
|
||||||
(mode (cdr entry)))
|
(package (second entry))
|
||||||
(unless (package-installed-p mode)
|
(mode (third entry)))
|
||||||
(prelude-auto-install ext mode))))
|
(unless (package-installed-p package)
|
||||||
|
(prelude-auto-install extension package mode))))
|
||||||
|
|
||||||
(provide 'prelude-packages)
|
(provide 'prelude-packages)
|
||||||
;;; prelude-packages.el ends here
|
;;; prelude-packages.el ends here
|
||||||
|
|
Loading…
Reference in a new issue