From 058537743aaff6794affb7514caffd340310418a Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 11 May 2012 22:44:43 +0300 Subject: [PATCH 1/6] fixed #150 - installer check --- utils/installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/installer.sh b/utils/installer.sh index 66ad4da..3abb9ff 100755 --- a/utils/installer.sh +++ b/utils/installer.sh @@ -1,7 +1,7 @@ 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" exit 1; From fe89220fcad33bfd02cda29b0fd5ef4ca42489ec Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 11 May 2012 22:45:20 +0300 Subject: [PATCH 2/6] Update utils/installer.sh --- utils/installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/installer.sh b/utils/installer.sh index 3abb9ff..56c26c6 100755 --- a/utils/installer.sh +++ b/utils/installer.sh @@ -3,7 +3,7 @@ PRELUDE_URL=https://github.com/bbatsov/prelude.git 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 From 22be13f741e21b618cc13b7747970b5a3bd5648c Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 12 May 2012 12:04:38 +0300 Subject: [PATCH 3/6] more robust auto-installation sequence (package name may differ from major mode name now) --- prelude/prelude-packages.el | 49 ++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/prelude/prelude-packages.el b/prelude/prelude-packages.el index ff176bb..21278a3 100644 --- a/prelude/prelude-packages.el +++ b/prelude/prelude-packages.el @@ -64,27 +64,31 @@ (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))) + '(("\\.markdown\\'" markdown-mode markdown-mode) + ("\\.md\\'" markdown-mode markdown-mode) + ("\\.haml\\'" haml-mode haml-mode) + ("\\.scss\\'" prelude-scss scss-mode) + ("\\.sass\\'" sass-mode sass-mode) + ("\\.groovy\\'" groovy-mode groovy-mode) + ("\\.yml\\'" yaml-mode yaml-mode) + ("\\.php\\'" php-mode php-mode) + ("\\.hs\\'" prelude-haskell haskell-mode) + ("\\.less\\'" less-css-mode less-css-mode) + ("\\.lua\\'" lua-mode lua-mode) + ("\\.coffee\\'" prelude-coffe coffee-mode) + ("\\.erl\\'" erlang erlang-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 ;; so we add them manually if it's already installed @@ -93,10 +97,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 From c8ce44ba6826bdae159b3a9695d19af408c924af Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 12 May 2012 16:46:11 +0300 Subject: [PATCH 4/6] auto-install now favors Prelude modules --- prelude/prelude-packages.el | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/prelude/prelude-packages.el b/prelude/prelude-packages.el index 21278a3..3120b86 100644 --- a/prelude/prelude-packages.el +++ b/prelude/prelude-packages.el @@ -71,24 +71,31 @@ (,mode))))) (defvar prelude-auto-install-alist - '(("\\.markdown\\'" markdown-mode markdown-mode) - ("\\.md\\'" markdown-mode markdown-mode) - ("\\.haml\\'" haml-mode haml-mode) - ("\\.scss\\'" prelude-scss scss-mode) - ("\\.sass\\'" sass-mode sass-mode) - ("\\.groovy\\'" groovy-mode groovy-mode) - ("\\.yml\\'" yaml-mode yaml-mode) - ("\\.php\\'" php-mode php-mode) - ("\\.hs\\'" prelude-haskell haskell-mode) - ("\\.less\\'" less-css-mode less-css-mode) - ("\\.lua\\'" lua-mode lua-mode) + '(("\\.clj\\'" prelude-clojure clojure-mode) ("\\.coffee\\'" prelude-coffe coffee-mode) + ("\\.css\\'" prelude-css css-mode) + ("\\.el\\'" prelude-emacs-lisp emacs-lisp-mode) ("\\.erl\\'" erlang erlang-mode) ("\\.feature\\'" feature-mode feature-mode) - ("\\.css\\'" prelude-css css-mode) - ("\\.rb\\'" prelude-ruby ruby-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) - ("\\.clj\\'" prelude-clojure clojure-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 From 90d1f3c53439d6ea802abf6cdd0c54413bc463b1 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sun, 13 May 2012 10:52:23 +0300 Subject: [PATCH 5/6] fixed a typo --- prelude/prelude-packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prelude/prelude-packages.el b/prelude/prelude-packages.el index 3120b86..d3d48cc 100644 --- a/prelude/prelude-packages.el +++ b/prelude/prelude-packages.el @@ -72,7 +72,7 @@ (defvar prelude-auto-install-alist '(("\\.clj\\'" prelude-clojure clojure-mode) - ("\\.coffee\\'" prelude-coffe coffee-mode) + ("\\.coffee\\'" prelude-coffee coffee-mode) ("\\.css\\'" prelude-css css-mode) ("\\.el\\'" prelude-emacs-lisp emacs-lisp-mode) ("\\.erl\\'" erlang erlang-mode) From 7cf8301ea9d471e03c5d284518fa84d41fb5822a Mon Sep 17 00:00:00 2001 From: Rahul Saxena Date: Sun, 13 May 2012 11:25:36 -0600 Subject: [PATCH 6/6] OSX: Add path support for macports binaries macports binaries are located at /opt/local/bin and sbin --- prelude/prelude-osx.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/prelude/prelude-osx.el b/prelude/prelude-osx.el index 4074ae2..e08a816 100644 --- a/prelude/prelude-osx.el +++ b/prelude/prelude-osx.el @@ -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