about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvincent@spotify.com <vincent@Vincents-MacBook-Pro.local>2013-08-28T15·16+0200
committervincent@spotify.com <vincent@Vincents-MacBook-Pro.local>2013-08-28T15·16+0200
commit25d348673bd6951e5e9f9235dbd4db311e1a0567 (patch)
tree41754e06a0407f6e83efed578f7b1ed77ad0b23c
parent73ba15b5a27ac25238fa9df250520d3fb635c747 (diff)
* added circe to package list (*potential* replacement for rcirc)
* added a handy function to retrieve passwords from the OS X keychain
-rw-r--r--init-functions.el11
-rw-r--r--init.el1
2 files changed, 12 insertions, 0 deletions
diff --git a/init-functions.el b/init-functions.el
index 79a9bddc16c4..b461b2e6a720 100644
--- a/init-functions.el
+++ b/init-functions.el
@@ -35,6 +35,17 @@
 
     (load file)))
 
+(defun keychain-password (account &optional keychain)
+  "Returns the password for the account, by default it's looked up in the Login.keychain but a
+   different keychain can be specified."
+  (let ((k (if keychain keychain "Login.keychain")))
+    (replace-regexp-in-string
+     "\n" ""
+     (shell-command-to-string (concat  "security find-generic-password -w -a "
+                                       account
+                                       " "
+                                       k)))))
+
 ;; This clones a git repository to 'foldername in .emacs.d
 ;; if there isn't already a folder with that name
 (defun custom-clone-git (url foldername)
diff --git a/init.el b/init.el
index 9281861bb45d..80525b12ccac 100644
--- a/init.el
+++ b/init.el
@@ -17,6 +17,7 @@
   '(ac-nrepl
     ace-jump-mode
     browse-kill-ring
+    circe
     clojure-mode
     flycheck
     flx-ido