diff options
| author | Miles Bader | 2006-11-20 06:50:29 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-11-20 06:50:29 +0000 |
| commit | 83dc6995148085966eddca749228a6338b7e6b0e (patch) | |
| tree | 0fbf7066385873a51749737e5ac0d9c57b8a3d28 | |
| parent | e15a04955b0c59069aa870d7d5040bc2e795b2eb (diff) | |
| download | emacs-83dc6995148085966eddca749228a6338b7e6b0e.tar.gz emacs-83dc6995148085966eddca749228a6338b7e6b0e.zip | |
Merge from erc--emacs--22
Merge from my ERC Emacs 22 integration branch. The version is now "5.2
stable pre-release". This will probably be the last change to the
version of ERC in Emacs 22 before the release, pending any bugfixes. For
details on the changes, see the lisp/erc/ChangeLog file.
Note that ERC is now invoked with M-x erc, not M-x erc-select. If you
were using the old `erc' function programmatically, use `erc-open'
instead.
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-520
Creator: Michael Olson <mwolson@gnu.org>
| -rw-r--r-- | etc/ChangeLog | 9 | ||||
| -rw-r--r-- | etc/ERC-NEWS | 16 | ||||
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/erc/ChangeLog | 185 | ||||
| -rw-r--r-- | lisp/erc/erc-autoaway.el | 3 | ||||
| -rw-r--r-- | lisp/erc/erc-backend.el | 40 | ||||
| -rw-r--r-- | lisp/erc/erc-compat.el | 2 | ||||
| -rw-r--r-- | lisp/erc/erc-dcc.el | 6 | ||||
| -rw-r--r-- | lisp/erc/erc-fill.el | 10 | ||||
| -rw-r--r-- | lisp/erc/erc-ibuffer.el | 6 | ||||
| -rw-r--r-- | lisp/erc/erc-log.el | 20 | ||||
| -rw-r--r-- | lisp/erc/erc-menu.el | 6 | ||||
| -rw-r--r-- | lisp/erc/erc-networks.el | 2 | ||||
| -rw-r--r-- | lisp/erc/erc-nicklist.el | 9 | ||||
| -rw-r--r-- | lisp/erc/erc-replace.el | 1 | ||||
| -rw-r--r-- | lisp/erc/erc-sound.el | 81 | ||||
| -rw-r--r-- | lisp/erc/erc-track.el | 11 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 190 | ||||
| -rw-r--r-- | man/ChangeLog | 4 | ||||
| -rw-r--r-- | man/erc.texi | 14 |
20 files changed, 439 insertions, 180 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog index 003b625c3f3..5d43d90da42 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-11-20 Michael Olson <mwolson@gnu.org> | ||
| 2 | |||
| 3 | * NEWS: Change M-x erc-select to M-x erc. | ||
| 4 | |||
| 1 | 2006-11-20 Sun Yijiang <sunyijiang@gmail.com> | 5 | 2006-11-20 Sun Yijiang <sunyijiang@gmail.com> |
| 2 | 6 | ||
| 3 | * TUTORIAL.cn: Updated. | 7 | * TUTORIAL.cn: Updated. |
| @@ -92,6 +96,11 @@ | |||
| 92 | * PROBLEMS (are): Emacs compiled with Gtk+ crashes when closing a | 96 | * PROBLEMS (are): Emacs compiled with Gtk+ crashes when closing a |
| 93 | display (x-close-connection). | 97 | display (x-close-connection). |
| 94 | 98 | ||
| 99 | 2006-09-03 Diane Murray <disumu@x3y2z1.net> | ||
| 100 | |||
| 101 | * erc.texi (Getting Started, Connecting): Changed erc-select to | ||
| 102 | erc. | ||
| 103 | |||
| 95 | 2006-09-02 Juri Linkov <juri@jurta.org> | 104 | 2006-09-02 Juri Linkov <juri@jurta.org> |
| 96 | 105 | ||
| 97 | * HELLO: Regroup Europe Non-ASCII examples by similar scripts. | 106 | * HELLO: Regroup Europe Non-ASCII examples by similar scripts. |
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 3a026ee1162..cce444749c4 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | ERC NEWS -*- outline -*- | 1 | ERC NEWS -*- outline -*- |
| 2 | 2 | ||
| 3 | * Changes in ERC 5.2 (stable pre-release for Emacs 22) | ||
| 4 | |||
| 5 | ** M-x erc RET now starts ERC. | ||
| 6 | `erc-select' has been changed to `erc'. `erc-select' still remains as | ||
| 7 | an alias of `erc'. Likewise, `erc-select-ssl' has been renamed to | ||
| 8 | `erc-ssl' with `erc-select-ssl' as its alias. The function that was | ||
| 9 | known as `erc' is now `erc-open'. | ||
| 10 | |||
| 11 | ** Changes and additions to modules | ||
| 12 | |||
| 13 | *** Channel tracking (erc-track.el) | ||
| 14 | |||
| 15 | **** Use mouse-face and help-echo for channel names in the mode-line. | ||
| 16 | This helps people using a mouse know that they are buttons and can be | ||
| 17 | clicked on. | ||
| 18 | |||
| 3 | * Changes in ERC 5.1.4 | 19 | * Changes in ERC 5.1.4 |
| 4 | 20 | ||
| 5 | ** Make find-function and find-variable work in Emacs 22 for | 21 | ** Make find-function and find-variable work in Emacs 22 for |
| @@ -1690,8 +1690,8 @@ ERC is a powerful, modular, and extensible IRC client for Emacs. | |||
| 1690 | To see what modules are available, type | 1690 | To see what modules are available, type |
| 1691 | M-x customize-option erc-modules RET. | 1691 | M-x customize-option erc-modules RET. |
| 1692 | 1692 | ||
| 1693 | To start an IRC session, type M-x erc-select, and follow the prompts | 1693 | To start an IRC session, type M-x erc, and follow the prompts for |
| 1694 | for server, port, and nick. | 1694 | server, port, and nick. |
| 1695 | 1695 | ||
| 1696 | --- | 1696 | --- |
| 1697 | ** Rcirc is now part of the Emacs distribution. | 1697 | ** Rcirc is now part of the Emacs distribution. |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 3ca5d702190..d7b925a6057 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,28 @@ | |||
| 1 | 2006-11-20 Michael Olson <mwolson@gnu.org> | ||
| 2 | |||
| 3 | * erc.el (erc-version-string): Call this Version 5.2 stable | ||
| 4 | pre-release, since it diverges slightly from our 5.2 branch, in | ||
| 5 | that unstable features are not included. | ||
| 6 | (erc-update-modules): Display better error message when module not | ||
| 7 | found. | ||
| 8 | |||
| 9 | 2006-11-12 Michael Olson <mwolson@gnu.org> | ||
| 10 | |||
| 11 | * erc-log.el: Save all log buffers when Emacs exits, in case | ||
| 12 | someone ignores the warning about open processes. Remove the | ||
| 13 | advice code in the commentary. | ||
| 14 | (erc-save-query-buffers): Docfix. | ||
| 15 | (erc-log-save-all-buffers): New function that saves all ERC | ||
| 16 | buffers to logs. | ||
| 17 | (erc-current-logfile): Fix bug in filename selection, where the | ||
| 18 | current buffer was erroneously being preferred over the given | ||
| 19 | buffer. | ||
| 20 | |||
| 21 | 2006-11-08 Michael Olson <mwolson@gnu.org> | ||
| 22 | |||
| 23 | * erc.el (erc-string-to-port): Avoid error when a numerical port | ||
| 24 | is passed. Thanks to Zekeriya KOÇ for the report. | ||
| 25 | |||
| 1 | 2006-11-08 Łukasz Demianiuk <ldemianiuk@gmail.com> (tiny change) | 26 | 2006-11-08 Łukasz Demianiuk <ldemianiuk@gmail.com> (tiny change) |
| 2 | 27 | ||
| 3 | * erc.el (erc-header-line): Fix typo. | 28 | * erc.el (erc-header-line): Fix typo. |
| @@ -10,11 +35,168 @@ | |||
| 10 | * erc-autoaway.el (erc-autoaway-reestablish-idletimer): | 35 | * erc-autoaway.el (erc-autoaway-reestablish-idletimer): |
| 11 | * erc-truncate.el (truncate): Fix typo in docstring. | 36 | * erc-truncate.el (truncate): Fix typo in docstring. |
| 12 | 37 | ||
| 38 | 2006-10-21 Michael Olson <mwolson@gnu.org> | ||
| 39 | |||
| 40 | * erc.el (erc-iswitchb): Fix bug when hitting C-c C-b without | ||
| 41 | first loading iswitchb. Thanks to Leo for the report. | ||
| 42 | |||
| 43 | 2006-10-10 Michael Olson <mwolson@gnu.org> | ||
| 44 | |||
| 45 | * erc.el (erc-default-port): Make the default be 6667 instead of | ||
| 46 | ircd. since Mac OS X apparently has problems with looking up that | ||
| 47 | port name. | ||
| 48 | |||
| 49 | * erc-backend.el (353): Receive names after displaying the initial | ||
| 50 | message, instead of before. | ||
| 51 | |||
| 52 | 2006-10-05 Diane Murray <disumu@x3y2z1.net> | ||
| 53 | |||
| 54 | * erc.el (erc-my-nick-face): New face. | ||
| 55 | (erc): Use FULL-NAME argument, not `erc-user-full-name'. This | ||
| 56 | fixes a bug where the :full-name argument passed to the function | ||
| 57 | was not respected. | ||
| 58 | (erc-format-my-nick): Use `erc-my-nick-face'. This should help | ||
| 59 | make it easier to find messages you sent in conversations when | ||
| 60 | `erc-show-my-nick' is non-nil. | ||
| 61 | (erc-compute-server): Doc fix. | ||
| 62 | |||
| 63 | 2006-09-11 Michael Olson <mwolson@gnu.org> | ||
| 64 | |||
| 65 | * erc-nicklist.el (erc-nicklist-insert-contents): Add missing | ||
| 66 | parenthesis. Thanks to Stephan Stahl for the report. | ||
| 67 | |||
| 68 | 2006-09-10 Eric Hanchrow <offby1@blarg.net> | ||
| 69 | |||
| 70 | * erc.el (erc-cmd-IGNORE): Prompt user if this might be a regexp | ||
| 71 | instead of a single user. | ||
| 72 | |||
| 73 | 2006-09-10 Michael Olson <mwolson@gnu.org> | ||
| 74 | |||
| 75 | * erc.el (erc-generate-new-buffer-name): If this is a server | ||
| 76 | buffer and a process exists already, create a new buffer. | ||
| 77 | (erc-open): If the IRC session was continued, restore the old | ||
| 78 | point. Thanks to Stephan Stahl for the report. | ||
| 79 | (erc-member-ignore-case): Coding style tweak. | ||
| 80 | (erc-cmd-UNIGNORE): Quote the user before comparison. If we don't | ||
| 81 | find the user listed verbatim, try to match them against the list | ||
| 82 | using string-match. In this case, prompt as to whether the regexp | ||
| 83 | should be removed. | ||
| 84 | (erc-ignored-user-p): Remove CL-ism. | ||
| 85 | |||
| 86 | * erc-autoaway.el (erc-autoaway-possibly-set-away): Check to see | ||
| 87 | whether we are already away. | ||
| 88 | |||
| 89 | * erc-menu.el: Fix potential compiler warning. | ||
| 90 | |||
| 91 | 2006-09-07 Diane Murray <disumu@x3y2z1.net> | ||
| 92 | |||
| 93 | * erc.el: Updated Commentary and URL. | ||
| 94 | (erc-iswitchb, erc-display-line, erc-set-modes, erc-update-modes) | ||
| 95 | (erc-arrange-session-in-multiple-windows): No need to check if | ||
| 96 | `erc-server-process' is bound. | ||
| 97 | (erc-server-buffer-live-p): Doc fix. | ||
| 98 | (erc-part-from-channel): Don't use any initial contents at prompt. | ||
| 99 | (erc-format-nick, erc-format-@nick): Doc fix. Use `when'. | ||
| 100 | (s367): Fixed to support only banmask and channel which is the | ||
| 101 | standard. Also, there's no reason to add a message to each banned | ||
| 102 | user entry trying to persuade the user to use /banlist instead of | ||
| 103 | /mode #channel +b. That part of the message was a little | ||
| 104 | confusing, anyways. | ||
| 105 | (s367-set-by): New catalog entry. The user who set the ban and | ||
| 106 | the time of ban seem to be specific to only certain servers such | ||
| 107 | as freenode. | ||
| 108 | |||
| 109 | * erc-autoaway.el (erc-autoaway-idletimer): Doc fix. | ||
| 110 | |||
| 111 | * erc-backend.el (erc-server-process-alive): No need to check if | ||
| 112 | `erc-server-process' is bound. | ||
| 113 | (367): Use s367 or s367-set-by where appropriate. | ||
| 114 | |||
| 115 | * erc-compat.el: Fixed URL. | ||
| 116 | |||
| 117 | * erc-dcc.el: Updated copyright years. Added Usage section. | ||
| 118 | Changed supported Emacs version number from 21.3.50 to 22 in | ||
| 119 | Commentary. | ||
| 120 | |||
| 121 | * erc-ibuffer.el (erc-server-name, erc-target, erc-away): No need | ||
| 122 | to check if `erc-server-process' is bound. | ||
| 123 | |||
| 124 | * erc-nicklist.el: Added to the Commentary section an explanation | ||
| 125 | that `erc-nicklist-quit' should be called from within the nicklist | ||
| 126 | buffer. Set file coding to utf-8 so a contributor's name is | ||
| 127 | displayed correctly. | ||
| 128 | (erc-nicklist-icons-directory): Use customize type directory | ||
| 129 | instead of string. | ||
| 130 | (erc-nicklist-insert-contents): Set bbdb-nick to an empty string | ||
| 131 | if it wasn't found. This fixes a bug where an error would occur | ||
| 132 | when using `string=' on bbdb-nick if it was nil. | ||
| 133 | |||
| 134 | * erc-replace.el: Removed URL from file information since it | ||
| 135 | doesn't exist. | ||
| 136 | |||
| 137 | * erc-sound.el: Updated copyright years. Fixed Commentary and | ||
| 138 | added Usage section. | ||
| 139 | (define-erc-module): Add and remove `erc-ctcp-query-SOUND' to | ||
| 140 | `erc-ctcp-query-SOUND-hook' here. Removed the keybinding | ||
| 141 | definitions. | ||
| 142 | (erc-play-sound, erc-default-sound, erc-cmd-SOUND) | ||
| 143 | (erc-ctcp-query-SOUND): Doc fix. | ||
| 144 | (erc-play-command): Removed, not necessary anymore. | ||
| 145 | (erc-ctcp-query-SOUND-hook): Set to nil as default. Moved up | ||
| 146 | higher in code, added docstring. | ||
| 147 | (erc-play-sound): Use `play-sound-file'. It exists in GNU Emacs | ||
| 148 | as well since version 21 or earlier. Removed commented-out older | ||
| 149 | version of function. | ||
| 150 | |||
| 151 | * NEWS: Fixed formatting, added channel tracking change. | ||
| 152 | |||
| 153 | 2006-09-03 Diane Murray <disumu@x3y2z1.net> | ||
| 154 | |||
| 155 | * erc.el: M-x erc RET can now be used to start ERC. | ||
| 156 | (erc-open): Renamed from `erc'. | ||
| 157 | (erc-before-connect): Change erc-select to erc. | ||
| 158 | (erc): Renamed from `erc-select'. Use `erc-open'. | ||
| 159 | (erc-select): Defined as alias of `erc'. | ||
| 160 | (erc-ssl): Renamed from `erc-select-ssl'. Use `erc'. | ||
| 161 | (erc-select-ssl): Defined as alias of `erc-ssl'. | ||
| 162 | (erc-cmd-SERVER): Use `erc'. | ||
| 163 | (erc-query, erc-handle-irc-url): Use `erc-open'. | ||
| 164 | |||
| 165 | * erc-backend.el (erc-process-sentinel-1, JOIN): Use `erc-open'. | ||
| 166 | |||
| 167 | * erc-menu.el (erc-menu-definition): Use `erc'. | ||
| 168 | |||
| 169 | * erc-networks.el: Updated copyright years. | ||
| 170 | (erc-server-select): Use keyword arguments when calling `erc'. | ||
| 171 | |||
| 172 | * erc.texi (Getting Started, Connecting): Changed erc-select to | ||
| 173 | erc. | ||
| 174 | |||
| 175 | * NEWS: Added note about these changes. | ||
| 176 | |||
| 177 | 2006-08-21 Diane Murray <disumu@x3y2z1.net> | ||
| 178 | |||
| 179 | * erc-track.el (erc-track-mode-line-mouse-face): New variable. | ||
| 180 | (erc-make-mode-line-buffer-name): Add help-echo and mouse-face | ||
| 181 | properties to channel name. | ||
| 182 | |||
| 183 | 2006-08-14 Diane Murray <disumu@x3y2z1.net> | ||
| 184 | |||
| 185 | * erc-menu.el: Updated copyright years. Removed EmacsWiki URL. | ||
| 186 | (erc-menu-definition): Name the menu "ERC" instead of "IRC" to | ||
| 187 | avoid confusion with rcirc and other clients. | ||
| 188 | |||
| 13 | 2006-08-13 Romain Francoise <romain@orebokech.com> | 189 | 2006-08-13 Romain Francoise <romain@orebokech.com> |
| 14 | 190 | ||
| 15 | * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p' | 191 | * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p' |
| 16 | prompt with a space. | 192 | prompt with a space. |
| 17 | 193 | ||
| 194 | 2006-08-11 Michael Olson <mwolson@gnu.org> | ||
| 195 | |||
| 196 | * erc-fill.el (erc-fill): Skip any initial empty lines so that we | ||
| 197 | avoid errors when inserting disconnect messages and other messages | ||
| 198 | that begin with newlines. | ||
| 199 | |||
| 18 | 2006-08-07 Michael Olson <mwolson@gnu.org> | 200 | 2006-08-07 Michael Olson <mwolson@gnu.org> |
| 19 | 201 | ||
| 20 | * erc-backend.el (erc-process-sentinel-1): Use erc-display-message | 202 | * erc-backend.el (erc-process-sentinel-1): Use erc-display-message |
| @@ -32,6 +214,9 @@ | |||
| 32 | 214 | ||
| 33 | 2006-08-06 Michael Olson <mwolson@gnu.org> | 215 | 2006-08-06 Michael Olson <mwolson@gnu.org> |
| 34 | 216 | ||
| 217 | * erc-backend.el (erc-server-send-queue): Update from Circe | ||
| 218 | version of this function. | ||
| 219 | |||
| 35 | * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with | 220 | * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with |
| 36 | multi-tty Emacs. | 221 | multi-tty Emacs. |
| 37 | (erc-select-startup-file): Fix bug introduced by recent change. | 222 | (erc-select-startup-file): Fix bug introduced by recent change. |
diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index 3eff0015b4c..dcb6bc0756e 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el | |||
| @@ -38,7 +38,7 @@ yourself back when you type something." | |||
| 38 | 38 | ||
| 39 | (defvar erc-autoaway-idletimer nil | 39 | (defvar erc-autoaway-idletimer nil |
| 40 | "The Emacs idletimer. | 40 | "The Emacs idletimer. |
| 41 | This is only used when `erc-autoaway-use-emacs-idle' is non-nil.") | 41 | This is only used when `erc-autoaway-idle-method' is set to 'emacs.") |
| 42 | 42 | ||
| 43 | ;;;###autoload (autoload 'erc-autoaway-mode "erc-autoaway") | 43 | ;;;###autoload (autoload 'erc-autoaway-mode "erc-autoaway") |
| 44 | (define-erc-module autoaway nil | 44 | (define-erc-module autoaway nil |
| @@ -206,6 +206,7 @@ exceeds `erc-autoaway-idle-seconds'." | |||
| 206 | ;; this function is called from `erc-timer-hook', which is called | 206 | ;; this function is called from `erc-timer-hook', which is called |
| 207 | ;; whenever the server sends something to the client. | 207 | ;; whenever the server sends something to the client. |
| 208 | (when (and erc-auto-set-away | 208 | (when (and erc-auto-set-away |
| 209 | (not erc-autoaway-caused-away) | ||
| 209 | (not (erc-away-p))) | 210 | (not (erc-away-p))) |
| 210 | (let ((idle-time (erc-time-diff erc-autoaway-last-sent-time | 211 | (let ((idle-time (erc-time-diff erc-autoaway-last-sent-time |
| 211 | current-time))) | 212 | current-time))) |
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 5acbcb05ab8..a51cec85af8 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el | |||
| @@ -416,7 +416,7 @@ Currently this is called by `erc-send-input'." | |||
| 416 | 416 | ||
| 417 | (defun erc-server-process-alive () | 417 | (defun erc-server-process-alive () |
| 418 | "Return non-nil when `erc-server-process' is open or running." | 418 | "Return non-nil when `erc-server-process' is open or running." |
| 419 | (and (boundp 'erc-server-process) | 419 | (and erc-server-process |
| 420 | (processp erc-server-process) | 420 | (processp erc-server-process) |
| 421 | (memq (process-status erc-server-process) '(run open)))) | 421 | (memq (process-status erc-server-process) '(run open)))) |
| 422 | 422 | ||
| @@ -512,8 +512,8 @@ action." | |||
| 512 | (not (string-match "^failed with code 111" event))) | 512 | (not (string-match "^failed with code 111" event))) |
| 513 | ;; Yuck, this should perhaps funcall | 513 | ;; Yuck, this should perhaps funcall |
| 514 | ;; erc-server-reconnect-function with no args | 514 | ;; erc-server-reconnect-function with no args |
| 515 | (erc erc-session-server erc-session-port erc-server-current-nick | 515 | (erc-open erc-session-server erc-session-port erc-server-current-nick |
| 516 | erc-session-user-full-name t erc-session-password) | 516 | erc-session-user-full-name t erc-session-password) |
| 517 | ;; terminate, do not reconnect | 517 | ;; terminate, do not reconnect |
| 518 | (erc-display-message nil 'error (current-buffer) | 518 | (erc-display-message nil 'error (current-buffer) |
| 519 | 'terminated ?e event)))) | 519 | 'terminated ?e event)))) |
| @@ -673,7 +673,8 @@ protection algorithm." | |||
| 673 | (error nil))))) | 673 | (error nil))))) |
| 674 | (when erc-server-flood-queue | 674 | (when erc-server-flood-queue |
| 675 | (setq erc-server-flood-timer | 675 | (setq erc-server-flood-timer |
| 676 | (run-at-time 2 nil #'erc-server-send-queue buffer)))))) | 676 | (run-at-time (+ 0.2 erc-server-flood-penalty) |
| 677 | nil #'erc-server-send-queue buffer)))))) | ||
| 677 | 678 | ||
| 678 | (defun erc-message (message-command line &optional force) | 679 | (defun erc-message (message-command line &optional force) |
| 679 | "Send LINE to the server as a privmsg or a notice. | 680 | "Send LINE to the server as a privmsg or a notice. |
| @@ -1038,11 +1039,11 @@ add things to `%s' instead." | |||
| 1038 | (let* ((str (cond | 1039 | (let* ((str (cond |
| 1039 | ;; If I have joined a channel | 1040 | ;; If I have joined a channel |
| 1040 | ((erc-current-nick-p nick) | 1041 | ((erc-current-nick-p nick) |
| 1041 | (setq buffer (erc erc-session-server erc-session-port | 1042 | (setq buffer (erc-open erc-session-server erc-session-port |
| 1042 | nick erc-session-user-full-name | 1043 | nick erc-session-user-full-name |
| 1043 | nil nil | 1044 | nil nil |
| 1044 | erc-default-recipients chnl | 1045 | erc-default-recipients chnl |
| 1045 | erc-server-process)) | 1046 | erc-server-process)) |
| 1046 | (when buffer | 1047 | (when buffer |
| 1047 | (set-buffer buffer) | 1048 | (set-buffer buffer) |
| 1048 | (erc-add-default-channel chnl) | 1049 | (erc-add-default-channel chnl) |
| @@ -1583,11 +1584,11 @@ See `erc-display-server-message'." nil | |||
| 1583 | "NAMES notice." nil | 1584 | "NAMES notice." nil |
| 1584 | (let ((channel (third (erc-response.command-args parsed))) | 1585 | (let ((channel (third (erc-response.command-args parsed))) |
| 1585 | (users (erc-response.contents parsed))) | 1586 | (users (erc-response.contents parsed))) |
| 1586 | (erc-with-buffer (channel proc) | ||
| 1587 | (erc-channel-receive-names users)) | ||
| 1588 | (erc-display-message parsed 'notice (or (erc-get-buffer channel proc) | 1587 | (erc-display-message parsed 'notice (or (erc-get-buffer channel proc) |
| 1589 | 'active) | 1588 | 'active) |
| 1590 | 's353 ?c channel ?u users))) | 1589 | 's353 ?c channel ?u users) |
| 1590 | (erc-with-buffer (channel proc) | ||
| 1591 | (erc-channel-receive-names users)))) | ||
| 1591 | 1592 | ||
| 1592 | (define-erc-response-handler (366) | 1593 | (define-erc-response-handler (366) |
| 1593 | "End of NAMES." nil | 1594 | "End of NAMES." nil |
| @@ -1598,11 +1599,16 @@ See `erc-display-server-message'." nil | |||
| 1598 | "Channel ban list entries" nil | 1599 | "Channel ban list entries" nil |
| 1599 | (multiple-value-bind (channel banmask setter time) | 1600 | (multiple-value-bind (channel banmask setter time) |
| 1600 | (cdr (erc-response.command-args parsed)) | 1601 | (cdr (erc-response.command-args parsed)) |
| 1601 | (erc-display-message parsed 'notice 'active 's367 | 1602 | ;; setter and time are not standard |
| 1602 | ?c channel | 1603 | (if setter |
| 1603 | ?b banmask | 1604 | (erc-display-message parsed 'notice 'active 's367-set-by |
| 1604 | ?s setter | 1605 | ?c channel |
| 1605 | ?t time))) | 1606 | ?b banmask |
| 1607 | ?s setter | ||
| 1608 | ?t (or time "")) | ||
| 1609 | (erc-display-message parsed 'notice 'active 's367 | ||
| 1610 | ?c channel | ||
| 1611 | ?b banmask)))) | ||
| 1606 | 1612 | ||
| 1607 | (define-erc-response-handler (368) | 1613 | (define-erc-response-handler (368) |
| 1608 | "End of channel ban list" nil | 1614 | "End of channel ban list" nil |
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index 2a06fa96b62..9d652b26d05 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Alex Schroeder <alex@gnu.org> | 5 | ;; Author: Alex Schroeder <alex@gnu.org> |
| 6 | ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?EmacsIRCClient | 6 | ;; URL: http://www.emacswiki.org/cgi-bin/wiki/ERC |
| 7 | 7 | ||
| 8 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 9 | 9 | ||
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 098e9085d74..1b5111e8525 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el | |||
| @@ -35,7 +35,9 @@ | |||
| 35 | ;; rewritten to support the way how ERC operates. Server socket support | 35 | ;; rewritten to support the way how ERC operates. Server socket support |
| 36 | ;; was added for DCC CHAT and SEND afterwards. Thanks | 36 | ;; was added for DCC CHAT and SEND afterwards. Thanks |
| 37 | ;; to the original authors for their work. | 37 | ;; to the original authors for their work. |
| 38 | ;; | 38 | |
| 39 | ;;; Usage: | ||
| 40 | |||
| 39 | ;; To use this file, put | 41 | ;; To use this file, put |
| 40 | ;; (require 'erc-dcc) | 42 | ;; (require 'erc-dcc) |
| 41 | ;; in your .emacs. | 43 | ;; in your .emacs. |
| @@ -49,7 +51,7 @@ | |||
| 49 | ;; /dcc send nick file - Offer DCC SEND to nick | 51 | ;; /dcc send nick file - Offer DCC SEND to nick |
| 50 | ;; | 52 | ;; |
| 51 | ;; Please note that offering DCC connections (offering chats and sending | 53 | ;; Please note that offering DCC connections (offering chats and sending |
| 52 | ;; files) is only supported with Emacs 21.3.50 (CVS). | 54 | ;; files) is only supported with Emacs 22. |
| 53 | 55 | ||
| 54 | ;;; Code: | 56 | ;;; Code: |
| 55 | 57 | ||
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 6a5f80f7fd8..9552ce8543d 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el | |||
| @@ -122,7 +122,15 @@ characters. Set to nil to disable." | |||
| 122 | You can put this on `erc-insert-modify-hook' and/or `erc-send-modify-hook'." | 122 | You can put this on `erc-insert-modify-hook' and/or `erc-send-modify-hook'." |
| 123 | (unless (erc-string-invisible-p (buffer-substring (point-min) (point-max))) | 123 | (unless (erc-string-invisible-p (buffer-substring (point-min) (point-max))) |
| 124 | (when erc-fill-function | 124 | (when erc-fill-function |
| 125 | (funcall erc-fill-function)))) | 125 | ;; skip initial empty lines |
| 126 | (goto-char (point-min)) | ||
| 127 | (save-match-data | ||
| 128 | (while (and (looking-at "[ \t\n]*$") | ||
| 129 | (= (forward-line 1) 0)))) | ||
| 130 | (unless (eobp) | ||
| 131 | (save-restriction | ||
| 132 | (narrow-to-region (point) (point-max)) | ||
| 133 | (funcall erc-fill-function)))))) | ||
| 126 | 134 | ||
| 127 | (defun erc-fill-static () | 135 | (defun erc-fill-static () |
| 128 | "Fills a text such that messages start at column `erc-fill-static-center'." | 136 | "Fills a text such that messages start at column `erc-fill-static-center'." |
diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el index 7ca843d115c..24eb2f09ccb 100644 --- a/lisp/erc/erc-ibuffer.el +++ b/lisp/erc/erc-ibuffer.el | |||
| @@ -91,14 +91,14 @@ | |||
| 91 | " ")) | 91 | " ")) |
| 92 | 92 | ||
| 93 | (define-ibuffer-column erc-server-name (:name "Server") | 93 | (define-ibuffer-column erc-server-name (:name "Server") |
| 94 | (if (and (boundp 'erc-server-process) (processp erc-server-process)) | 94 | (if (and erc-server-process (processp erc-server-process)) |
| 95 | (with-current-buffer (process-buffer erc-server-process) | 95 | (with-current-buffer (process-buffer erc-server-process) |
| 96 | (or erc-server-announced-name erc-session-server)) | 96 | (or erc-server-announced-name erc-session-server)) |
| 97 | "")) | 97 | "")) |
| 98 | 98 | ||
| 99 | (define-ibuffer-column erc-target (:name "Target") | 99 | (define-ibuffer-column erc-target (:name "Target") |
| 100 | (if (eq major-mode 'erc-mode) | 100 | (if (eq major-mode 'erc-mode) |
| 101 | (cond ((and (boundp 'erc-server-process) (processp erc-server-process) | 101 | (cond ((and erc-server-process (processp erc-server-process) |
| 102 | (eq (current-buffer) (process-buffer erc-server-process))) | 102 | (eq (current-buffer) (process-buffer erc-server-process))) |
| 103 | (concat "Server " erc-session-server ":" | 103 | (concat "Server " erc-session-server ":" |
| 104 | (erc-port-to-string erc-session-port))) | 104 | (erc-port-to-string erc-session-port))) |
| @@ -125,7 +125,7 @@ | |||
| 125 | "")) | 125 | "")) |
| 126 | 126 | ||
| 127 | (define-ibuffer-column erc-away (:name "A") | 127 | (define-ibuffer-column erc-away (:name "A") |
| 128 | (if (and (boundp 'erc-server-process) | 128 | (if (and erc-server-process |
| 129 | (processp erc-server-process) | 129 | (processp erc-server-process) |
| 130 | (with-current-buffer (process-buffer erc-server-process) | 130 | (with-current-buffer (process-buffer erc-server-process) |
| 131 | erc-away)) | 131 | erc-away)) |
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 2fe29e82fe5..bd4ed3387d5 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el | |||
| @@ -43,14 +43,6 @@ | |||
| 43 | ;; | 43 | ;; |
| 44 | ;; (require 'erc-log) | 44 | ;; (require 'erc-log) |
| 45 | ;; | 45 | ;; |
| 46 | ;; You may optionally want the following code, to save all ERC buffers | ||
| 47 | ;; without confirmation when exiting emacs: | ||
| 48 | ;; | ||
| 49 | ;; (defadvice save-buffers-kill-emacs (before save-logs (&rest args) activate) | ||
| 50 | ;; (save-some-buffers t (lambda () | ||
| 51 | ;; (when (and (eq major-mode 'erc-mode) | ||
| 52 | ;; (not (null buffer-file-name))) t)))) | ||
| 53 | ;; | ||
| 54 | ;; If you only want to save logs for some buffers, customise the | 46 | ;; If you only want to save logs for some buffers, customise the |
| 55 | ;; variable `erc-enable-logging'. | 47 | ;; variable `erc-enable-logging'. |
| 56 | 48 | ||
| @@ -213,6 +205,7 @@ also be a predicate function. To only log when you are not set away, use: | |||
| 213 | (add-hook 'erc-send-post-hook 'erc-save-buffer-in-logs)) | 205 | (add-hook 'erc-send-post-hook 'erc-save-buffer-in-logs)) |
| 214 | (add-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs) | 206 | (add-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs) |
| 215 | (add-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) | 207 | (add-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) |
| 208 | (add-hook 'kill-emacs-hook 'erc-log-save-all-buffers) | ||
| 216 | (add-hook 'erc-quit-hook 'erc-conditional-save-queries) | 209 | (add-hook 'erc-quit-hook 'erc-conditional-save-queries) |
| 217 | (add-hook 'erc-part-hook 'erc-conditional-save-buffer) | 210 | (add-hook 'erc-part-hook 'erc-conditional-save-buffer) |
| 218 | ;; append, so that 'erc-initialize-log-marker runs first | 211 | ;; append, so that 'erc-initialize-log-marker runs first |
| @@ -225,6 +218,7 @@ also be a predicate function. To only log when you are not set away, use: | |||
| 225 | (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs) | 218 | (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs) |
| 226 | (remove-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs) | 219 | (remove-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs) |
| 227 | (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) | 220 | (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) |
| 221 | (remove-hook 'kill-emacs-hook 'erc-log-save-all-buffers) | ||
| 228 | (remove-hook 'erc-quit-hook 'erc-conditional-save-queries) | 222 | (remove-hook 'erc-quit-hook 'erc-conditional-save-queries) |
| 229 | (remove-hook 'erc-part-hook 'erc-conditional-save-buffer) | 223 | (remove-hook 'erc-part-hook 'erc-conditional-save-buffer) |
| 230 | (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging) | 224 | (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging) |
| @@ -263,7 +257,7 @@ Returns nil iff `erc-server-buffer-p' returns t." | |||
| 263 | (not (erc-server-buffer-p))))) | 257 | (not (erc-server-buffer-p))))) |
| 264 | 258 | ||
| 265 | (defun erc-save-query-buffers (process) | 259 | (defun erc-save-query-buffers (process) |
| 266 | "Save all buffers process." | 260 | "Save all buffers of the given PROCESS." |
| 267 | (erc-with-all-buffers-of-server process | 261 | (erc-with-all-buffers-of-server process |
| 268 | nil | 262 | nil |
| 269 | (erc-save-buffer-in-logs))) | 263 | (erc-save-buffer-in-logs))) |
| @@ -278,6 +272,12 @@ Returns nil iff `erc-server-buffer-p' returns t." | |||
| 278 | (when erc-save-queries-on-quit | 272 | (when erc-save-queries-on-quit |
| 279 | (erc-save-query-buffers process))) | 273 | (erc-save-query-buffers process))) |
| 280 | 274 | ||
| 275 | ;; Make sure that logs get saved, even if someone overrides the active | ||
| 276 | ;; process prompt for a quick exit from Emacs | ||
| 277 | (defun erc-log-save-all-buffers () | ||
| 278 | (dolist (buffer (erc-buffer-list)) | ||
| 279 | (erc-save-buffer-in-logs buffer))) | ||
| 280 | |||
| 281 | ;;;###autoload | 281 | ;;;###autoload |
| 282 | (defun erc-logging-enabled (&optional buffer) | 282 | (defun erc-logging-enabled (&optional buffer) |
| 283 | "Return non-nil if logging is enabled for BUFFER. | 283 | "Return non-nil if logging is enabled for BUFFER. |
| @@ -309,7 +309,7 @@ The result is converted to lowercase, as IRC is case-insensitive" | |||
| 309 | (erc-log-standardize-name | 309 | (erc-log-standardize-name |
| 310 | (funcall erc-generate-log-file-name-function | 310 | (funcall erc-generate-log-file-name-function |
| 311 | (or buffer (current-buffer)) | 311 | (or buffer (current-buffer)) |
| 312 | (or (erc-default-target) (buffer-name buffer)) | 312 | (or (buffer-name buffer) (erc-default-target)) |
| 313 | (erc-current-nick) | 313 | (erc-current-nick) |
| 314 | erc-session-server erc-session-port)) | 314 | erc-session-server erc-session-port)) |
| 315 | erc-log-channels-directory)) | 315 | erc-log-channels-directory)) |
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 7040a7baeee..a2dc7a1b2f2 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Mario Lang <mlang@delysid.org> | 5 | ;; Author: Mario Lang <mlang@delysid.org> |
| 6 | ;; Keywords: comm, processes, menu | 6 | ;; Keywords: comm, processes, menu |
| 7 | ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcMenu | ||
| 8 | 7 | ||
| 9 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 10 | 9 | ||
| @@ -29,11 +28,12 @@ | |||
| 29 | 28 | ||
| 30 | ;;; Code: | 29 | ;;; Code: |
| 31 | 30 | ||
| 31 | ;(require 'erc) | ||
| 32 | (require 'easymenu) | 32 | (require 'easymenu) |
| 33 | 33 | ||
| 34 | (defvar erc-menu-definition | 34 | (defvar erc-menu-definition |
| 35 | (list "IRC" | 35 | (list "ERC" |
| 36 | ["Connect to server..." erc-select t] | 36 | ["Connect to server..." erc t] |
| 37 | ["Disconnect from server..." erc-quit-server erc-server-connected] | 37 | ["Disconnect from server..." erc-quit-server erc-server-connected] |
| 38 | "-" | 38 | "-" |
| 39 | ["List channels..." erc-list-channels | 39 | ["List channels..." erc-list-channels |
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index c15f72e248f..99aba31c3d4 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el | |||
| @@ -809,7 +809,7 @@ As an example: | |||
| 809 | (erc-ports-list (nth 3 srv)) | 809 | (erc-ports-list (nth 3 srv)) |
| 810 | (list (nth 3 srv)))) | 810 | (list (nth 3 srv)))) |
| 811 | (port (nth (random (length ports)) ports))) | 811 | (port (nth (random (length ports)) ports))) |
| 812 | (erc host port erc-nick erc-user-full-name t))) | 812 | (erc :server host :port port))) |
| 813 | 813 | ||
| 814 | ;;; The following experimental | 814 | ;;; The following experimental |
| 815 | ;; It does not work yet, help me with it if you | 815 | ;; It does not work yet, help me with it if you |
diff --git a/lisp/erc/erc-nicklist.el b/lisp/erc/erc-nicklist.el index 5599565844b..7a94d2be9cc 100644 --- a/lisp/erc/erc-nicklist.el +++ b/lisp/erc/erc-nicklist.el | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | ;; This provides a minimal mIRC style nicklist buffer for ERC. To | 29 | ;; This provides a minimal mIRC style nicklist buffer for ERC. To |
| 30 | ;; activate, do M-x erc-nicklist RET in the channel buffer you want | 30 | ;; activate, do M-x erc-nicklist RET in the channel buffer you want |
| 31 | ;; the nicklist to appear for. To close and quit the nicklist | 31 | ;; the nicklist to appear for. To close and quit the nicklist |
| 32 | ;; buffer, do M-x erc-nicklist-quit RET. | 32 | ;; buffer, do M-x erc-nicklist-quit RET from within the nicklist buffer. |
| 33 | ;; | 33 | ;; |
| 34 | ;; TODO: | 34 | ;; TODO: |
| 35 | ;; o Somehow associate nicklist windows with channel windows so they | 35 | ;; o Somehow associate nicklist windows with channel windows so they |
| @@ -97,7 +97,7 @@ By \"chat medium\", we mean IRC, AOL, MSN, ICQ, etc." | |||
| 97 | "*Directory of the PNG files for chat icons. | 97 | "*Directory of the PNG files for chat icons. |
| 98 | Icons are displayed if `erc-nicklist-use-icons' is non-nil." | 98 | Icons are displayed if `erc-nicklist-use-icons' is non-nil." |
| 99 | :group 'erc-nicklist | 99 | :group 'erc-nicklist |
| 100 | :type 'string) | 100 | :type 'directory) |
| 101 | 101 | ||
| 102 | (defcustom erc-nicklist-voiced-position 'bottom | 102 | (defcustom erc-nicklist-voiced-position 'bottom |
| 103 | "*Position of voiced nicks in the nicklist. | 103 | "*Position of voiced nicks in the nicklist. |
| @@ -207,7 +207,9 @@ Seach for the BBDB record of this contact. If not found, return nil." | |||
| 207 | (channels (erc-server-user-buffers server-user)) | 207 | (channels (erc-server-user-buffers server-user)) |
| 208 | (op (erc-channel-user-op channel-user)) | 208 | (op (erc-channel-user-op channel-user)) |
| 209 | (voice (erc-channel-user-voice channel-user)) | 209 | (voice (erc-channel-user-voice channel-user)) |
| 210 | (bbdb-nick (erc-nicklist-search-for-nick (concat login "@" host))) | 210 | (bbdb-nick (or (erc-nicklist-search-for-nick |
| 211 | (concat login "@" host)) | ||
| 212 | "")) | ||
| 211 | (away-status (if voice "" "\n(Away)")) | 213 | (away-status (if voice "" "\n(Away)")) |
| 212 | (balloon-text (concat bbdb-nick (if (string= "" bbdb-nick) | 214 | (balloon-text (concat bbdb-nick (if (string= "" bbdb-nick) |
| 213 | "" "\n") | 215 | "" "\n") |
| @@ -406,6 +408,7 @@ list has all the voiced users according to | |||
| 406 | ;; Local Variables: | 408 | ;; Local Variables: |
| 407 | ;; indent-tabs-mode: t | 409 | ;; indent-tabs-mode: t |
| 408 | ;; tab-width: 8 | 410 | ;; tab-width: 8 |
| 411 | ;; coding: utf-8 | ||
| 409 | ;; End: | 412 | ;; End: |
| 410 | 413 | ||
| 411 | ;; arch-tag: db37a256-87a7-4544-bd90-e5f16c9f5ca5 | 414 | ;; arch-tag: db37a256-87a7-4544-bd90-e5f16c9f5ca5 |
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index 06d3ca77f06..7a22954f171 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | ;; Author: Andreas Fuchs <asf@void.at> | 5 | ;; Author: Andreas Fuchs <asf@void.at> |
| 6 | ;; Maintainer: Mario Lang (mlang@delysid.org) | 6 | ;; Maintainer: Mario Lang (mlang@delysid.org) |
| 7 | ;; Keywords: IRC, client, Internet | 7 | ;; Keywords: IRC, client, Internet |
| 8 | ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcReplace | ||
| 9 | 8 | ||
| 10 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 11 | 10 | ||
diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index bbcddafc231..e152d8ed0df 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el | |||
| @@ -21,9 +21,26 @@ | |||
| 21 | 21 | ||
| 22 | ;;; Commentary: | 22 | ;;; Commentary: |
| 23 | 23 | ||
| 24 | ;; This used to be in erc.el, I (Jorgen) just extracted it from there | 24 | ;; Play sounds when users send you CTCP SOUND messages. |
| 25 | ;; and put it in this file. Bugs and features are those of the | 25 | |
| 26 | ;; original author. | 26 | ;; This file also defines the command /sound so that you can send |
| 27 | ;; sound requests to other users. | ||
| 28 | |||
| 29 | ;;; Usage: | ||
| 30 | |||
| 31 | ;; Add the following to your .emacs if you want to play sounds. | ||
| 32 | ;; | ||
| 33 | ;; (require 'erc-soud) | ||
| 34 | ;; (erc-sound-enable) | ||
| 35 | ;; | ||
| 36 | ;; To send requests to other users from within query buffers, type the | ||
| 37 | ;; following: | ||
| 38 | ;; | ||
| 39 | ;; /sound filename optional-message-text | ||
| 40 | ;; | ||
| 41 | ;; You can also type the following: | ||
| 42 | ;; | ||
| 43 | ;; /ctcp nickname sound filename optional-message | ||
| 27 | 44 | ||
| 28 | ;;; Code: | 45 | ;;; Code: |
| 29 | 46 | ||
| @@ -34,9 +51,11 @@ | |||
| 34 | "In ERC sound mode, the client will respond to CTCP SOUND requests | 51 | "In ERC sound mode, the client will respond to CTCP SOUND requests |
| 35 | and play sound files as requested." | 52 | and play sound files as requested." |
| 36 | ;; Enable: | 53 | ;; Enable: |
| 37 | ((define-key erc-mode-map "\C-c\C-s" 'erc-toggle-sound)) | 54 | ((add-hook 'erc-ctcp-query-SOUND-hook 'erc-ctcp-query-SOUND) |
| 55 | (define-key erc-mode-map "\C-c\C-s" 'erc-toggle-sound)) | ||
| 38 | ;; Disable: | 56 | ;; Disable: |
| 39 | ((define-key erc-mode-map "\C-c\C-s" 'undefined))) | 57 | ((remove-hook 'erc-ctcp-query-SOUND-hook 'erc-ctcp-query-SOUND) |
| 58 | (define-key erc-mode-map "\C-c\C-s" 'undefined))) | ||
| 40 | 59 | ||
| 41 | (erc-define-catalog-entry 'english 'CTCP-SOUND "%n (%u@%h) plays %s:%m") | 60 | (erc-define-catalog-entry 'english 'CTCP-SOUND "%n (%u@%h) plays %s:%m") |
| 42 | 61 | ||
| @@ -45,7 +64,7 @@ and play sound files as requested." | |||
| 45 | :group 'erc) | 64 | :group 'erc) |
| 46 | 65 | ||
| 47 | (defcustom erc-play-sound t | 66 | (defcustom erc-play-sound t |
| 48 | "*Play sound on SOUND ctcp requests (used in ICQ chat)." | 67 | "*Play sounds when you receive CTCP SOUND requests." |
| 49 | :group 'erc-sound | 68 | :group 'erc-sound |
| 50 | :type 'boolean) | 69 | :type 'boolean) |
| 51 | 70 | ||
| @@ -55,18 +74,22 @@ and play sound files as requested." | |||
| 55 | :type '(repeat directory)) | 74 | :type '(repeat directory)) |
| 56 | 75 | ||
| 57 | (defcustom erc-default-sound nil | 76 | (defcustom erc-default-sound nil |
| 58 | "Play this sound if the requested file was not found." | 77 | "Play this sound if the requested file was not found. |
| 78 | If this is set to nil or the file doesn't exist a beep will sound." | ||
| 59 | :group 'erc-sound | 79 | :group 'erc-sound |
| 60 | :type '(choice (const nil) | 80 | :type '(choice (const nil) |
| 61 | file)) | 81 | file)) |
| 62 | 82 | ||
| 63 | (defcustom erc-play-command "play" | 83 | (defvar erc-ctcp-query-SOUND-hook nil |
| 64 | "Command for playing sound samples." | 84 | "Hook to run after receiving a CTCP SOUND request.") |
| 65 | :group 'erc-sound | ||
| 66 | :type 'string) | ||
| 67 | 85 | ||
| 68 | (defun erc-cmd-SOUND (line &optional force) | 86 | (defun erc-cmd-SOUND (line &optional force) |
| 69 | "Play the sound given in LINE." | 87 | "Send a CTCP SOUND message to the default target. |
| 88 | If `erc-play-sound' is non-nil, play the sound as well. | ||
| 89 | |||
| 90 | /sound filename optional-message-text | ||
| 91 | |||
| 92 | LINE is the text entered, including the command." | ||
| 70 | (cond | 93 | (cond |
| 71 | ((string-match "^\\s-*\\(\\S-+\\)\\(\\s-.*\\)?$" line) | 94 | ((string-match "^\\s-*\\(\\S-+\\)\\(\\s-.*\\)?$" line) |
| 72 | (let ((file (match-string 1 line)) | 95 | (let ((file (match-string 1 line)) |
| @@ -84,8 +107,8 @@ and play sound files as requested." | |||
| 84 | t)) | 107 | t)) |
| 85 | (t nil))) | 108 | (t nil))) |
| 86 | 109 | ||
| 87 | (defvar erc-ctcp-query-SOUND-hook '(erc-ctcp-query-SOUND)) | ||
| 88 | (defun erc-ctcp-query-SOUND (proc nick login host to msg) | 110 | (defun erc-ctcp-query-SOUND (proc nick login host to msg) |
| 111 | "Display a CTCP SOUND message and play sound if `erc-play-sound' is non-nil." | ||
| 89 | (when (string-match "^SOUND\\s-+\\(\\S-+\\)\\(\\(\\s-+.*\\)\\|\\(\\s-*\\)\\)$" msg) | 112 | (when (string-match "^SOUND\\s-+\\(\\S-+\\)\\(\\(\\s-+.*\\)\\|\\(\\s-*\\)\\)$" msg) |
| 90 | (let ((sound (match-string 1 msg)) | 113 | (let ((sound (match-string 1 msg)) |
| 91 | (comment (match-string 2 msg))) | 114 | (comment (match-string 2 msg))) |
| @@ -96,42 +119,16 @@ and play sound files as requested." | |||
| 96 | nil) | 119 | nil) |
| 97 | 120 | ||
| 98 | (defun erc-play-sound (file) | 121 | (defun erc-play-sound (file) |
| 99 | "Plays a sound file located in one of the directories in `erc-sound-path' | 122 | "Play a sound file located in one of the directories in `erc-sound-path'. |
| 100 | with a command `erc-play-command'." | 123 | See also `play-sound-file'." |
| 101 | (let ((filepath (erc-find-file file erc-sound-path))) | 124 | (let ((filepath (erc-find-file file erc-sound-path))) |
| 102 | (if (and (not filepath) erc-default-sound) | 125 | (if (and (not filepath) erc-default-sound) |
| 103 | (setq filepath erc-default-sound)) | 126 | (setq filepath erc-default-sound)) |
| 104 | (cond ((and filepath (file-exists-p filepath)) | 127 | (cond ((and filepath (file-exists-p filepath)) |
| 105 | (if (and (fboundp 'device-sound-enabled-p) | 128 | (play-sound-file filepath)) |
| 106 | (device-sound-enabled-p)) | ||
| 107 | ; For XEmacs | ||
| 108 | (play-sound-file filepath) | ||
| 109 | ; (start-process "erc-sound" nil erc-play-command filepath) | ||
| 110 | (start-process "erc-sound" nil "/bin/tcsh" "-c" | ||
| 111 | (concat erc-play-command " " filepath)))) | ||
| 112 | (t (beep))) | 129 | (t (beep))) |
| 113 | (erc-log (format "Playing sound file %S" filepath)))) | 130 | (erc-log (format "Playing sound file %S" filepath)))) |
| 114 | 131 | ||
| 115 | ;(defun erc-play-sound (file) | ||
| 116 | ; "Plays a sound file located in one of the directories in `erc-sound-path' | ||
| 117 | ; with a command `erc-play-command'." | ||
| 118 | ; (let ((filepath nil) | ||
| 119 | ; (paths erc-sound-path)) | ||
| 120 | ; (while (and paths | ||
| 121 | ; (progn (setq filepath (expand-file-name file (car paths))) | ||
| 122 | ; (not (file-exists-p filepath)))) | ||
| 123 | ; (setq paths (cdr paths))) | ||
| 124 | ; (if (and (not (and filepath (file-exists-p filepath))) | ||
| 125 | ; erc-default-sound) | ||
| 126 | ; (setq filepath erc-default-sound)) | ||
| 127 | ; (cond ((and filepath (file-exists-p filepath)) | ||
| 128 | ;; (start-process "erc-sound" nil erc-play-command filepath) | ||
| 129 | ; (start-process "erc-sound" nil "/bin/tcsh" "-c" | ||
| 130 | ; (concat erc-play-command " " filepath)) | ||
| 131 | ; ) | ||
| 132 | ; (t (beep))) | ||
| 133 | ; (erc-log (format "Playing sound file %S" filepath)))) | ||
| 134 | |||
| 135 | (defun erc-toggle-sound (&optional arg) | 132 | (defun erc-toggle-sound (&optional arg) |
| 136 | "Toggles playing sounds on and off. With positive argument, | 133 | "Toggles playing sounds on and off. With positive argument, |
| 137 | turns them on. With any other argument turns sounds off." | 134 | turns them on. With any other argument turns sounds off." |
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index b045fb24999..3c8f93acfc2 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el | |||
| @@ -580,6 +580,11 @@ ARGS are ignored." | |||
| 580 | (erc-modified-channels-display) | 580 | (erc-modified-channels-display) |
| 581 | (force-mode-line-update t)))) | 581 | (force-mode-line-update t)))) |
| 582 | 582 | ||
| 583 | (defvar erc-track-mouse-face (if (featurep 'xemacs) | ||
| 584 | 'modeline-mousable | ||
| 585 | 'mode-line-highlight) | ||
| 586 | "The face to use when mouse is over channel names in the mode line.") | ||
| 587 | |||
| 583 | (defun erc-make-mode-line-buffer-name (string buffer &optional faces count) | 588 | (defun erc-make-mode-line-buffer-name (string buffer &optional faces count) |
| 584 | "Return STRING as a button that switches to BUFFER when clicked. | 589 | "Return STRING as a button that switches to BUFFER when clicked. |
| 585 | If FACES are provided, color STRING with them." | 590 | If FACES are provided, color STRING with them." |
| @@ -609,6 +614,12 @@ If FACES are provided, color STRING with them." | |||
| 609 | (posn-window (event-start e))) | 614 | (posn-window (event-start e))) |
| 610 | (switch-to-buffer-other-window ,buffer)))) | 615 | (switch-to-buffer-other-window ,buffer)))) |
| 611 | (put-text-property 0 (length name) 'local-map map name) | 616 | (put-text-property 0 (length name) 'local-map map name) |
| 617 | (put-text-property | ||
| 618 | 0 (length name) | ||
| 619 | 'help-echo (concat "mouse-2: switch to buffer, " | ||
| 620 | "mouse-3: switch to buffer in other window") | ||
| 621 | name) | ||
| 622 | (put-text-property 0 (length name) 'mouse-face erc-track-mouse-face name) | ||
| 612 | (when (and faces erc-track-use-faces) | 623 | (when (and faces erc-track-use-faces) |
| 613 | (put-text-property 0 (length name) 'face faces name)) | 624 | (put-text-property 0 (length name) 'face faces name)) |
| 614 | name)) | 625 | name)) |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 1944bb1a832..c65600ba446 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -33,11 +33,11 @@ | |||
| 33 | 33 | ||
| 34 | ;;; Commentary: | 34 | ;;; Commentary: |
| 35 | 35 | ||
| 36 | ;; ERC is an IRC client for Emacs. | 36 | ;; ERC is a powerful, modular, and extensible IRC client for Emacs. |
| 37 | 37 | ||
| 38 | ;; For more information, see the following URLs: | 38 | ;; For more information, see the following URLs: |
| 39 | ;; * http://sv.gnu.org/projects/erc/ | 39 | ;; * http://sv.gnu.org/projects/erc/ |
| 40 | ;; * http://www.emacswiki.org/cgi-bin/wiki.pl?EmacsIRCClient | 40 | ;; * http://www.emacswiki.org/cgi-bin/wiki/ERC |
| 41 | 41 | ||
| 42 | ;; As of 2006-06-13, ERC development is now hosted on Savannah | 42 | ;; As of 2006-06-13, ERC development is now hosted on Savannah |
| 43 | ;; (http://sv.gnu.org/projects/erc). I invite everyone who wants to | 43 | ;; (http://sv.gnu.org/projects/erc). I invite everyone who wants to |
| @@ -57,17 +57,17 @@ | |||
| 57 | 57 | ||
| 58 | ;; To connect to an IRC server, do | 58 | ;; To connect to an IRC server, do |
| 59 | ;; | 59 | ;; |
| 60 | ;; M-x erc-select RET | 60 | ;; M-x erc RET |
| 61 | ;; | 61 | ;; |
| 62 | ;; After you are connected to a server, you can use C-h m or have a look at | 62 | ;; After you are connected to a server, you can use C-h m or have a look at |
| 63 | ;; the IRC menu. | 63 | ;; the ERC menu. |
| 64 | 64 | ||
| 65 | ;;; History: | 65 | ;;; History: |
| 66 | ;; | 66 | ;; |
| 67 | 67 | ||
| 68 | ;;; Code: | 68 | ;;; Code: |
| 69 | 69 | ||
| 70 | (defconst erc-version-string "Version 5.1.4" | 70 | (defconst erc-version-string "Version 5.2 stable pre-release" |
| 71 | "ERC version. This is used by function `erc-version'.") | 71 | "ERC version. This is used by function `erc-version'.") |
| 72 | 72 | ||
| 73 | (eval-when-compile (require 'cl)) | 73 | (eval-when-compile (require 'cl)) |
| @@ -1164,6 +1164,12 @@ See the variable `erc-command-indicator'." | |||
| 1164 | "ERC face for errors." | 1164 | "ERC face for errors." |
| 1165 | :group 'erc-faces) | 1165 | :group 'erc-faces) |
| 1166 | 1166 | ||
| 1167 | ;; same default color as `erc-input-face' | ||
| 1168 | (defface erc-my-nick-face '((t (:bold t :foreground "brown"))) | ||
| 1169 | "ERC face for your current nickname in messages sent by you. | ||
| 1170 | See also `erc-show-my-nick'." | ||
| 1171 | :group 'erc-faces) | ||
| 1172 | |||
| 1167 | (defface erc-nick-default-face '((t (:bold t))) | 1173 | (defface erc-nick-default-face '((t (:bold t))) |
| 1168 | "ERC nickname default face." | 1174 | "ERC nickname default face." |
| 1169 | :group 'erc-faces) | 1175 | :group 'erc-faces) |
| @@ -1316,8 +1322,7 @@ the process buffer." | |||
| 1316 | (process-buffer erc-server-process))) | 1322 | (process-buffer erc-server-process))) |
| 1317 | 1323 | ||
| 1318 | (defun erc-server-buffer-live-p () | 1324 | (defun erc-server-buffer-live-p () |
| 1319 | "Return t if the buffer associated with `erc-server-process' | 1325 | "Return t if the server buffer has not been killed." |
| 1320 | has not been killed." | ||
| 1321 | (and (processp erc-server-process) | 1326 | (and (processp erc-server-process) |
| 1322 | (buffer-live-p (process-buffer erc-server-process)))) | 1327 | (buffer-live-p (process-buffer erc-server-process)))) |
| 1323 | 1328 | ||
| @@ -1433,7 +1438,7 @@ Turning on `erc-mode' runs the hook `erc-mode-hook'." | |||
| 1433 | (defconst erc-default-server "irc.freenode.net" | 1438 | (defconst erc-default-server "irc.freenode.net" |
| 1434 | "IRC server to use if it cannot be detected otherwise.") | 1439 | "IRC server to use if it cannot be detected otherwise.") |
| 1435 | 1440 | ||
| 1436 | (defconst erc-default-port "ircd" | 1441 | (defconst erc-default-port "6667" |
| 1437 | "IRC port to use if it cannot be detected otherwise.") | 1442 | "IRC port to use if it cannot be detected otherwise.") |
| 1438 | 1443 | ||
| 1439 | (defcustom erc-join-buffer 'buffer | 1444 | (defcustom erc-join-buffer 'buffer |
| @@ -1534,7 +1539,7 @@ symbol, it may have these values: | |||
| 1534 | (or target | 1539 | (or target |
| 1535 | (with-current-buffer (get-buffer buf-name) | 1540 | (with-current-buffer (get-buffer buf-name) |
| 1536 | (and (erc-server-buffer-p) | 1541 | (and (erc-server-buffer-p) |
| 1537 | (not erc-server-connected)))) | 1542 | (not (erc-server-process-alive))))) |
| 1538 | (with-current-buffer (get-buffer buf-name) | 1543 | (with-current-buffer (get-buffer buf-name) |
| 1539 | (and (string= erc-session-server server) | 1544 | (and (string= erc-session-server server) |
| 1540 | (erc-port-equal erc-session-port port)))) | 1545 | (erc-port-equal erc-session-port port)))) |
| @@ -1555,7 +1560,8 @@ All strings are compared according to IRC protocol case rules, see | |||
| 1555 | (catch 'result | 1560 | (catch 'result |
| 1556 | (while list | 1561 | (while list |
| 1557 | (if (string= string (erc-downcase (car list))) | 1562 | (if (string= string (erc-downcase (car list))) |
| 1558 | (throw 'result list) (setq list (cdr list)))))) | 1563 | (throw 'result list) |
| 1564 | (setq list (cdr list)))))) | ||
| 1559 | 1565 | ||
| 1560 | (defmacro erc-with-buffer (spec &rest body) | 1566 | (defmacro erc-with-buffer (spec &rest body) |
| 1561 | "Execute BODY in the buffer associated with SPEC. | 1567 | "Execute BODY in the buffer associated with SPEC. |
| @@ -1663,7 +1669,7 @@ If `erc-track-mode' is in enabled, put the last element of | |||
| 1663 | Due to some yet unresolved reason, global function `iswitchb-mode' | 1669 | Due to some yet unresolved reason, global function `iswitchb-mode' |
| 1664 | needs to be active for this function to work." | 1670 | needs to be active for this function to work." |
| 1665 | (interactive "P") | 1671 | (interactive "P") |
| 1666 | (eval-when-compile | 1672 | (eval-and-compile |
| 1667 | (require 'iswitchb)) | 1673 | (require 'iswitchb)) |
| 1668 | (let ((iswitchb-make-buflist-hook | 1674 | (let ((iswitchb-make-buflist-hook |
| 1669 | (lambda () | 1675 | (lambda () |
| @@ -1671,8 +1677,7 @@ needs to be active for this function to work." | |||
| 1671 | (mapcar 'buffer-name | 1677 | (mapcar 'buffer-name |
| 1672 | (erc-buffer-list | 1678 | (erc-buffer-list |
| 1673 | nil | 1679 | nil |
| 1674 | (when (and arg (boundp 'erc-server-process)) | 1680 | (when arg erc-server-process))))))) |
| 1675 | erc-server-process))))))) | ||
| 1676 | (switch-to-buffer | 1681 | (switch-to-buffer |
| 1677 | (iswitchb-read-buffer | 1682 | (iswitchb-read-buffer |
| 1678 | "Switch-to: " | 1683 | "Switch-to: " |
| @@ -1833,9 +1838,10 @@ removed from the list will be disabled." | |||
| 1833 | (condition-case nil | 1838 | (condition-case nil |
| 1834 | (require (intern req)) | 1839 | (require (intern req)) |
| 1835 | (error nil)) | 1840 | (error nil)) |
| 1836 | (funcall (or (intern-soft (concat "erc-" (symbol-name mod) "-mode")) | 1841 | (let ((sym (intern-soft (concat "erc-" (symbol-name mod) "-mode")))) |
| 1837 | (error "`%s' is not a known ERC module" mod)) | 1842 | (if (fboundp sym) |
| 1838 | 1)))) | 1843 | (funcall sym 1) |
| 1844 | (error "`%s' is not a known ERC module" mod)))))) | ||
| 1839 | 1845 | ||
| 1840 | (defun erc-setup-buffer (buffer) | 1846 | (defun erc-setup-buffer (buffer) |
| 1841 | "Consults `erc-join-buffer' to find out how to display `BUFFER'." | 1847 | "Consults `erc-join-buffer' to find out how to display `BUFFER'." |
| @@ -1861,8 +1867,8 @@ removed from the list will be disabled." | |||
| 1861 | (display-buffer buffer) | 1867 | (display-buffer buffer) |
| 1862 | (switch-to-buffer buffer))))) | 1868 | (switch-to-buffer buffer))))) |
| 1863 | 1869 | ||
| 1864 | (defun erc (&optional server port nick full-name | 1870 | (defun erc-open (&optional server port nick full-name |
| 1865 | connect passwd tgt-list channel process) | 1871 | connect passwd tgt-list channel process) |
| 1866 | "ERC is a powerful, modular, and extensible IRC client. | 1872 | "ERC is a powerful, modular, and extensible IRC client. |
| 1867 | 1873 | ||
| 1868 | Connect to SERVER on PORT as NICK with FULL-NAME. | 1874 | Connect to SERVER on PORT as NICK with FULL-NAME. |
| @@ -1881,6 +1887,7 @@ Returns the buffer for the given server or channel." | |||
| 1881 | (connected-p (unless connect erc-server-connected)) | 1887 | (connected-p (unless connect erc-server-connected)) |
| 1882 | (buffer (erc-get-buffer-create server port channel)) | 1888 | (buffer (erc-get-buffer-create server port channel)) |
| 1883 | (old-buffer (current-buffer)) | 1889 | (old-buffer (current-buffer)) |
| 1890 | (old-point (point)) | ||
| 1884 | continued-session) | 1891 | continued-session) |
| 1885 | (erc-update-modules) | 1892 | (erc-update-modules) |
| 1886 | (set-buffer buffer) | 1893 | (set-buffer buffer) |
| @@ -1959,7 +1966,7 @@ Returns the buffer for the given server or channel." | |||
| 1959 | (insert "\n")) | 1966 | (insert "\n")) |
| 1960 | (set-marker (process-mark erc-server-process) (point)) | 1967 | (set-marker (process-mark erc-server-process) (point)) |
| 1961 | (if continued-session | 1968 | (if continued-session |
| 1962 | (goto-char (point-max)) | 1969 | (goto-char old-point) |
| 1963 | (set-marker erc-insert-marker (point)) | 1970 | (set-marker erc-insert-marker (point)) |
| 1964 | (erc-display-prompt) | 1971 | (erc-display-prompt) |
| 1965 | (goto-char (point-max))) | 1972 | (goto-char (point-max))) |
| @@ -2007,7 +2014,7 @@ If no buffer matches, return nil." | |||
| 2007 | 2014 | ||
| 2008 | (defcustom erc-before-connect nil | 2015 | (defcustom erc-before-connect nil |
| 2009 | "Hook called before connecting to a server. | 2016 | "Hook called before connecting to a server. |
| 2010 | This hook gets executed before `erc-select' actually invokes `erc-mode' | 2017 | This hook gets executed before `erc' actually invokes `erc-mode' |
| 2011 | with your input data. The functions in here get called with three | 2018 | with your input data. The functions in here get called with three |
| 2012 | parameters, SERVER, PORT and NICK." | 2019 | parameters, SERVER, PORT and NICK." |
| 2013 | :group 'erc-hooks | 2020 | :group 'erc-hooks |
| @@ -2073,11 +2080,11 @@ functions in here get called with the parameters SERVER and NICK." | |||
| 2073 | (list :server server :port port :nick nick :password passwd))) | 2080 | (list :server server :port port :nick nick :password passwd))) |
| 2074 | 2081 | ||
| 2075 | ;;;###autoload | 2082 | ;;;###autoload |
| 2076 | (defun* erc-select (&key (server (erc-compute-server)) | 2083 | (defun* erc (&key (server (erc-compute-server)) |
| 2077 | (port (erc-compute-port)) | 2084 | (port (erc-compute-port)) |
| 2078 | (nick (erc-compute-nick)) | 2085 | (nick (erc-compute-nick)) |
| 2079 | password | 2086 | password |
| 2080 | (full-name (erc-compute-full-name))) | 2087 | (full-name (erc-compute-full-name))) |
| 2081 | "Select connection parameters and run ERC. | 2088 | "Select connection parameters and run ERC. |
| 2082 | Non-interactively, it takes keyword arguments | 2089 | Non-interactively, it takes keyword arguments |
| 2083 | (server (erc-compute-server)) | 2090 | (server (erc-compute-server)) |
| @@ -2088,7 +2095,7 @@ Non-interactively, it takes keyword arguments | |||
| 2088 | 2095 | ||
| 2089 | That is, if called with | 2096 | That is, if called with |
| 2090 | 2097 | ||
| 2091 | (erc-select :server \"irc.freenode.net\" :full-name \"Harry S Truman\") | 2098 | (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\") |
| 2092 | 2099 | ||
| 2093 | server and full-name will be set to those values, whereas | 2100 | server and full-name will be set to those values, whereas |
| 2094 | `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will | 2101 | `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will |
| @@ -2096,15 +2103,18 @@ be invoked for the values of the other parameters." | |||
| 2096 | (interactive (erc-select-read-args)) | 2103 | (interactive (erc-select-read-args)) |
| 2097 | 2104 | ||
| 2098 | (run-hook-with-args 'erc-before-connect server port nick) | 2105 | (run-hook-with-args 'erc-before-connect server port nick) |
| 2099 | (erc server port nick erc-user-full-name t password)) | 2106 | (erc-open server port nick full-name t password)) |
| 2100 | 2107 | ||
| 2108 | (defalias 'erc-select 'erc) | ||
| 2101 | 2109 | ||
| 2102 | (defun erc-select-ssl (&rest r) | 2110 | (defun erc-ssl (&rest r) |
| 2103 | "Interactively select SSL connection parameters and run ERC. | 2111 | "Interactively select SSL connection parameters and run ERC. |
| 2104 | Arguments are as to erc-select." | 2112 | Arguments are the same as for `erc'." |
| 2105 | (interactive (erc-select-read-args)) | 2113 | (interactive (erc-select-read-args)) |
| 2106 | (let ((erc-server-connect-function 'erc-open-ssl-stream)) | 2114 | (let ((erc-server-connect-function 'erc-open-ssl-stream)) |
| 2107 | (apply 'erc-select r))) | 2115 | (apply 'erc r))) |
| 2116 | |||
| 2117 | (defalias 'erc-select-ssl 'erc-ssl) | ||
| 2108 | 2118 | ||
| 2109 | (defun erc-open-ssl-stream (name buffer host port) | 2119 | (defun erc-open-ssl-stream (name buffer host port) |
| 2110 | "Open an SSL stream to an IRC server. | 2120 | "Open an SSL stream to an IRC server. |
| @@ -2321,9 +2331,8 @@ If STRING is nil, the function does nothing." | |||
| 2321 | ((listp buffer) buffer) | 2331 | ((listp buffer) buffer) |
| 2322 | ((processp buffer) (list (process-buffer buffer))) | 2332 | ((processp buffer) (list (process-buffer buffer))) |
| 2323 | ((eq 'all buffer) | 2333 | ((eq 'all buffer) |
| 2324 | (and (boundp 'erc-server-process) | 2334 | ;; Hmm, or all of the same session server? |
| 2325 | ;; Hmm, or all of the same session server? | 2335 | (erc-buffer-list nil erc-server-process)) |
| 2326 | (erc-buffer-list nil erc-server-process))) | ||
| 2327 | ((and (eq 'active buffer) (erc-active-buffer)) | 2336 | ((and (eq 'active buffer) (erc-active-buffer)) |
| 2328 | (list (erc-active-buffer))) | 2337 | (list (erc-active-buffer))) |
| 2329 | ((erc-server-buffer-live-p) | 2338 | ((erc-server-buffer-live-p) |
| @@ -2536,7 +2545,11 @@ therefore has to contain the command itself as well." | |||
| 2536 | "Ignore USER. This should be a regexp matching nick!user@host. | 2545 | "Ignore USER. This should be a regexp matching nick!user@host. |
| 2537 | If no USER argument is specified, list the contents of `erc-ignore-list'." | 2546 | If no USER argument is specified, list the contents of `erc-ignore-list'." |
| 2538 | (if user | 2547 | (if user |
| 2539 | (progn | 2548 | (let ((quoted (regexp-quote user))) |
| 2549 | (when (and (not (string= user quoted)) | ||
| 2550 | (y-or-n-p (format "Use regexp-quoted form (%s) instead? " | ||
| 2551 | quoted))) | ||
| 2552 | (setq user quoted)) | ||
| 2540 | (erc-display-line | 2553 | (erc-display-line |
| 2541 | (erc-make-notice (format "Now ignoring %s" user)) | 2554 | (erc-make-notice (format "Now ignoring %s" user)) |
| 2542 | 'active) | 2555 | 'active) |
| @@ -2554,16 +2567,22 @@ If no USER argument is specified, list the contents of `erc-ignore-list'." | |||
| 2554 | (defun erc-cmd-UNIGNORE (user) | 2567 | (defun erc-cmd-UNIGNORE (user) |
| 2555 | "Remove the user specified in USER from the ignore list." | 2568 | "Remove the user specified in USER from the ignore list." |
| 2556 | (let ((ignored-nick (car (with-current-buffer (erc-server-buffer) | 2569 | (let ((ignored-nick (car (with-current-buffer (erc-server-buffer) |
| 2557 | (erc-member-ignore-case user erc-ignore-list))))) | 2570 | (erc-member-ignore-case (regexp-quote user) |
| 2558 | (if (null ignored-nick) | 2571 | erc-ignore-list))))) |
| 2572 | (unless ignored-nick | ||
| 2573 | (if (setq ignored-nick (erc-ignored-user-p user)) | ||
| 2574 | (unless (y-or-n-p (format "Remove this regexp (%s)? " | ||
| 2575 | ignored-nick)) | ||
| 2576 | (setq ignored-nick nil)) | ||
| 2559 | (erc-display-line | 2577 | (erc-display-line |
| 2560 | (erc-make-notice (format "%s is not currently ignored!" user)) | 2578 | (erc-make-notice (format "%s is not currently ignored!" user)) |
| 2561 | 'active) | 2579 | 'active))) |
| 2580 | (when ignored-nick | ||
| 2562 | (erc-display-line | 2581 | (erc-display-line |
| 2563 | (erc-make-notice (format "No longer ignoring %s" user)) | 2582 | (erc-make-notice (format "No longer ignoring %s" user)) |
| 2564 | 'active)) | 2583 | 'active) |
| 2565 | (with-current-buffer (erc-server-buffer) | 2584 | (with-current-buffer (erc-server-buffer) |
| 2566 | (setq erc-ignore-list (delete ignored-nick erc-ignore-list)))) | 2585 | (setq erc-ignore-list (delete ignored-nick erc-ignore-list))))) |
| 2567 | t) | 2586 | t) |
| 2568 | 2587 | ||
| 2569 | (defun erc-cmd-CLEAR () | 2588 | (defun erc-cmd-CLEAR () |
| @@ -3149,7 +3168,7 @@ the message given by REASON." | |||
| 3149 | "Connect to SERVER, leaving existing connection intact." | 3168 | "Connect to SERVER, leaving existing connection intact." |
| 3150 | (erc-log (format "cmd: SERVER: %s" server)) | 3169 | (erc-log (format "cmd: SERVER: %s" server)) |
| 3151 | (condition-case nil | 3170 | (condition-case nil |
| 3152 | (erc-select :server server :nick (erc-current-nick)) | 3171 | (erc :server server :nick (erc-current-nick)) |
| 3153 | (error | 3172 | (error |
| 3154 | (message "Cannot find host %s." server) | 3173 | (message "Cannot find host %s." server) |
| 3155 | (beep))) | 3174 | (beep))) |
| @@ -3534,9 +3553,8 @@ If `point' is at the beginning of a channel name, use that as default." | |||
| 3534 | (list | 3553 | (list |
| 3535 | (if (and (boundp 'reason) (stringp reason) (not (string= reason ""))) | 3554 | (if (and (boundp 'reason) (stringp reason) (not (string= reason ""))) |
| 3536 | reason | 3555 | reason |
| 3537 | (read-from-minibuffer (concat "Leave " (erc-default-target) | 3556 | (read-from-minibuffer (concat "Reason for leaving " (erc-default-target) |
| 3538 | ", Reason? ") | 3557 | ": "))))) |
| 3539 | (cons "No reason" 0))))) | ||
| 3540 | (erc-cmd-PART (concat (erc-default-target)" " reason))) | 3558 | (erc-cmd-PART (concat (erc-default-target)" " reason))) |
| 3541 | 3559 | ||
| 3542 | (defun erc-set-topic (topic) | 3560 | (defun erc-set-topic (topic) |
| @@ -3666,15 +3684,15 @@ To change how this query window is displayed, use `let' to bind | |||
| 3666 | (buffer-live-p server) | 3684 | (buffer-live-p server) |
| 3667 | (set-buffer server)) | 3685 | (set-buffer server)) |
| 3668 | (error "Couldn't switch to server buffer")) | 3686 | (error "Couldn't switch to server buffer")) |
| 3669 | (let ((buf (erc erc-session-server | 3687 | (let ((buf (erc-open erc-session-server |
| 3670 | erc-session-port | 3688 | erc-session-port |
| 3671 | (erc-current-nick) | 3689 | (erc-current-nick) |
| 3672 | erc-session-user-full-name | 3690 | erc-session-user-full-name |
| 3673 | nil | 3691 | nil |
| 3674 | nil | 3692 | nil |
| 3675 | (list target) | 3693 | (list target) |
| 3676 | target | 3694 | target |
| 3677 | erc-server-process))) | 3695 | erc-server-process))) |
| 3678 | (unless buf | 3696 | (unless buf |
| 3679 | (error "Couldn't open query window")) | 3697 | (error "Couldn't open query window")) |
| 3680 | (erc-update-mode-line) | 3698 | (erc-update-mode-line) |
| @@ -3846,22 +3864,19 @@ and as second argument the event parsed as a vector." | |||
| 3846 | :type 'function) | 3864 | :type 'function) |
| 3847 | 3865 | ||
| 3848 | (defun erc-format-nick (&optional user channel-data) | 3866 | (defun erc-format-nick (&optional user channel-data) |
| 3849 | "Standard nickname formatting function. Only returns the value | 3867 | "Return the nickname of USER. |
| 3850 | of NICK." | 3868 | See also `erc-format-nick-function'." |
| 3851 | (if user | 3869 | (when user (erc-server-user-nickname user))) |
| 3852 | (erc-server-user-nickname user))) | ||
| 3853 | 3870 | ||
| 3854 | (defun erc-format-@nick (&optional user channel-data) | 3871 | (defun erc-format-@nick (&optional user channel-data) |
| 3855 | "Format a nickname such that @ or + are prefix for the NICK | 3872 | "Format the nickname of USER showing if USER is an operator or has voice. |
| 3856 | if OP or VOICE are t respectively." | 3873 | Operators have \"@\" and users with voice have \"+\" as a prefix. |
| 3857 | (if user | 3874 | Use CHANNEL-DATA to determine op and voice status. |
| 3858 | (let (op voice) | 3875 | See also `erc-format-nick-function'." |
| 3859 | (if channel-data | 3876 | (when user |
| 3860 | (setq op (erc-channel-user-op channel-data) | 3877 | (let ((op (and channel-data (erc-channel-user-op channel-data) "@")) |
| 3861 | voice (erc-channel-user-voice channel-data))) | 3878 | (voice (and channel-data (erc-channel-user-voice channel-data) "+"))) |
| 3862 | (concat (if voice "+" "") | 3879 | (concat voice op (erc-server-user-nickname user))))) |
| 3863 | (if op "@" "") | ||
| 3864 | (erc-server-user-nickname user))))) | ||
| 3865 | 3880 | ||
| 3866 | (defun erc-format-my-nick () | 3881 | (defun erc-format-my-nick () |
| 3867 | "Return the beginning of this user's message, correctly propertized" | 3882 | "Return the beginning of this user's message, correctly propertized" |
| @@ -3871,7 +3886,7 @@ if OP or VOICE are t respectively." | |||
| 3871 | (nick (erc-current-nick))) | 3886 | (nick (erc-current-nick))) |
| 3872 | (concat | 3887 | (concat |
| 3873 | (erc-propertize open 'face 'erc-default-face) | 3888 | (erc-propertize open 'face 'erc-default-face) |
| 3874 | (erc-propertize nick 'face 'erc-nick-default-face) | 3889 | (erc-propertize nick 'face 'erc-my-nick-face) |
| 3875 | (erc-propertize close 'face 'erc-default-face))) | 3890 | (erc-propertize close 'face 'erc-default-face))) |
| 3876 | (let ((prefix "> ")) | 3891 | (let ((prefix "> ")) |
| 3877 | (erc-propertize prefix 'face 'erc-default-face)))) | 3892 | (erc-propertize prefix 'face 'erc-default-face)))) |
| @@ -4548,7 +4563,7 @@ TOPIC string to the current topic." | |||
| 4548 | ;; list of triples: (mode-char 'on/'off argument) | 4563 | ;; list of triples: (mode-char 'on/'off argument) |
| 4549 | (arg-modes (nth 2 modes))) | 4564 | (arg-modes (nth 2 modes))) |
| 4550 | (cond ((erc-channel-p tgt); channel modes | 4565 | (cond ((erc-channel-p tgt); channel modes |
| 4551 | (let ((buf (and (boundp 'erc-server-process) erc-server-process | 4566 | (let ((buf (and erc-server-process |
| 4552 | (erc-get-buffer tgt erc-server-process)))) | 4567 | (erc-get-buffer tgt erc-server-process)))) |
| 4553 | (when buf | 4568 | (when buf |
| 4554 | (with-current-buffer buf | 4569 | (with-current-buffer buf |
| @@ -4640,7 +4655,7 @@ person who changed the modes." | |||
| 4640 | (arg-modes (nth 2 modes))) | 4655 | (arg-modes (nth 2 modes))) |
| 4641 | ;; now parse the modes changes and do the updates | 4656 | ;; now parse the modes changes and do the updates |
| 4642 | (cond ((erc-channel-p tgt); channel modes | 4657 | (cond ((erc-channel-p tgt); channel modes |
| 4643 | (let ((buf (and (boundp 'erc-server-process) erc-server-process | 4658 | (let ((buf (and erc-server-process |
| 4644 | (erc-get-buffer tgt erc-server-process)))) | 4659 | (erc-get-buffer tgt erc-server-process)))) |
| 4645 | (when buf | 4660 | (when buf |
| 4646 | ;; FIXME! This used to have an original buffer | 4661 | ;; FIXME! This used to have an original buffer |
| @@ -5059,10 +5074,10 @@ The previous default target of QUERY type gets removed" | |||
| 5059 | Takes a full SPEC of a user in the form \"nick!login@host\", and | 5074 | Takes a full SPEC of a user in the form \"nick!login@host\", and |
| 5060 | matches against all the regexp's in `erc-ignore-list'. If any | 5075 | matches against all the regexp's in `erc-ignore-list'. If any |
| 5061 | match, returns that regexp." | 5076 | match, returns that regexp." |
| 5062 | (dolist (ignored (with-current-buffer (erc-server-buffer) erc-ignore-list)) | 5077 | (catch 'found |
| 5063 | (if (string-match ignored spec) | 5078 | (dolist (ignored (with-current-buffer (erc-server-buffer) erc-ignore-list)) |
| 5064 | ;; We have `require'd cl, so we can return from the block named nil | 5079 | (if (string-match ignored spec) |
| 5065 | (return ignored)))) | 5080 | (throw 'found ignored))))) |
| 5066 | 5081 | ||
| 5067 | (defun erc-ignored-reply-p (msg tgt proc) | 5082 | (defun erc-ignored-reply-p (msg tgt proc) |
| 5068 | ;; FIXME: this docstring needs fixing -- Lawrence 2004-01-08 | 5083 | ;; FIXME: this docstring needs fixing -- Lawrence 2004-01-08 |
| @@ -5418,7 +5433,7 @@ Sets the buffer local variables: | |||
| 5418 | This tries a number of increasingly more default methods until a | 5433 | This tries a number of increasingly more default methods until a |
| 5419 | non-nil value is found. | 5434 | non-nil value is found. |
| 5420 | 5435 | ||
| 5421 | - SERVER (the argument passwd to this function) | 5436 | - SERVER (the argument passed to this function) |
| 5422 | - The `erc-server' option | 5437 | - The `erc-server' option |
| 5423 | - The value of the IRCSERVER environment variable | 5438 | - The value of the IRCSERVER environment variable |
| 5424 | - The `erc-default-server' variable" | 5439 | - The `erc-default-server' variable" |
| @@ -5833,10 +5848,12 @@ P may be an integer or a service name." | |||
| 5833 | 5848 | ||
| 5834 | (defun erc-string-to-port (s) | 5849 | (defun erc-string-to-port (s) |
| 5835 | "Convert string S to either an integer port number or a service name." | 5850 | "Convert string S to either an integer port number or a service name." |
| 5836 | (let ((n (string-to-number s))) | 5851 | (if (numberp s) |
| 5837 | (if (= n 0) | 5852 | s |
| 5838 | s | 5853 | (let ((n (string-to-number s))) |
| 5839 | n))) | 5854 | (if (= n 0) |
| 5855 | s | ||
| 5856 | n)))) | ||
| 5840 | 5857 | ||
| 5841 | (defun erc-version (&optional here) | 5858 | (defun erc-version (&optional here) |
| 5842 | "Show the version number of ERC in the minibuffer. | 5859 | "Show the version number of ERC in the minibuffer. |
| @@ -5886,8 +5903,8 @@ If optional argument HERE is non-nil, insert version number at point." | |||
| 5886 | 5903 | ||
| 5887 | All windows are opened in the current frame." | 5904 | All windows are opened in the current frame." |
| 5888 | (interactive) | 5905 | (interactive) |
| 5889 | (unless (boundp 'erc-server-process) | 5906 | (unless erc-server-process |
| 5890 | (error "No erc-process found in current buffer")) | 5907 | (error "No erc-server-process found in current buffer")) |
| 5891 | (let ((bufs (erc-buffer-list nil erc-server-process))) | 5908 | (let ((bufs (erc-buffer-list nil erc-server-process))) |
| 5892 | (when bufs | 5909 | (when bufs |
| 5893 | (delete-other-windows) | 5910 | (delete-other-windows) |
| @@ -6019,7 +6036,8 @@ All windows are opened in the current frame." | |||
| 6019 | (s341 . "Inviting %n to channel %c") | 6036 | (s341 . "Inviting %n to channel %c") |
| 6020 | (s352 . "%-11c %-10n %-4a %u@%h (%f)") | 6037 | (s352 . "%-11c %-10n %-4a %u@%h (%f)") |
| 6021 | (s353 . "Users on %c: %u") | 6038 | (s353 . "Users on %c: %u") |
| 6022 | (s367 . "Ban on %b on %c set by %s on %t (Use /banlist!)") | 6039 | (s367 . "Ban for %b on %c") |
| 6040 | (s367-set-by . "Ban for %b on %c set by %s on %t") | ||
| 6023 | (s368 . "Banlist of %c ends.") | 6041 | (s368 . "Banlist of %c ends.") |
| 6024 | (s379 . "%c: Forwarded to %f") | 6042 | (s379 . "%c: Forwarded to %f") |
| 6025 | (s391 . "The time at %s is %t") | 6043 | (s391 . "The time at %s is %t") |
| @@ -6194,10 +6212,10 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL." | |||
| 6194 | (with-current-buffer (or server-buffer (current-buffer)) | 6212 | (with-current-buffer (or server-buffer (current-buffer)) |
| 6195 | (if (and server-buffer channel) | 6213 | (if (and server-buffer channel) |
| 6196 | (erc-cmd-JOIN channel) | 6214 | (erc-cmd-JOIN channel) |
| 6197 | (erc host port (or user (erc-compute-nick)) (erc-compute-full-name) | 6215 | (erc-open host port (or user (erc-compute-nick)) (erc-compute-full-name) |
| 6198 | (not server-buffer) password nil channel | 6216 | (not server-buffer) password nil channel |
| 6199 | (when server-buffer | 6217 | (when server-buffer |
| 6200 | (get-buffer-process server-buffer))))))) | 6218 | (get-buffer-process server-buffer))))))) |
| 6201 | 6219 | ||
| 6202 | (provide 'erc) | 6220 | (provide 'erc) |
| 6203 | 6221 | ||
diff --git a/man/ChangeLog b/man/ChangeLog index 80f018955bd..c03f678bf1a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-11-20 Michael Olson <mwolson@gnu.org> | ||
| 2 | |||
| 3 | * erc.texi: Call this the 5.2 stable pre-release of ERC. | ||
| 4 | |||
| 1 | 2006-11-18 Chong Yidong <cyd@stupidchicken.com> | 5 | 2006-11-18 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 6 | ||
| 3 | * misc.texi (Interactive Shell): INSIDE_EMACS is set to t, | 7 | * misc.texi (Interactive Shell): INSIDE_EMACS is set to t, |
diff --git a/man/erc.texi b/man/erc.texi index c4317f11511..0d535eae875 100644 --- a/man/erc.texi +++ b/man/erc.texi | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | @syncodeindex fn cp | 12 | @syncodeindex fn cp |
| 13 | 13 | ||
| 14 | @copying | 14 | @copying |
| 15 | This manual is for ERC version 5.1.4. | 15 | This manual is for ERC version 5.2 stable pre-release. |
| 16 | 16 | ||
| 17 | Copyright @copyright{} 2005, 2006 Free Software Foundation, Inc. | 17 | Copyright @copyright{} 2005, 2006 Free Software Foundation, Inc. |
| 18 | 18 | ||
| @@ -271,7 +271,7 @@ itself. An example follows. | |||
| 271 | (require 'erc) | 271 | (require 'erc) |
| 272 | @end lisp | 272 | @end lisp |
| 273 | 273 | ||
| 274 | Once ERC is loaded, the command @kbd{M-x erc-select} will start ERC and | 274 | Once ERC is loaded, the command @kbd{M-x erc} will start ERC and |
| 275 | prompt for the server to connect to. | 275 | prompt for the server to connect to. |
| 276 | 276 | ||
| 277 | @c PRE5_2: Sample session, including: | 277 | @c PRE5_2: Sample session, including: |
| @@ -520,11 +520,11 @@ Translate morse code in messages | |||
| 520 | @section Connecting to an IRC Server | 520 | @section Connecting to an IRC Server |
| 521 | @cindex connecting | 521 | @cindex connecting |
| 522 | 522 | ||
| 523 | The easiest way to connect to an IRC server is to call | 523 | The easiest way to connect to an IRC server is to call @kbd{M-x erc}. |
| 524 | @kbd{M-x erc-select}. If you want to assign this function to a | 524 | If you want to assign this function to a keystroke, the following will |
| 525 | keystroke, the following will help you figure out its parameters. | 525 | help you figure out its parameters. |
| 526 | 526 | ||
| 527 | @defun erc-select | 527 | @defun erc |
| 528 | Select connection parameters and run ERC. | 528 | Select connection parameters and run ERC. |
| 529 | Non-interactively, it takes the following keyword arguments. | 529 | Non-interactively, it takes the following keyword arguments. |
| 530 | 530 | ||
| @@ -543,7 +543,7 @@ That is, if called with the following arguments, @var{server} and | |||
| 543 | parameters. | 543 | parameters. |
| 544 | 544 | ||
| 545 | @example | 545 | @example |
| 546 | (erc-select :server "irc.freenode.net" :full-name "Harry S Truman") | 546 | (erc :server "irc.freenode.net" :full-name "Harry S Truman") |
| 547 | @end example | 547 | @end example |
| 548 | @end defun | 548 | @end defun |
| 549 | 549 | ||