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
|
;; 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.
|
;; the shell.
|
||||||
(push "/usr/local/bin" exec-path)
|
;; If you're using homebrew or port, modifying the PATH is essential.
|
||||||
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
|
(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,
|
;; Emacs users obviously have little need for Command and Option keys,
|
||||||
;; but they do need Meta and Super
|
;; but they do need Meta and Super
|
||||||
|
|
|
@ -64,27 +64,38 @@
|
||||||
|
|
||||||
(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)
|
'(("\\.clj\\'" prelude-clojure clojure-mode)
|
||||||
("\\.md\\'" . markdown-mode)
|
("\\.coffee\\'" prelude-coffee coffee-mode)
|
||||||
("\\.haml\\'" . haml-mode)
|
("\\.css\\'" prelude-css css-mode)
|
||||||
("\\.scss\\'" . scss-mode)
|
("\\.el\\'" prelude-emacs-lisp emacs-lisp-mode)
|
||||||
("\\.sass\\'" . sass-mode)
|
("\\.erl\\'" erlang erlang-mode)
|
||||||
("\\.groovy\\'" . groovy-mode)
|
("\\.feature\\'" feature-mode feature-mode)
|
||||||
("\\.yml\\'" . yaml-mode)
|
("\\.groovy\\'" groovy-mode groovy-mode)
|
||||||
("\\.php\\'" . php-mode)
|
("\\.haml\\'" haml-mode haml-mode)
|
||||||
("\\.hs\\'" . haskell-mode)
|
("\\.hs\\'" prelude-haskell haskell-mode)
|
||||||
("\\.less\\'" . less-css-mode)
|
("\\.js\\'" prelude-js js-mode)
|
||||||
("\\.lua\\'" . lua-mode)
|
("\\.latex\\'" prelude-latex LaTeX-mode)
|
||||||
("\\.coffee\\'" . coffee-mode)
|
("\\.less\\'" less-css-mode less-css-mode)
|
||||||
("\\.erl\\'" . erlang)
|
("\\.lisp\\'" prelude-common-lisp lisp-mode)
|
||||||
("\\.feature\\'" . feature-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
|
;; 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 +104,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
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
PRELUDE_INSTALL_DIR="$HOME/.emacs.d"
|
PRELUDE_INSTALL_DIR="$HOME/.emacs.d"
|
||||||
PRELUDE_URL=https://github.com/bbatsov/prelude.git
|
PRELUDE_URL=https://github.com/bbatsov/prelude.git
|
||||||
|
|
||||||
if [ -d $PRELUDE_INSTALL_DIR ]
|
if [ -d $PRELUDE_INSTALL_DIR/prelude ]
|
||||||
then
|
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;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue