From 8e5022a509251ae788e04922072b0293b715f89f Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 10 Jan 2012 15:31:45 +0200 Subject: [PATCH 1/5] added rainbow-mode --- modules/prelude-emacs-lisp.el | 3 ++- modules/prelude-packages.el | 3 ++- modules/prelude-ruby.el | 9 +++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/prelude-emacs-lisp.el b/modules/prelude-emacs-lisp.el index 63b1463..1a55d8a 100644 --- a/modules/prelude-emacs-lisp.el +++ b/modules/prelude-emacs-lisp.el @@ -45,7 +45,8 @@ (defun prelude-emacs-lisp-mode-hook () (prelude-lisp-coding-hook) (turn-on-eldoc-mode) - (prelude-remove-elc-on-save)) + (prelude-remove-elc-on-save) + (rainbow-mode +1)) (add-hook 'emacs-lisp-mode-hook 'prelude-emacs-lisp-mode-hook) diff --git a/modules/prelude-packages.el b/modules/prelude-packages.el index f3c7210..2d4c6b8 100644 --- a/modules/prelude-packages.el +++ b/modules/prelude-packages.el @@ -46,7 +46,8 @@ (defvar prelude-packages '(auctex clojure-mode coffee-mode deft gist groovy-mode haml-mode haskell-mode inf-ruby markdown-mode paredit projectile - python sass-mode scss-mode solarized-theme yaml-mode yari zenburn-theme) + python sass-mode rainbow-mode scss-mode solarized-theme + yaml-mode yari zenburn-theme) "A list of packages to ensure are installed at launch.") (dolist (p prelude-packages) diff --git a/modules/prelude-ruby.el b/modules/prelude-ruby.el index 3f52b12..9abac61 100644 --- a/modules/prelude-ruby.el +++ b/modules/prelude-ruby.el @@ -71,9 +71,14 @@ (require 'haml-mode) (require 'scss-mode) -(defun prelude-scss-mode-hook () - ;; indent like in Ruby +(defun prelude-css-mode-hook () (setq css-indent-offset 2) + (rainbow-mode +1)) + +(add-hook 'css-mode-hook 'prelude-css-mode-hook) + +(defun prelude-scss-mode-hook () + (prelude-css-mode-hook) ;; turn off annoying auto-compile on save (setq scss-compile-at-save nil)) From 2bd13331bcdc9f101d90892d4341eb49deff8cf9 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Mon, 23 Jan 2012 11:50:31 +0200 Subject: [PATCH 2/5] fixes #50 - hardcoded el-get-dir issues --- modules/prelude-el-get.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/prelude-el-get.el b/modules/prelude-el-get.el index a032175..c45ce49 100644 --- a/modules/prelude-el-get.el +++ b/modules/prelude-el-get.el @@ -1,4 +1,5 @@ -(add-to-list 'load-path "~/.emacs.d/el-get/el-get") +(add-to-list 'load-path (concat prelude-dir "el-get/el-get")) +(setq el-get-dir (concat prelude-dir "el-get/")) (unless (require 'el-get nil t) (with-current-buffer From 48a25218eca21920d1fadbbf78e7fe9723695b82 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 26 Jan 2012 14:14:38 +0200 Subject: [PATCH 3/5] fixes #54 #47 - don't do a package refresh on every startup, only when there are required packages that are not installed --- modules/prelude-packages.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/prelude-packages.el b/modules/prelude-packages.el index 2d4c6b8..4a1ed29 100644 --- a/modules/prelude-packages.el +++ b/modules/prelude-packages.el @@ -38,18 +38,24 @@ '("marmalade" . "http://marmalade-repo.org/packages/") t) (package-initialize) -;; check for new packages (package versions) -(message "%s" "Emacs Prelude is now refreshing its package database...") -(package-refresh-contents) -(message "%s" " done.") - (defvar prelude-packages - '(auctex clojure-mode coffee-mode deft gist groovy-mode haml-mode + '(auctex clojure-mode coffee-mode deft full-ack gist groovy-mode haml-mode haskell-mode inf-ruby markdown-mode paredit projectile python sass-mode rainbow-mode scss-mode solarized-theme yaml-mode yari zenburn-theme) "A list of packages to ensure are installed at launch.") +(defun prelude-packages-installled-p () + (loop for p in prelude-packages + when (package-installed-p p) do (return nil) + finally (return t))) + +(unless prelude-packages-installed-p + ;; check for new packages (package versions) + (message "%s" "Emacs Prelude is now refreshing its package database...") + (package-refresh-contents) + (message "%s" " done.")) + (dolist (p prelude-packages) (when (not (package-installed-p p)) (package-install p))) From 70210075fa1d536be6b2588d97cad3b8dc993fad Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 26 Jan 2012 14:44:02 +0200 Subject: [PATCH 4/5] added a helper function prelude-kill-other-buffers, that kills all buffers, but the current one --- modules/prelude-core.el | 7 +++++++ modules/prelude-global-keybindings.el | 3 +++ 2 files changed, 10 insertions(+) diff --git a/modules/prelude-core.el b/modules/prelude-core.el index 8398cd2..bad5e9a 100644 --- a/modules/prelude-core.el +++ b/modules/prelude-core.el @@ -351,5 +351,12 @@ there's a region, all lines that region covers will be duplicated." (set-window-start w2 s1))) (other-window 1)) +(defun prelude-kill-other-buffers () + "Kill all buffers but the current one" + (interactive) + (dolist (buffer (buffer-list)) + (unless (eql buffer (current-buffer)) + (kill-buffer buffer)))) + (provide 'prelude-core) ;;; prelude-core.el ends here diff --git a/modules/prelude-global-keybindings.el b/modules/prelude-global-keybindings.el index 824052c..d1f84af 100644 --- a/modules/prelude-global-keybindings.el +++ b/modules/prelude-global-keybindings.el @@ -115,6 +115,9 @@ ;; open an ansi-term buffer (global-set-key (kbd "C-x t") 'prelude-visit-term-buffer) +;; kill other buffers +(global-set-key (kbd "C-c k o") 'prelude-kill-other-buffers) + ;; search with google (global-set-key (kbd "C-c g") 'prelude-google) From 32b38787d6cb74d1677a4141569dfe0bef25ea32 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 26 Jan 2012 16:57:51 +0200 Subject: [PATCH 5/5] minor fix to prelude-kill-other-buffers --- modules/prelude-core.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/prelude-core.el b/modules/prelude-core.el index bad5e9a..05dda38 100644 --- a/modules/prelude-core.el +++ b/modules/prelude-core.el @@ -352,10 +352,10 @@ there's a region, all lines that region covers will be duplicated." (other-window 1)) (defun prelude-kill-other-buffers () - "Kill all buffers but the current one" + "Kill all buffers but the current one. Doesn't mess with special buffers." (interactive) (dolist (buffer (buffer-list)) - (unless (eql buffer (current-buffer)) + (unless (or (eql buffer (current-buffer)) (not (buffer-file-name buffer))) (kill-buffer buffer)))) (provide 'prelude-core)