diff options
| author | Julien Danjou | 2012-06-15 16:47:31 +0200 |
|---|---|---|
| committer | Julien Danjou | 2012-06-15 16:47:31 +0200 |
| commit | 52f8337d7129eebc1bebcd07b61f3e0ec3a6bbc2 (patch) | |
| tree | a4fa3e37f714d70ad13af62940aaa4aadc985340 | |
| parent | a64a94eddd0d1a4568e0905dfa65f06eef030f09 (diff) | |
| download | emacs-52f8337d7129eebc1bebcd07b61f3e0ec3a6bbc2.tar.gz emacs-52f8337d7129eebc1bebcd07b61f3e0ec3a6bbc2.zip | |
erc: use auth-source
* erc.el (erc-open): Use `auth-source' for password retrieval when
possible.
| -rw-r--r-- | lisp/erc/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index fbc5baa6a79..f84df4c7b89 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-06-15 Julien Danjou <julien@danjou.info> | ||
| 2 | |||
| 3 | * erc.el (erc-open): Use `auth-source' for password retrieval when | ||
| 4 | possible. | ||
| 5 | |||
| 1 | 2012-06-12 Chong Yidong <cyd@gnu.org> | 6 | 2012-06-12 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * erc-dcc.el (erc-dcc-chat-filter-functions): Rename from | 8 | * erc-dcc.el (erc-dcc-chat-filter-functions): Rename from |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 2f714bd6d14..0fc308621b1 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -71,6 +71,7 @@ | |||
| 71 | (require 'font-lock) | 71 | (require 'font-lock) |
| 72 | (require 'pp) | 72 | (require 'pp) |
| 73 | (require 'thingatpt) | 73 | (require 'thingatpt) |
| 74 | (require 'auth-source) | ||
| 74 | (require 'erc-compat) | 75 | (require 'erc-compat) |
| 75 | 76 | ||
| 76 | (defvar erc-official-location | 77 | (defvar erc-official-location |
| @@ -2006,7 +2007,19 @@ Returns the buffer for the given server or channel." | |||
| 2006 | ;; The local copy of `erc-nick' - the list of nicks to choose | 2007 | ;; The local copy of `erc-nick' - the list of nicks to choose |
| 2007 | (setq erc-default-nicks (if (consp erc-nick) erc-nick (list erc-nick))) | 2008 | (setq erc-default-nicks (if (consp erc-nick) erc-nick (list erc-nick))) |
| 2008 | ;; password stuff | 2009 | ;; password stuff |
| 2009 | (setq erc-session-password passwd) | 2010 | (setq erc-session-password (or passwd |
| 2011 | (let ((secret | ||
| 2012 | (plist-get | ||
| 2013 | (nth 0 | ||
| 2014 | (auth-source-search :host server | ||
| 2015 | :max 1 | ||
| 2016 | :user nick | ||
| 2017 | :port port | ||
| 2018 | :require '(:secret))) | ||
| 2019 | :secret))) | ||
| 2020 | (if (functionp secret) | ||
| 2021 | (funcall secret) | ||
| 2022 | secret)))) | ||
| 2010 | ;; debug output buffer | 2023 | ;; debug output buffer |
| 2011 | (setq erc-dbuf | 2024 | (setq erc-dbuf |
| 2012 | (when erc-log-p | 2025 | (when erc-log-p |