Merge branch 'master' of github.com:bbatsov/prelude
This commit is contained in:
commit
83aad3506c
3 changed files with 42 additions and 27 deletions
|
@ -1,7 +1,10 @@
|
|||
;; On OS X Emacs doesn't use the shell PATH if it's not started from
|
||||
;; the shell. If you're using homebrew modifying the PATH is essential.
|
||||
(push "/usr/local/bin" exec-path)
|
||||
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
|
||||
;; the shell.
|
||||
;; If you're using homebrew or port, modifying the PATH is essential.
|
||||
(let (osx-paths)
|
||||
(dolist (path '("/usr/local/bin" "/opt/local/bin" "/opt/local/sbin") (setenv "PATH" (concat osx-paths (getenv "PATH"))))
|
||||
(push path exec-path)
|
||||
(setq osx-paths (concat (concat path ":") osx-paths))))
|
||||
|
||||
;; Emacs users obviously have little need for Command and Option keys,
|
||||
;; but they do need Meta and Super
|
||||
|
|
|
@ -64,27 +64,38 @@
|
|||
|
||||
(prelude-install-packages)
|
||||
|
||||
(defmacro prelude-auto-install (ext mode)
|
||||
(defmacro prelude-auto-install (extension package mode)
|
||||
`(add-to-list 'auto-mode-alist
|
||||
`(,ext . (lambda ()
|
||||
(package-install ',mode)
|
||||
(,mode)))))
|
||||
`(,extension . (lambda ()
|
||||
(package-install ',package)
|
||||
(,mode)))))
|
||||
|
||||
(defvar prelude-auto-install-alist
|
||||
'(("\\.markdown\\'" . markdown-mode)
|
||||
("\\.md\\'" . markdown-mode)
|
||||
("\\.haml\\'" . haml-mode)
|
||||
("\\.scss\\'" . scss-mode)
|
||||
("\\.sass\\'" . sass-mode)
|
||||
("\\.groovy\\'" . groovy-mode)
|
||||
("\\.yml\\'" . yaml-mode)
|
||||
("\\.php\\'" . php-mode)
|
||||
("\\.hs\\'" . haskell-mode)
|
||||
("\\.less\\'" . less-css-mode)
|
||||
("\\.lua\\'" . lua-mode)
|
||||
("\\.coffee\\'" . coffee-mode)
|
||||
("\\.erl\\'" . erlang)
|
||||
("\\.feature\\'" . feature-mode)))
|
||||
'(("\\.clj\\'" prelude-clojure clojure-mode)
|
||||
("\\.coffee\\'" prelude-coffee coffee-mode)
|
||||
("\\.css\\'" prelude-css css-mode)
|
||||
("\\.el\\'" prelude-emacs-lisp emacs-lisp-mode)
|
||||
("\\.erl\\'" erlang erlang-mode)
|
||||
("\\.feature\\'" feature-mode feature-mode)
|
||||
("\\.groovy\\'" groovy-mode groovy-mode)
|
||||
("\\.haml\\'" haml-mode haml-mode)
|
||||
("\\.hs\\'" prelude-haskell haskell-mode)
|
||||
("\\.js\\'" prelude-js js-mode)
|
||||
("\\.latex\\'" prelude-latex LaTeX-mode)
|
||||
("\\.less\\'" less-css-mode less-css-mode)
|
||||
("\\.lisp\\'" prelude-common-lisp lisp-mode)
|
||||
("\\.lua\\'" lua-mode lua-mode)
|
||||
("\\.markdown\\'" markdown-mode markdown-mode)
|
||||
("\\.md\\'" markdown-mode markdown-mode)
|
||||
("\\.php\\'" php-mode php-mode)
|
||||
("\\.pl\\'" prelude-perl cperl-mode)
|
||||
("\\.py\\'" python python-mode)
|
||||
("\\.rb\\'" prelude-ruby ruby-mode)
|
||||
("\\.sass\\'" sass-mode sass-mode)
|
||||
("\\.scm\\'" prelude-scheme scheme-mode)
|
||||
("\\.scss\\'" prelude-scss scss-mode)
|
||||
("\\.xml\\'" prelude-xml nxml-mode)
|
||||
("\\.yml\\'" yaml-mode yaml-mode)))
|
||||
|
||||
;; markdown-mode doesn't have autoloads for the auto-mode-alist
|
||||
;; so we add them manually if it's already installed
|
||||
|
@ -93,10 +104,11 @@
|
|||
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)))
|
||||
|
||||
(dolist (entry prelude-auto-install-alist)
|
||||
(let ((ext (car entry))
|
||||
(mode (cdr entry)))
|
||||
(unless (package-installed-p mode)
|
||||
(prelude-auto-install ext mode))))
|
||||
(let ((extension (first entry))
|
||||
(package (second entry))
|
||||
(mode (third entry)))
|
||||
(unless (package-installed-p package)
|
||||
(prelude-auto-install extension package mode))))
|
||||
|
||||
(provide 'prelude-packages)
|
||||
;;; prelude-packages.el ends here
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
PRELUDE_INSTALL_DIR="$HOME/.emacs.d"
|
||||
PRELUDE_URL=https://github.com/bbatsov/prelude.git
|
||||
|
||||
if [ -d $PRELUDE_INSTALL_DIR ]
|
||||
if [ -d $PRELUDE_INSTALL_DIR/prelude ]
|
||||
then
|
||||
printf "\e[33m You already have Prelude installed.\e[0m You'll need to remove $PRELUDE_INSTALL_DIR if you want to install Prelude again.\n"
|
||||
printf "\e[33m You already have Prelude installed.\e[0m You'll need to remove $PRELUDE_INSTALL_DIR/prelude if you want to install Prelude again.\n"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue