From 241fcc76d6a17833e095e3bec1a4abcb6388483c Mon Sep 17 00:00:00 2001
From: Tu Do <tu.h.do@dektech.com.au>
Date: Wed, 10 Sep 2014 14:51:53 +0700
Subject: [PATCH 1/2] Set prefix key before loading helm-projectile

Because helm-projectile loads helm-config, prefix key must also be set
before helm-projectile. Comment is added for future reference
---
 modules/prelude-helm.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/prelude-helm.el b/modules/prelude-helm.el
index 4c9d776..c720845 100644
--- a/modules/prelude-helm.el
+++ b/modules/prelude-helm.el
@@ -38,13 +38,15 @@
 (require 'helm)
 (require 'helm-grep)
 (require 'helm-files)
-(require 'helm-projectile)
 
 ;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
-;; Note: this must be placed before require `helm-config'
+;; Note: this must be placed before require `helm-config'. If `helm-projectile' is
+;; available, it must also be set before `helm-projectile', since `helm-projectile'
+;; loads `helm-config'
 (setq helm-command-prefix-key "C-c h")
 
 (require 'helm-config)
+(require 'helm-projectile)
 
 (when (executable-find "curl")
   (setq helm-google-suggest-use-curl-p t))

From 01cb638fadbcea951adb4f6253318158775d4133 Mon Sep 17 00:00:00 2001
From: Tu Do <tu.h.do@dektech.com.au>
Date: Thu, 11 Sep 2014 12:14:43 +0700
Subject: [PATCH 2/2] Set Helm prefix key independent of Helm's packages

Since `helm-command-prefix-key' must be loaded before `helm-config', we
don't know if other Helm packages include `helm-config' and invalidate
custom prefix key. This change makes prefix binding independent from any
Helm package.

Conflicts:
	modules/prelude-helm.el
---
 modules/prelude-helm.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/prelude-helm.el b/modules/prelude-helm.el
index c720845..8a45985 100644
--- a/modules/prelude-helm.el
+++ b/modules/prelude-helm.el
@@ -60,6 +60,12 @@
       helm-ff-search-library-in-sexp        t
       helm-ff-file-name-history-use-recentf t)
 
+;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
+;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
+;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.
+(global-set-key (kbd "C-c h") 'helm-command-prefix)
+(global-unset-key (kbd "C-x c"))
+
 (define-key helm-command-map (kbd "o")     'helm-occur)
 (define-key helm-command-map (kbd "g")     'helm-do-grep)
 (define-key helm-command-map (kbd "C-c w") 'helm-wikipedia-suggest)