diff options
Diffstat (limited to 'lisp/erc')
| -rw-r--r-- | lisp/erc/ChangeLog | 20 | ||||
| -rw-r--r-- | lisp/erc/erc-join.el | 27 | ||||
| -rw-r--r-- | lisp/erc/erc-services.el | 3 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 1 |
4 files changed, 48 insertions, 3 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 34aa015d7ac..06c6d42ed39 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2012-04-11 Vivek Dasmohapatra <vivek@etla.org> | ||
| 2 | |||
| 3 | * erc-services.el (erc-nickserv-passwords): Don't display the | ||
| 4 | password (bug#4459). | ||
| 5 | |||
| 6 | 2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 7 | |||
| 8 | * erc-join.el (erc-server-join-channel): New function to look up | ||
| 9 | the channel password via auth-source. | ||
| 10 | (erc-autojoin-channels): Use it. | ||
| 11 | (erc-autojoin-after-ident): Ditto. | ||
| 12 | (erc-autojoin-channels-alist): Mention auth-source. | ||
| 13 | |||
| 14 | 2012-04-10 Deniz Dogan <deniz@dogan.se> (tiny change) | ||
| 15 | |||
| 16 | * erc.el (erc-display-prompt): Adds the field text property to the | ||
| 17 | ERC prompt. This allows users to use `kill-whole-line' to kill | ||
| 18 | all text back to the prompt given that it's on a single line | ||
| 19 | (bug#10841). | ||
| 20 | |||
| 1 | 2012-04-09 Chong Yidong <cyd@gnu.org> | 21 | 2012-04-09 Chong Yidong <cyd@gnu.org> |
| 2 | 22 | ||
| 3 | * erc.el (erc-cmd-SET): Call custom-variable-p instead of | 23 | * erc.el (erc-cmd-SET): Call custom-variable-p instead of |
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index da894ba5977..85d1edf6427 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | ;;; Code: | 32 | ;;; Code: |
| 33 | 33 | ||
| 34 | (require 'erc) | 34 | (require 'erc) |
| 35 | (require 'auth-source) | ||
| 35 | (eval-when-compile (require 'cl)) | 36 | (eval-when-compile (require 'cl)) |
| 36 | 37 | ||
| 37 | (defgroup erc-autojoin nil | 38 | (defgroup erc-autojoin nil |
| @@ -56,6 +57,13 @@ Every element in the alist has the form (SERVER . CHANNELS). | |||
| 56 | SERVER is a regexp matching the server, and channels is the | 57 | SERVER is a regexp matching the server, and channels is the |
| 57 | list of channels to join. | 58 | list of channels to join. |
| 58 | 59 | ||
| 60 | If the channel(s) require channel keys for joining, the passwords | ||
| 61 | are found via auth-source. For instance, if you use ~/.authinfo | ||
| 62 | as your auth-source backend, then put something like the | ||
| 63 | following in that file: | ||
| 64 | |||
| 65 | machine irc.example.net login \"#fsf\" password sEcReT | ||
| 66 | |||
| 59 | Customize this variable to set the value for your first connect. | 67 | Customize this variable to set the value for your first connect. |
| 60 | Once you are connected and join and part channels, this alist | 68 | Once you are connected and join and part channels, this alist |
| 61 | keeps track of what channels you are on, and will join them | 69 | keeps track of what channels you are on, and will join them |
| @@ -131,7 +139,7 @@ This function is run from `erc-nickserv-identified-hook'." | |||
| 131 | (when (string-match (car l) server) | 139 | (when (string-match (car l) server) |
| 132 | (dolist (chan (cdr l)) | 140 | (dolist (chan (cdr l)) |
| 133 | (unless (erc-member-ignore-case chan joined) | 141 | (unless (erc-member-ignore-case chan joined) |
| 134 | (erc-server-send (concat "join " chan)))))))) | 142 | (erc-server-join-channel server chan))))))) |
| 135 | nil) | 143 | nil) |
| 136 | 144 | ||
| 137 | (defun erc-autojoin-channels (server nick) | 145 | (defun erc-autojoin-channels (server nick) |
| @@ -148,10 +156,25 @@ This function is run from `erc-nickserv-identified-hook'." | |||
| 148 | (dolist (l erc-autojoin-channels-alist) | 156 | (dolist (l erc-autojoin-channels-alist) |
| 149 | (when (string-match (car l) server) | 157 | (when (string-match (car l) server) |
| 150 | (dolist (chan (cdr l)) | 158 | (dolist (chan (cdr l)) |
| 151 | (erc-server-send (concat "join " chan)))))) | 159 | (erc-server-join-channel server chan))))) |
| 152 | ;; Return nil to avoid stomping on any other hook funcs. | 160 | ;; Return nil to avoid stomping on any other hook funcs. |
| 153 | nil) | 161 | nil) |
| 154 | 162 | ||
| 163 | (defun erc-server-join-channel (server channel) | ||
| 164 | (let* ((secret (plist-get (nth 0 (auth-source-search | ||
| 165 | :max 1 | ||
| 166 | :host server | ||
| 167 | :port "irc" | ||
| 168 | :user channel)) | ||
| 169 | :secret)) | ||
| 170 | (password (if (functionp secret) | ||
| 171 | (funcall secret) | ||
| 172 | secret))) | ||
| 173 | (erc-server-send (concat "join " channel | ||
| 174 | (if password | ||
| 175 | (concat " " password) | ||
| 176 | ""))))) | ||
| 177 | |||
| 155 | (defun erc-autojoin-add (proc parsed) | 178 | (defun erc-autojoin-add (proc parsed) |
| 156 | "Add the channel being joined to `erc-autojoin-channels-alist'." | 179 | "Add the channel being joined to `erc-autojoin-channels-alist'." |
| 157 | (let* ((chnl (erc-response.contents parsed)) | 180 | (let* ((chnl (erc-response.contents parsed)) |
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index 66eb341b47a..5986d81efed 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el | |||
| @@ -195,7 +195,8 @@ Example of use: | |||
| 195 | (repeat :tag "Nickname and password" | 195 | (repeat :tag "Nickname and password" |
| 196 | (cons :tag "Identity" | 196 | (cons :tag "Identity" |
| 197 | (string :tag "Nick") | 197 | (string :tag "Nick") |
| 198 | (string :tag "Password")))))) | 198 | (string :tag "Password" |
| 199 | :secret ?*)))))) | ||
| 199 | 200 | ||
| 200 | ;; Variables: | 201 | ;; Variables: |
| 201 | 202 | ||
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 62b701204d1..b79c2fd6c5e 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -3646,6 +3646,7 @@ If FACE is non-nil, it will be used to propertize the prompt. If it is nil, | |||
| 3646 | 'start-open t ; XEmacs | 3646 | 'start-open t ; XEmacs |
| 3647 | 'rear-nonsticky t ; Emacs | 3647 | 'rear-nonsticky t ; Emacs |
| 3648 | 'erc-prompt t | 3648 | 'erc-prompt t |
| 3649 | 'field t | ||
| 3649 | 'front-sticky t | 3650 | 'front-sticky t |
| 3650 | 'read-only t)) | 3651 | 'read-only t)) |
| 3651 | (erc-put-text-property 0 (1- (length prompt)) | 3652 | (erc-put-text-property 0 (1- (length prompt)) |