aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog170
-rw-r--r--lisp/erc/ChangeLog.012
-rw-r--r--lisp/erc/ChangeLog.022
-rw-r--r--lisp/erc/ChangeLog.032
-rw-r--r--lisp/erc/ChangeLog.042
-rw-r--r--lisp/erc/ChangeLog.052
-rw-r--r--lisp/erc/erc-autoaway.el2
-rw-r--r--lisp/erc/erc-backend.el6
-rw-r--r--lisp/erc/erc-button.el2
-rw-r--r--lisp/erc/erc-capab.el202
-rw-r--r--lisp/erc/erc-compat.el2
-rw-r--r--lisp/erc/erc-dcc.el48
-rw-r--r--lisp/erc/erc-ezbounce.el2
-rw-r--r--lisp/erc/erc-fill.el2
-rw-r--r--lisp/erc/erc-goodies.el2
-rw-r--r--lisp/erc/erc-hecomplete.el2
-rw-r--r--lisp/erc/erc-ibuffer.el2
-rw-r--r--lisp/erc/erc-identd.el2
-rw-r--r--lisp/erc/erc-imenu.el2
-rw-r--r--lisp/erc/erc-join.el2
-rw-r--r--lisp/erc/erc-lang.el2
-rw-r--r--lisp/erc/erc-log.el2
-rw-r--r--lisp/erc/erc-match.el2
-rw-r--r--lisp/erc/erc-menu.el120
-rw-r--r--lisp/erc/erc-netsplit.el2
-rw-r--r--lisp/erc/erc-networks.el2
-rw-r--r--lisp/erc/erc-nicklist.el2
-rw-r--r--lisp/erc/erc-notify.el2
-rw-r--r--lisp/erc/erc-page.el2
-rw-r--r--lisp/erc/erc-pcomplete.el2
-rw-r--r--lisp/erc/erc-replace.el2
-rw-r--r--lisp/erc/erc-ring.el2
-rw-r--r--lisp/erc/erc-services.el94
-rw-r--r--lisp/erc/erc-sound.el2
-rw-r--r--lisp/erc/erc-speedbar.el2
-rw-r--r--lisp/erc/erc-spelling.el2
-rw-r--r--lisp/erc/erc-stamp.el2
-rw-r--r--lisp/erc/erc-track.el6
-rw-r--r--lisp/erc/erc-truncate.el2
-rw-r--r--lisp/erc/erc-xdcc.el2
-rw-r--r--lisp/erc/erc.el113
41 files changed, 646 insertions, 179 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index fa087fb513f..f47e7d798c5 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,94 @@
12007-01-13 Michael Olson <mwolson@gnu.org>
2
3 * erc.el (erc-command-regexp): New variable that is used to match
4 a command.
5 (erc-send-input): Use it. This fixes a bug where paths --
6 "/usr/bin/foo", for example -- were being displayed as commands,
7 but still sent correctly.
8 (erc-extract-command-from-line): Use it.
9
10 * erc.texi (Modules): Document erc-capab-identify.
11
122007-01-11 Diane Murray <disumu@x3y2z1.net>
13
14 * erc.el (erc-find-parsed-property): Moved here from erc-track.el
15 since it can be useful in general.
16
17 * erc-track.el (erc-find-parsed-property): Removed.
18
19 * erc-capab.el (erc-capab-find-parsed): Removed.
20 (erc-capab-identify-add-prefix): Use `erc-find-parsed-property'.
21
22 * erc.el (erc-open): Run `erc-before-connect' hook here. This
23 makes sure the hook always gets called before a connection is
24 made, as some functions, like `erc-handle-irc-url', use `erc-open'
25 instead of `erc'.
26 (erc): Removed `erc-before-connect' hook.
27
28 * erc-menu.el (erc-menu-definition): Put items specific to
29 channels in a "Current channel" submenu.
30
31 * erc-backend.el (321, 323): Display channel list in server buffer
32 when not using the channel list module.
33
34 * erc.el: Updated copyright years.
35 (erc-version-string): Set to 5.2 (devel).
36 (erc-format-lag-time): Fixed to work when `erc-server-lag' is nil.
37 (erc-update-mode-line-buffer): Set the header face.
38
392007-01-11 Michael Olson <mwolson@gnu.org>
40
41 * erc-bbdb.el (erc-bbdb-popup-type): Fix customization type and
42 documentation.
43
44 * erc-services.el (erc-nickserv-identify-mode): Improve
45 documentation for nick-change option and move higher to fix
46 compiler warning. Avoid a recursive load error.
47 (erc-nickserv-alist): Add simple entry for BitlBee, to avoid
48 "NickServ is AWAY: User is offline" error. Oddly enough, bitlbee
49 was smart enough to recognize that as an authentication request
50 and log in regardless, which is why I didn't notice this earlier.
51 (erc-nickserv-alist-sender, erc-nickserv-alist-regexp)
52 (erc-nickserv-alist-nickserv, erc-nickserv-alist-ident-keyword)
53 (erc-nickserv-alist-use-nick-p)
54 (erc-nickserv-alist-ident-command): New accessors for
55 erc-nickserv-alist. Using nth is unwieldy.
56 (erc-nickserv-identify-autodetect)
57 (erc-nickserv-identify-on-connect)
58 (erc-nickserv-identify-on-nick-change, erc-nickserv-identify): Use
59 the new accessors.
60
612007-01-11 Diane Murray <disumu@x3y2z1.net>
62
63 * NEWS: Added note for `erc-my-nick-face'. Fixed capab-identify
64 wording.
65
662007-01-10 Diane Murray <disumu@x3y2z1.net>
67
68 * erc.el (erc-mode-line-format): Added %l to documentation.
69 (erc-header-line-format): Removed "[IRC]". Use the new %l
70 replacement character. Doc fix.
71 (erc-format-channel-modes): Removed lag code. Removed parentheses
72 from mode string.
73 (erc-format-lag-time): New function.
74 (erc-update-mode-line-buffer): Use it.
75
762007-01-09 Michael Olson <mwolson@gnu.org>
77
78 * erc.el (erc-system-name): New option that determines the system
79 name to use when logging in. The default is to figure this out by
80 calling `system-name'.
81 (erc-login): Use it.
82
832007-01-07 Michael Olson <mwolson@gnu.org>
84
85 * erc.el (erc-modules): Add the menu module. This should fix a
86 bug with incorrect ERC submenus being displayed.
87
88 * erc-menu.el: Turn this into a module.
89 (erc-menu-add, erc-menu-remove): New functions that add and remove
90 the ERC menu.
91
12006-12-28 Michael Olson <mwolson@gnu.org> 922006-12-28 Michael Olson <mwolson@gnu.org>
2 93
3 * erc-list.el: Change header to mention that this is part of ERC, 94 * erc-list.el: Change header to mention that this is part of ERC,
@@ -296,6 +387,16 @@
296 (erc-make-mode-line-buffer-name): Add help-echo and mouse-face 387 (erc-make-mode-line-buffer-name): Add help-echo and mouse-face
297 properties to channel name. 388 properties to channel name.
298 389
3902006-08-20 Michael Olson <mwolson@gnu.org>
391
392 * erc.el (erc-with-server-buffer): New macro that switches to the
393 current ERC server buffer and runs some code. If no server buffer
394 is available, return nil. This is a useful way to access
395 variables in the server buffer.
396 (erc-open-server-buffer-p): New function that returns non-nil if
397 the given buffer is an ERC server buffer that has an open IRC
398 process.
399
2992006-08-14 Diane Murray <disumu@x3y2z1.net> 4002006-08-14 Diane Murray <disumu@x3y2z1.net>
300 401
301 * erc-menu.el: Updated copyright years. Removed EmacsWiki URL. 402 * erc-menu.el: Updated copyright years. Removed EmacsWiki URL.
@@ -645,8 +746,30 @@
645 <C-tab> for `erc-button-previous' as it is a more standard key 746 <C-tab> for `erc-button-previous' as it is a more standard key
646 binding for this type of function. 747 binding for this type of function.
647 748
7492006-02-28 Diane Murray <disumu@x3y2z1.net>
750
751 * erc-capab.el: Removed things that were accidentally committed on
752 2006-02-20. Removed Todo section.
753 (erc-capab-unidentified): Removed.
754
7552006-02-26 Michael Olson <mwolson@gnu.org>
756
757 * erc-capab.el: Use (eval-when-compile (require 'cl)).
758 (erc-capab-unidentified): Fix compiler warning by specifying
759 group.
760
7612006-02-20 Diane Murray <disumu@x3y2z1.net>
762
763 * erc-capab.el (erc-capab-send-identify-messages): Fixed comment
764 to explain thoughts better. `erc-server-parameters' is an
765 associated list when it's set, not a string.
766
6482006-02-19 Michael Olson <mwolson@gnu.org> 7672006-02-19 Michael Olson <mwolson@gnu.org>
649 768
769 * erc-capab.el (erc-capab-send-identify-messages): Make sure some
770 parameters are strings before using them. Thanks to Alejandro
771 Benitez for the report.
772
650 * erc.el (erc-version-string): Release ERC 5.1.2. 773 * erc.el (erc-version-string): Release ERC 5.1.2.
651 774
6522006-02-19 Diane Murray <disumu@x3y2z1.net> 7752006-02-19 Diane Murray <disumu@x3y2z1.net>
@@ -696,8 +819,13 @@
696 819
6972006-02-11 Michael Olson <mwolson@gnu.org> 8202006-02-11 Michael Olson <mwolson@gnu.org>
698 821
699 * erc.el (erc-update-modules): Make some requirements shorter, so 822 * erc.el (erc-update-modules): Handle erc-capab-identify
700 that it's easier to see why they are needed. 823 correctly. Make some requirements shorter, so that it's easier to
824 see why they are needed.
825
826 * erc-capab.el: Add autoload cookie for capab-identify.
827 (erc-capab-send-identify-messages, erc-capab-identify-activate):
828 Minor whitespace fix in code.
701 829
702 * erc-stamp.el (erc-timestamp-use-align-to): Renamed from 830 * erc-stamp.el (erc-timestamp-use-align-to): Renamed from
703 `erc-timestamp-right-align-by-pixel'. Set the default based on 831 `erc-timestamp-right-align-by-pixel'. Set the default based on
@@ -721,11 +849,21 @@
721 (erc-list-channels): Was `erc-cmd-LIST', renamed. 849 (erc-list-channels): Was `erc-cmd-LIST', renamed.
722 (erc-list-channels-simple): New function. 850 (erc-list-channels-simple): New function.
723 851
724 * erc.el (erc-modules): Added `list' to enabled modules. Moved 852 * erc.el (erc-modules): Added `list' to enabled modules. Changed
725 customization options left in source code. 853 `capab-identify' description. Moved customization options left in
854 source code.
726 855
727 * erc-menu.el (erc-menu-definition): Use `erc-list-channels'. 856 * erc-menu.el (erc-menu-definition): Use `erc-list-channels'.
728 857
858 * erc-capab.el: Put a little more detail into Usage section.
859 (define-erc-module): Run `erc-capab-identify-setup' in all open
860 server buffers when enabling.
861 (erc-capab-identify-setup): Make PROC and PARSED optional
862 arguments.
863 (erc-capab-identify-add-prefix): Simplified nickname regexp. This
864 should now also match nicknames that are formatted differently
865 than the default.
866
729 * erc-spelling.el (define-erc-module): Make sure there's a buffer 867 * erc-spelling.el (define-erc-module): Make sure there's a buffer
730 before calling `with-current-buffer'. 868 before calling `with-current-buffer'.
731 869
@@ -742,12 +880,34 @@
7422006-02-09 Diane Murray <disumu@x3y2z1.net> 8802006-02-09 Diane Murray <disumu@x3y2z1.net>
743 881
744 * erc.el (erc-get-parsed-vector, erc-get-parsed-vector-nick) 882 * erc.el (erc-get-parsed-vector, erc-get-parsed-vector-nick)
883 * erc-capab.el: Require erc.
884 (erc-capab-send-identify-messages): Use `erc-server-send'.
885 (erc-capab-identify-remove/set-identified-flag): Use 1 and 0 as
886 the flags so we can also check whether the `erc-identified' text
887 property is there at all.
888 (erc-capab-identify-add-prefix): Use `erc-capab-find-parsed'.
889 This fixes a bug where the prefix wasn't inserted when timestamps
890 are inserted on the right. Tweaked nickname regexp.
891 (erc-capab-find-parsed): New function.
892 (erc-capab-get-unidentified-nickname): Updated to check for 0
893 flag. Only get nickname if there's a nickuserhost associated with
894 this message.
895
896 * erc-capab.el: New file. Adds the new module
897 `erc-capab-identify', which allows flagging of unidentified users
898 on servers running an ircd based on dancer - irc.freenode.net, for
899 example.
900
901 * erc.el (erc-modules): Added `capab-identify' to options.
902 (erc-get-parsed-vector, erc-get-parsed-vector-nick)
745 (erc-get-parsed-vector-type): Moved here from erc-match.el. 903 (erc-get-parsed-vector-type): Moved here from erc-match.el.
746 904
747 * erc-match.el (erc-get-parsed-vector, erc-get-parsed-vector-nick) 905 * erc-match.el (erc-get-parsed-vector, erc-get-parsed-vector-nick)
748 (erc-get-parsed-vector-type): Moved these functions to erc.el 906 (erc-get-parsed-vector-type): Moved these functions to erc.el
749 since they can be useful outside of the text matching module. 907 since they can be useful outside of the text matching module.
750 908
909 * NEWS: Added erc-capab.el.
910
751 * erc-dcc.el, erc-stamp.el, erc-xdcc.el: Changed "Emacs IRC Client" 911 * erc-dcc.el, erc-stamp.el, erc-xdcc.el: Changed "Emacs IRC Client"
752 to "ERC". 912 to "ERC".
753 913
@@ -1182,7 +1342,7 @@
1182 1342
1183See ChangeLog.05 for earlier changes. 1343See ChangeLog.05 for earlier changes.
1184 1344
1185 Copyright (C) 2006 Free Software Foundation, Inc. 1345 Copyright (C) 2006, 2007 Free Software Foundation, Inc.
1186 Copying and distribution of this file, with or without modification, 1346 Copying and distribution of this file, with or without modification,
1187 are permitted provided the copyright notice and this notice are preserved. 1347 are permitted provided the copyright notice and this notice are preserved.
1188 1348
diff --git a/lisp/erc/ChangeLog.01 b/lisp/erc/ChangeLog.01
index 25f57569742..fd0be8bbb8f 100644
--- a/lisp/erc/ChangeLog.01
+++ b/lisp/erc/ChangeLog.01
@@ -1035,7 +1035,7 @@
1035 1035
1036 * erc-speak.el, erc.el: New file. 1036 * erc-speak.el, erc.el: New file.
1037 1037
1038 Copyright (C) 2001, 2006 Free Software Foundation, Inc. 1038 Copyright (C) 2001, 2006, 2007 Free Software Foundation, Inc.
1039 Copying and distribution of this file, with or without modification, 1039 Copying and distribution of this file, with or without modification,
1040 are permitted provided the copyright notice and this notice are preserved. 1040 are permitted provided the copyright notice and this notice are preserved.
1041 1041
diff --git a/lisp/erc/ChangeLog.02 b/lisp/erc/ChangeLog.02
index 332bd7fbfb9..eaa94c1c1ed 100644
--- a/lisp/erc/ChangeLog.02
+++ b/lisp/erc/ChangeLog.02
@@ -2596,7 +2596,7 @@
2596 2596
2597See ChangeLog.01 for earlier changes. 2597See ChangeLog.01 for earlier changes.
2598 2598
2599 Copyright (C) 2002, 2006 Free Software Foundation, Inc. 2599 Copyright (C) 2002, 2006, 2007 Free Software Foundation, Inc.
2600 Copying and distribution of this file, with or without modification, 2600 Copying and distribution of this file, with or without modification,
2601 are permitted provided the copyright notice and this notice are preserved. 2601 are permitted provided the copyright notice and this notice are preserved.
2602 2602
diff --git a/lisp/erc/ChangeLog.03 b/lisp/erc/ChangeLog.03
index 20f0f92f5e0..ed3b4e24b7b 100644
--- a/lisp/erc/ChangeLog.03
+++ b/lisp/erc/ChangeLog.03
@@ -2140,7 +2140,7 @@
2140 2140
2141See ChangeLog.02 for earlier changes. 2141See ChangeLog.02 for earlier changes.
2142 2142
2143 Copyright (C) 2003, 2006 Free Software Foundation, Inc. 2143 Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
2144 Copying and distribution of this file, with or without modification, 2144 Copying and distribution of this file, with or without modification,
2145 are permitted provided the copyright notice and this notice are preserved. 2145 are permitted provided the copyright notice and this notice are preserved.
2146 2146
diff --git a/lisp/erc/ChangeLog.04 b/lisp/erc/ChangeLog.04
index c5338a311c9..61af66db2ad 100644
--- a/lisp/erc/ChangeLog.04
+++ b/lisp/erc/ChangeLog.04
@@ -2069,7 +2069,7 @@
2069 2069
2070See ChangeLog.03 for earlier changes. 2070See ChangeLog.03 for earlier changes.
2071 2071
2072 Copyright (C) 2004, 2006 Free Software Foundation, Inc. 2072 Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
2073 Copying and distribution of this file, with or without modification, 2073 Copying and distribution of this file, with or without modification,
2074 are permitted provided the copyright notice and this notice are preserved. 2074 are permitted provided the copyright notice and this notice are preserved.
2075 2075
diff --git a/lisp/erc/ChangeLog.05 b/lisp/erc/ChangeLog.05
index a640aba00a1..6f3207bb475 100644
--- a/lisp/erc/ChangeLog.05
+++ b/lisp/erc/ChangeLog.05
@@ -1217,7 +1217,7 @@
1217 1217
1218See ChangeLog.04 for earlier changes. 1218See ChangeLog.04 for earlier changes.
1219 1219
1220 Copyright (C) 2005, 2006 Free Software Foundation, Inc. 1220 Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
1221 Copying and distribution of this file, with or without modification, 1221 Copying and distribution of this file, with or without modification,
1222 are permitted provided the copyright notice and this notice are preserved. 1222 are permitted provided the copyright notice and this notice are preserved.
1223 1223
diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el
index dcb6bc0756e..9d90d0ae5e9 100644
--- a/lisp/erc/erc-autoaway.el
+++ b/lisp/erc/erc-autoaway.el
@@ -1,6 +1,6 @@
1;;; erc-autoaway.el --- Provides autoaway for ERC 1;;; erc-autoaway.el --- Provides autoaway for ERC
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Jorgen Schaefer <forcer@forcix.cx> 5;; Author: Jorgen Schaefer <forcer@forcix.cx>
6;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway 6;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index c589ae282a6..fbe6f22e1d6 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1,6 +1,6 @@
1;;; erc-backend.el --- Backend network communication for ERC 1;;; erc-backend.el --- Backend network communication for ERC
2 2
3;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Filename: erc-backend.el 5;; Filename: erc-backend.el
6;; Author: Lawrence Mitchell <wence@gmx.li> 6;; Author: Lawrence Mitchell <wence@gmx.li>
@@ -1535,7 +1535,7 @@ See `erc-display-server-message'." nil
1535(define-erc-response-handler (321) 1535(define-erc-response-handler (321)
1536 "LIST header." nil 1536 "LIST header." nil
1537 (setq erc-channel-list nil) 1537 (setq erc-channel-list nil)
1538 (erc-display-message parsed 'notice 'active 's321)) 1538 (erc-display-message parsed 'notice proc 's321))
1539 1539
1540(define-erc-response-handler (322) 1540(define-erc-response-handler (322)
1541 "LIST notice." nil 1541 "LIST notice." nil
@@ -1545,7 +1545,7 @@ See `erc-display-server-message'." nil
1545 (add-to-list 'erc-channel-list (list channel)) 1545 (add-to-list 'erc-channel-list (list channel))
1546 (erc-update-channel-topic channel topic) 1546 (erc-update-channel-topic channel topic)
1547 (erc-display-message 1547 (erc-display-message
1548 parsed 'notice 'active 's322 1548 parsed 'notice proc 's322
1549 ?c channel ?u num-users ?t (or topic ""))))) 1549 ?c channel ?u num-users ?t (or topic "")))))
1550 1550
1551(define-erc-response-handler (324) 1551(define-erc-response-handler (324)
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index 13e2a384735..1fd224fb956 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -1,7 +1,7 @@
1;; erc-button.el --- A way of buttonizing certain things in ERC buffers 1;; erc-button.el --- A way of buttonizing certain things in ERC buffers
2 2
3;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4;; 2006 Free Software Foundation, Inc. 4;; 2006, 2007 Free Software Foundation, Inc.
5 5
6;; Author: Mario Lang <mlang@delysid.org> 6;; Author: Mario Lang <mlang@delysid.org>
7;; Keywords: irc, button, url, regexp 7;; Keywords: irc, button, url, regexp
diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el
new file mode 100644
index 00000000000..268c4bfe68a
--- /dev/null
+++ b/lisp/erc/erc-capab.el
@@ -0,0 +1,202 @@
1;;; erc-capab.el --- support for dancer-ircd and hyperion's CAPAB
2
3;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
4
5;; GNU Emacs is free software; you can redistribute it and/or modify
6;; it under the terms of the GNU General Public License as published by
7;; the Free Software Foundation; either version 2, or (at your option)
8;; any later version.
9
10;; GNU Emacs is distributed in the hope that it will be useful,
11;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13;; GNU General Public License for more details.
14
15;; You should have received a copy of the GNU General Public License
16;; along with GNU Emacs; see the file COPYING. If not, write to the
17;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18;; Boston, MA 02110-1301, USA.
19
20;;; Commentary:
21
22;; This file defines the ERC module `erc-capab-identify', which allows
23;; flagging of unidentified users on servers running dancer-ircd or
24;; hyperion. freenode.net supports this capability, for example.
25
26;; With CAPAB IDENTIFY-MSG and IDENTIFY-CTCP enabled, messages from
27;; users who have identified themselves to NickServ will have a plus
28;; sign and messages from unidentified users will have a minus sign
29;; added as a prefix. Note that it is not necessary for your nickname
30;; to be identified in order to receive these marked messages.
31
32;; The plus or minus sign is removed from the message, and a prefix,
33;; `erc-capab-identify-prefix', is inserted in the front of the user's
34;; nickname if the nickname is not identified.
35
36;; Please note that once this has been enabled on a server, there is no
37;; way to tell the server to stop sending marked messages. If you
38;; disable this module, it will continue removing message flags, but the
39;; unidentified nickname prefix will not be added to messages.
40
41;; Visit <http://freenode.net/faq.shtml#spoofing> and
42;; <http://freenode.net/faq.shtml#registering> to find further
43;; explanations of this capability.
44
45;; From freenode.net's web site (not there anymore) on how to mark
46;; unidentified users:
47;; "We recommend that you add an asterisk before the nick, and
48;; optionally either highlight or colourize the line in some
49;; appropriate fashion, if the user is not identified."
50
51;;; Usage:
52
53;; Put the following in your ~/.emacs file.
54
55;; (require 'erc-capab)
56;; (erc-capab-identify-mode 1)
57
58;; `erc-capab-identify-prefix' will now be added to the beginning of
59;; unidentified users' nicknames. The default is an asterisk, "*". If
60;; the value of this variable is nil or you disable this module (see
61;; `erc-capab-identify-disable'), no prefix will be inserted, but the
62;; flag sent by the server will still be stripped.
63
64;;; Code:
65
66(require 'erc)
67(eval-when-compile (require 'cl))
68
69;;; Customization:
70
71(defgroup erc-capab nil
72 "Support for dancer-ircd's CAPAB settings."
73 :group 'erc)
74
75(defcustom erc-capab-identify-prefix "*"
76 "The prefix used for unidentified users."
77 :group 'erc-capab
78 :type '(choice string (const nil)))
79
80;;; Define module:
81
82(define-erc-response-handler (290)
83 "Handle dancer-ircd CAPAB messages." nil nil)
84
85;;;###autoload (autoload 'erc-capab-identify-mode "erc-capab" nil t)
86(define-erc-module capab-identify nil
87 "Handle dancer-ircd's CAPAB IDENTIFY-MSG and IDENTIFY-CTCP."
88 ;; append so that `erc-server-parameters' is already set by `erc-server-005'
89 ((add-hook 'erc-server-005-functions 'erc-capab-identify-setup t)
90 (add-hook 'erc-server-290-functions 'erc-capab-identify-activate)
91 (add-hook 'erc-server-PRIVMSG-functions
92 'erc-capab-identify-remove/set-identified-flag)
93 (add-hook 'erc-server-NOTICE-functions
94 'erc-capab-identify-remove/set-identified-flag)
95 (add-hook 'erc-insert-modify-hook 'erc-capab-identify-add-prefix t)
96 (mapc (lambda (buffer)
97 (when buffer
98 (with-current-buffer buffer (erc-capab-identify-setup))))
99 (erc-buffer-list 'erc-open-server-buffer-p)))
100 ((remove-hook 'erc-server-005-functions 'erc-capab-identify-setup)
101 (remove-hook 'erc-server-290-functions 'erc-capab-identify-activate)
102 ;; we don't remove the `erc-capab-identify-remove/set-identified-flag' hooks
103 ;; because there doesn't seem to be a way to tell the server to turn it off
104 (remove-hook 'erc-insert-modify-hook 'erc-capab-identify-add-prefix)))
105
106;;; Variables:
107
108(defvar erc-capab-identify-activated nil
109 "CAPAB IDENTIFY-MSG has been activated.")
110(make-variable-buffer-local 'erc-capab-identify-activated)
111
112(defvar erc-capab-identify-sent nil
113 "CAPAB IDENTIFY-MSG and IDENTIFY-CTCP messages have been sent.")
114(make-variable-buffer-local 'erc-capab-identify-sent)
115
116;;; Functions:
117
118(defun erc-capab-identify-setup (&optional proc parsed)
119 "Set up CAPAB IDENTIFY on the current server.
120
121Optional argument PROC is the current server's process.
122Optional argument PARSED is the current message, a response struct.
123
124These arguments are sent to this function when called as a hook in
125`erc-server-005-functions'."
126 (unless erc-capab-identify-sent
127 (erc-capab-send-identify-messages)))
128
129(defun erc-capab-send-identify-messages ()
130 "Send CAPAB IDENTIFY messages if the server supports it."
131 (when (and (stringp erc-server-version)
132 (string-match "^\\(dancer-ircd\\|hyperion\\)" erc-server-version)
133 ;; could possibly check for '("IRCD" . "dancer") in
134 ;; `erc-server-parameters' instead of looking for a specific name
135 ;; in `erc-server-version'
136 (assoc "CAPAB" erc-server-parameters))
137 (erc-log "Sending CAPAB IDENTIFY-MSG and IDENTIFY-CTCP")
138 (erc-server-send "CAPAB IDENTIFY-MSG")
139 (erc-server-send "CAPAB IDENTIFY-CTCP")
140 (setq erc-capab-identify-sent t)))
141
142
143(defun erc-capab-identify-activate (proc parsed)
144 "Set `erc-capab-identify-activated' and display an activation message.
145
146PROC is the current server's process.
147PARSED is an `erc-parsed' response struct."
148 (when (or (string= "IDENTIFY-MSG" (erc-response.contents parsed))
149 (string= "IDENTIFY-CTCP" (erc-response.contents parsed)))
150 (setq erc-capab-identify-activated t)
151 (erc-display-message
152 parsed 'notice 'active (format "%s activated"
153 (erc-response.contents parsed)))))
154
155(defun erc-capab-identify-remove/set-identified-flag (proc parsed)
156 "Remove PARSED message's id flag and add the `erc-identified' text property.
157
158PROC is the current server's process.
159PARSED is an `erc-parsed' response struct."
160 (let ((msg (erc-response.contents parsed)))
161 (when (and erc-capab-identify-activated
162 (string-match "^\\([-\\+]\\)\\(.+\\)$" msg))
163 (setf (erc-response.contents parsed)
164 (if erc-capab-identify-mode
165 (erc-propertize (match-string 2 msg)
166 'erc-identified
167 (if (string= (match-string 1 msg) "+")
168 1
169 0))
170 (match-string 2 msg)))
171 nil)))
172
173(defun erc-capab-identify-add-prefix ()
174 "Add `erc-capab-identify-prefix' to nickname if user is unidentified."
175 (when (and erc-capab-identify-prefix
176 (erc-with-server-buffer erc-capab-identify-activated))
177 (goto-char (or (erc-find-parsed-property) (point-min)))
178 (let ((nickname (erc-capab-get-unidentified-nickname
179 (erc-get-parsed-vector (point)))))
180 (when (and nickname
181 (goto-char (point-min))
182 ;; assuming the first use of `nickname' is the sender's nick
183 (re-search-forward (regexp-quote nickname) nil t))
184 (goto-char (match-beginning 0))
185 (insert (erc-propertize erc-capab-identify-prefix
186 'face (get-char-property (- (point) 1)
187 'face)))))))
188
189(defun erc-capab-get-unidentified-nickname (parsed)
190 "Return the nickname of the user if unidentified.
191PARSED is an `erc-parsed' response struct."
192 (when (and (erc-response-p parsed)
193 (equal 0 (get-text-property 0 'erc-identified
194 (erc-response.contents parsed))))
195 (let ((nickuserhost (erc-get-parsed-vector-nick parsed)))
196 (when nickuserhost
197 (nth 0 (erc-parse-user nickuserhost))))))
198
199(provide 'erc-capab)
200
201;; arch-tag: 27b6d668-7ee5-4e47-b9f0-27d7a4362062
202;;; erc-capab.el ends here
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index 9d652b26d05..60cbe992d19 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -1,6 +1,6 @@
1;;; erc-compat.el --- ERC compatibility code for XEmacs 1;;; erc-compat.el --- ERC compatibility code for XEmacs
2 2
3;; Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2005, 2006, 2007 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/ERC 6;; URL: http://www.emacswiki.org/cgi-bin/wiki/ERC
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index eeb3e93801e..2c906af4516 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -1,6 +1,6 @@
1;;; erc-dcc.el --- CTCP DCC module for ERC 1;;; erc-dcc.el --- CTCP DCC module for ERC
2 2
3;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006 3;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006, 2007
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu> 6;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
@@ -863,29 +863,29 @@ buffer, and sends back the replies after each block of data per the DCC
863protocol spec. Well not really. We write back a reply after each read, 863protocol spec. Well not really. We write back a reply after each read,
864rather than every 1024 byte block, but nobody seems to care." 864rather than every 1024 byte block, but nobody seems to care."
865 (with-current-buffer (process-buffer proc) 865 (with-current-buffer (process-buffer proc)
866 (setq buffer-read-only nil) ;; FIXME 866 (let ((inhibit-read-only t))
867 (goto-char (point-max)) 867 (goto-char (point-max))
868 (insert (string-make-unibyte str)) 868 (insert (string-make-unibyte str))
869 869
870 (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count)) 870 (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count))
871 (erc-assert (= erc-dcc-byte-count (1- (point-max)))) 871 (erc-assert (= erc-dcc-byte-count (1- (point-max))))
872 (and erc-verbose-dcc 872 (and erc-verbose-dcc
873 (erc-display-message 873 (erc-display-message
874 nil 'notice erc-server-process 874 nil 'notice erc-server-process
875 'dcc-get-bytes-received 875 'dcc-get-bytes-received
876 ?f (file-name-nondirectory buffer-file-name) 876 ?f (file-name-nondirectory buffer-file-name)
877 ?b (number-to-string erc-dcc-byte-count))) 877 ?b (number-to-string erc-dcc-byte-count)))
878 (cond 878 (cond
879 ((and (> (plist-get erc-dcc-entry-data :size) 0) 879 ((and (> (plist-get erc-dcc-entry-data :size) 0)
880 (> erc-dcc-byte-count (plist-get erc-dcc-entry-data :size))) 880 (> erc-dcc-byte-count (plist-get erc-dcc-entry-data :size)))
881 (erc-display-message 881 (erc-display-message
882 nil '(error notice) 'active 882 nil '(error notice) 'active
883 'dcc-get-file-too-long 883 'dcc-get-file-too-long
884 ?f (file-name-nondirectory buffer-file-name)) 884 ?f (file-name-nondirectory buffer-file-name))
885 (delete-process proc)) 885 (delete-process proc))
886 (t 886 (t
887 (process-send-string 887 (process-send-string
888 proc (erc-pack-int erc-dcc-byte-count 4)))))) 888 proc (erc-pack-int erc-dcc-byte-count 4)))))))
889 889
890 890
891(defun erc-dcc-get-sentinel (proc event) 891(defun erc-dcc-get-sentinel (proc event)
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index ea5afcabcbe..f63682c51ff 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -1,6 +1,6 @@
1;;; erc-ezbounce.el --- Handle EZBounce bouncer commands 1;;; erc-ezbounce.el --- Handle EZBounce bouncer commands
2 2
3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index 9552ce8543d..26ca86f04c6 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -1,6 +1,6 @@
1;;; erc-fill.el --- Filling IRC messages in various ways 1;;; erc-fill.el --- Filling IRC messages in various ways
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Mario Lang <mlang@delysid.org> 6;; Mario Lang <mlang@delysid.org>
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index f6d32ee7c06..933e6b34b52 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -1,6 +1,6 @@
1;; erc-goodies.el --- Collection of ERC modules 1;; erc-goodies.el --- Collection of ERC modules
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Jorgen Schaefer <forcer@forcix.cx> 6;; Author: Jorgen Schaefer <forcer@forcix.cx>
diff --git a/lisp/erc/erc-hecomplete.el b/lisp/erc/erc-hecomplete.el
index 85a81569782..e6f91ce8998 100644
--- a/lisp/erc/erc-hecomplete.el
+++ b/lisp/erc/erc-hecomplete.el
@@ -1,6 +1,6 @@
1;;; erc-hecomplete.el --- Provides Nick name completion for ERC 1;;; erc-hecomplete.el --- Provides Nick name completion for ERC
2 2
3;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2006, 2007 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?ErcCompletion 6;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcCompletion
diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el
index 24eb2f09ccb..5266d837d64 100644
--- a/lisp/erc/erc-ibuffer.el
+++ b/lisp/erc/erc-ibuffer.el
@@ -1,6 +1,6 @@
1;;; erc-ibuffer.el --- ibuffer integration with ERC 1;;; erc-ibuffer.el --- ibuffer integration with ERC
2 2
3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el
index f30c40d4792..c7f7c615e92 100644
--- a/lisp/erc/erc-identd.el
+++ b/lisp/erc/erc-identd.el
@@ -1,6 +1,6 @@
1;;; erc-identd.el --- RFC1413 (identd authentication protocol) server 1;;; erc-identd.el --- RFC1413 (identd authentication protocol) server
2 2
3;; Copyright (C) 2003, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Keywords: comm, processes 6;; Keywords: comm, processes
diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el
index e897a9d8a0c..5e005181b7b 100644
--- a/lisp/erc/erc-imenu.el
+++ b/lisp/erc/erc-imenu.el
@@ -1,6 +1,6 @@
1;;; erc-imenu.el -- Imenu support for ERC 1;;; erc-imenu.el -- Imenu support for ERC
2 2
3;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
index 86b79c538f1..fb59cd905a6 100644
--- a/lisp/erc/erc-join.el
+++ b/lisp/erc/erc-join.el
@@ -1,6 +1,6 @@
1;;; erc-join.el --- autojoin channels on connect and reconnects 1;;; erc-join.el --- autojoin channels on connect and reconnects
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Keywords: irc 6;; Keywords: irc
diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el
index 04cfbe9e220..c4d103a0f4a 100644
--- a/lisp/erc/erc-lang.el
+++ b/lisp/erc/erc-lang.el
@@ -1,6 +1,6 @@
1;;; erc-lang.el --- provide the LANG command to ERC 1;;; erc-lang.el --- provide the LANG command to ERC
2 2
3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Maintainer: Alex Schroeder <alex@gnu.org> 6;; Maintainer: Alex Schroeder <alex@gnu.org>
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index bd4ed3387d5..22c9b3622d3 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -1,6 +1,6 @@
1;;; erc-log.el --- Logging facilities for ERC. 1;;; erc-log.el --- Logging facilities for ERC.
2 2
3;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Lawrence Mitchell <wence@gmx.li> 5;; Author: Lawrence Mitchell <wence@gmx.li>
6;; Keywords: IRC, chat, client, Internet, logging 6;; Keywords: IRC, chat, client, Internet, logging
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index b5dc913a8c4..50e4cfbc521 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -1,6 +1,6 @@
1;;; erc-match.el --- Highlight messages matching certain regexps 1;;; erc-match.el --- Highlight messages matching certain regexps
2 2
3;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Keywords: comm, faces 6;; Keywords: comm, faces
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el
index a2dc7a1b2f2..a5826625bde 100644
--- a/lisp/erc/erc-menu.el
+++ b/lisp/erc/erc-menu.el
@@ -1,6 +1,6 @@
1;; erc-menu.el -- Menu-bar definitions for ERC 1;; erc-menu.el -- Menu-bar definitions for ERC
2 2
3;; Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
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
@@ -28,7 +28,7 @@
28 28
29;;; Code: 29;;; Code:
30 30
31;(require 'erc) 31(require 'erc)
32(require 'easymenu) 32(require 'easymenu)
33 33
34(defvar erc-menu-definition 34(defvar erc-menu-definition
@@ -40,41 +40,43 @@
40 (and erc-server-connected (fboundp 'erc-list-channels))] 40 (and erc-server-connected (fboundp 'erc-list-channels))]
41 ["Join channel..." erc-join-channel erc-server-connected] 41 ["Join channel..." erc-join-channel erc-server-connected]
42 ["Start a query..." erc-cmd-QUERY erc-server-connected] 42 ["Start a query..." erc-cmd-QUERY erc-server-connected]
43 "-"
44 ["List users in channel" erc-channel-names erc-channel-users]
45 ["List channel operators" erc-cmd-OPS erc-channel-users]
46 ["Input action..." erc-input-action (erc-default-target)] 43 ["Input action..." erc-input-action (erc-default-target)]
47 ["Set topic..." erc-set-topic
48 (and (and (erc-default-target) (not (erc-query-buffer-p)))
49 (or (not (member "t" erc-channel-modes))
50 (erc-channel-user-op-p (erc-current-nick))))]
51 (list "Channel modes"
52 ["Change mode..." erc-insert-mode-command
53 (erc-channel-user-op-p (erc-current-nick))]
54 ["No external send" (erc-toggle-channel-mode "n")
55 :active (erc-channel-user-op-p (erc-current-nick))
56 :style toggle :selected (member "n" erc-channel-modes)]
57 ["Topic set by channel operator" (erc-toggle-channel-mode "t")
58 :style toggle :selected (member "t" erc-channel-modes)
59 :active (erc-channel-user-op-p (erc-current-nick))]
60 ["Invite only" (erc-toggle-channel-mode "i")
61 :style toggle :selected (member "i" erc-channel-modes)
62 :active (erc-channel-user-op-p (erc-current-nick))]
63 ["Private" (erc-toggle-channel-mode "p")
64 :style toggle :selected (member "p" erc-channel-modes)
65 :active (erc-channel-user-op-p (erc-current-nick))]
66 ["Secret" (erc-toggle-channel-mode "s")
67 :style toggle :selected (member "s" erc-channel-modes)
68 :active (erc-channel-user-op-p (erc-current-nick))]
69 ["Moderated" (erc-toggle-channel-mode "m")
70 :style toggle :selected (member "m" erc-channel-modes)
71 :active (erc-channel-user-op-p (erc-current-nick))]
72 ["Set a limit..." erc-set-channel-limit
73 (erc-channel-user-op-p (erc-current-nick))]
74 ["Set a key..." erc-set-channel-key
75 (erc-channel-user-op-p (erc-current-nick))])
76 ["Leave this channel..." erc-part-from-channel erc-channel-users]
77 "-" 44 "-"
45 (list
46 "Current channel"
47 ["List users in channel" erc-channel-names erc-channel-users]
48 ["List channel operators" erc-cmd-OPS erc-channel-users]
49 ["Set topic..." erc-set-topic
50 (and (and (erc-default-target) (not (erc-query-buffer-p)))
51 (or (not (member "t" erc-channel-modes))
52 (erc-channel-user-op-p (erc-current-nick))))]
53 (list "Channel modes"
54 ["Change mode..." erc-insert-mode-command
55 (erc-channel-user-op-p (erc-current-nick))]
56 ["No external send" (erc-toggle-channel-mode "n")
57 :active (erc-channel-user-op-p (erc-current-nick))
58 :style toggle :selected (member "n" erc-channel-modes)]
59 ["Topic set by channel operator" (erc-toggle-channel-mode "t")
60 :style toggle :selected (member "t" erc-channel-modes)
61 :active (erc-channel-user-op-p (erc-current-nick))]
62 ["Invite only" (erc-toggle-channel-mode "i")
63 :style toggle :selected (member "i" erc-channel-modes)
64 :active (erc-channel-user-op-p (erc-current-nick))]
65 ["Private" (erc-toggle-channel-mode "p")
66 :style toggle :selected (member "p" erc-channel-modes)
67 :active (erc-channel-user-op-p (erc-current-nick))]
68 ["Secret" (erc-toggle-channel-mode "s")
69 :style toggle :selected (member "s" erc-channel-modes)
70 :active (erc-channel-user-op-p (erc-current-nick))]
71 ["Moderated" (erc-toggle-channel-mode "m")
72 :style toggle :selected (member "m" erc-channel-modes)
73 :active (erc-channel-user-op-p (erc-current-nick))]
74 ["Set a limit..." erc-set-channel-limit
75 (erc-channel-user-op-p (erc-current-nick))]
76 ["Set a key..." erc-set-channel-key
77 (erc-channel-user-op-p (erc-current-nick))])
78 ["Leave this channel..." erc-part-from-channel erc-channel-users]
79 "-")
78 (list "Pals, fools and other keywords" 80 (list "Pals, fools and other keywords"
79 ["Add pal..." erc-add-pal] 81 ["Add pal..." erc-add-pal]
80 ["Delete pal..." erc-delete-pal] 82 ["Delete pal..." erc-delete-pal]
@@ -98,16 +100,46 @@
98 ["Show ERC version" erc-version t]) 100 ["Show ERC version" erc-version t])
99 "ERC menu definition.") 101 "ERC menu definition.")
100 102
101;; `erc-mode-map' must be defined before doing this 103(defvar erc-menu-defined nil
102(eval-after-load "erc" 104 "Internal variable used to keep track of whether we've defined the
103 '(progn 105ERC menu yet.")
104 (easy-menu-define erc-menu erc-mode-map "ERC menu" erc-menu-definition)
105 (easy-menu-add erc-menu erc-mode-map)
106 106
107 ;; for some reason the menu isn't automatically added to the menu bar 107;;;###autoload (autoload 'erc-menu-mode "erc-menu" nil t)
108 (when (featurep 'xemacs) 108(define-erc-module menu nil
109 (add-hook 'erc-mode-hook 109 "Enable a menu in ERC buffers."
110 (lambda () (easy-menu-add erc-menu erc-mode-map)))))) 110 ((unless erc-menu-defined
111 ;; make sure the menu only gets defined once, since Emacs 22
112 ;; activates it immediately
113 (easy-menu-define erc-menu erc-mode-map "ERC menu" erc-menu-definition)
114 (setq erc-menu-defined t))
115 (if (featurep 'xemacs)
116 (progn
117 ;; the menu isn't automatically added to the menu bar in
118 ;; XEmacs
119 (add-hook 'erc-mode-hook 'erc-menu-add)
120 (dolist (buffer (erc-buffer-list))
121 (with-current-buffer buffer (erc-menu-add))))
122 (erc-menu-add)))
123 ((if (featurep 'xemacs)
124 (progn
125 (remove-hook 'erc-mode-hook 'erc-menu-add)
126 (dolist (buffer (erc-buffer-list))
127 (with-current-buffer buffer (erc-menu-remove))))
128 (erc-menu-remove)
129 ;; `easy-menu-remove' is a no-op in Emacs 22
130 (message "You might have to restart Emacs to remove the ERC menu"))))
131
132;; silence byte-compiler warning
133(eval-when-compile
134 (defvar erc-menu nil))
135
136(defun erc-menu-add ()
137 "Add the ERC menu to the current buffer."
138 (easy-menu-add erc-menu erc-mode-map))
139
140(defun erc-menu-remove ()
141 "Remove the ERC menu from the current buffer."
142 (easy-menu-remove erc-menu))
111 143
112(provide 'erc-menu) 144(provide 'erc-menu)
113 145
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index 72e7b8bbd7f..567c91cc075 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/erc-netsplit.el
@@ -1,6 +1,6 @@
1;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits 1;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index 034950e665f..9f8c5528d04 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -1,6 +1,6 @@
1;;; erc-networks.el --- IRC networks 1;;; erc-networks.el --- IRC networks
2 2
3;; Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@lexx.delysid.org> 5;; Author: Mario Lang <mlang@lexx.delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-nicklist.el b/lisp/erc/erc-nicklist.el
index 7a94d2be9cc..f37b8eab996 100644
--- a/lisp/erc/erc-nicklist.el
+++ b/lisp/erc/erc-nicklist.el
@@ -1,6 +1,6 @@
1;;; erc-nicklist.el --- Display channel nicknames in a side buffer. 1;;; erc-nicklist.el --- Display channel nicknames in a side buffer.
2 2
3;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Filename: erc-nicklist.el 5;; Filename: erc-nicklist.el
6;; Author: Lawrence Mitchell <wence@gmx.li> 6;; Author: Lawrence Mitchell <wence@gmx.li>
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index bb1c9cdceb3..82784c624c0 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -1,6 +1,6 @@
1;;; erc-notify.el --- Online status change notification 1;;; erc-notify.el --- Online status change notification
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@lexx.delysid.org> 5;; Author: Mario Lang <mlang@lexx.delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el
index 4c6b86bd564..de13c6037a6 100644
--- a/lisp/erc/erc-page.el
+++ b/lisp/erc/erc-page.el
@@ -1,6 +1,6 @@
1;; erc-page.el - CTCP PAGE support for ERC 1;; erc-page.el - CTCP PAGE support for ERC
2 2
3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation 3;; Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
6 6
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index 33231ee2590..951ba25898c 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -1,6 +1,6 @@
1;;; erc-pcomplete.el --- Provides programmable completion for ERC 1;;; erc-pcomplete.el --- Provides programmable completion for ERC
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Sacha Chua <sacha@free.net.ph> 5;; Author: Sacha Chua <sacha@free.net.ph>
6;; Keywords: comm, convenience 6;; Keywords: comm, convenience
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index 7a22954f171..5e63f8d7d4f 100644
--- a/lisp/erc/erc-replace.el
+++ b/lisp/erc/erc-replace.el
@@ -1,6 +1,6 @@
1;; erc-replace.el -- wash and massage messages inserted into the buffer 1;; erc-replace.el -- wash and massage messages inserted into the buffer
2 2
3;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
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)
diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el
index 87707e65faa..911a154e915 100644
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -1,6 +1,6 @@
1;; erc-ring.el -- Command history handling for erc using ring.el 1;; erc-ring.el -- Command history handling for erc using ring.el
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el
index b93317e6124..5d03a7b6365 100644
--- a/lisp/erc/erc-services.el
+++ b/lisp/erc/erc-services.el
@@ -1,6 +1,6 @@
1;;; erc-services.el --- Identify to NickServ 1;;; erc-services.el --- Identify to NickServ
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
6 6
@@ -77,6 +77,29 @@ This group allows you to set variables to somewhat automate
77communication with those Services." 77communication with those Services."
78 :group 'erc) 78 :group 'erc)
79 79
80(defcustom erc-nickserv-identify-mode 'both
81 "The mode which is used when identifying to Nickserv.
82
83Possible settings are:.
84
85'autodetect - Identify when the real Nickserv sends an identify request.
86'nick-change - Identify when you log in or change your nickname.
87'both - Do the former if the network supports it, otherwise do the
88 latter.
89nil - Disables automatic Nickserv identification.
90
91You can also use M-x erc-nickserv-identify-mode to change modes."
92 :group 'erc-services
93 :type '(choice (const autodetect)
94 (const nick-change)
95 (const both)
96 (const nil))
97 :set (lambda (sym val)
98 (set sym val)
99 ;; avoid recursive load at startup
100 (when (featurep 'erc-services)
101 (erc-nickserv-identify-mode val))))
102
80;;;###autoload (autoload 'erc-services-mode "erc-services" nil t) 103;;;###autoload (autoload 'erc-services-mode "erc-services" nil t)
81(define-erc-module services nickserv 104(define-erc-module services nickserv
82 "This mode automates communication with services." 105 "This mode automates communication with services."
@@ -128,27 +151,6 @@ communication with those Services."
128 (remove-hook 'erc-nick-changed-functions 151 (remove-hook 'erc-nick-changed-functions
129 'erc-nickserv-identify-on-nick-change)))) 152 'erc-nickserv-identify-on-nick-change))))
130 153
131(defcustom erc-nickserv-identify-mode 'both
132 "The mode which is used when identifying to Nickserv.
133
134Possible settings are:.
135
136'autodetect - Identify when the real Nickserv sends an identify request.
137'nick-change - Identify when you change your nickname.
138'both - Do the former if the network supports it, otherwise do the
139 latter.
140nil - Disables automatic Nickserv identification.
141
142You can also use M-x erc-nickserv-identify-mode to change modes."
143 :group 'erc-services
144 :type '(choice (const autodetect)
145 (const nick-change)
146 (const both)
147 (const nil))
148 :set (lambda (sym val)
149 (set sym val)
150 (erc-nickserv-identify-mode val)))
151
152(defcustom erc-prompt-for-nickserv-password t 154(defcustom erc-prompt-for-nickserv-password t
153 "Ask for the password when identifying to NickServ." 155 "Ask for the password when identifying to NickServ."
154 :group 'erc-services 156 :group 'erc-services
@@ -184,7 +186,13 @@ Example of use:
184;; Variables: 186;; Variables:
185 187
186(defcustom erc-nickserv-alist 188(defcustom erc-nickserv-alist
187 '((DALnet 189 '((BitlBee
190 nil
191 nil
192 "&bitlbee"
193 "identify"
194 nil)
195 (DALnet
188 "NickServ!service@dal.net" 196 "NickServ!service@dal.net"
189 "/msg\\s-NickServ@services.dal.net\\s-IDENTIFY\\s-<password>" 197 "/msg\\s-NickServ@services.dal.net\\s-IDENTIFY\\s-<password>"
190 "NickServ@services.dal.net" 198 "NickServ@services.dal.net"
@@ -266,6 +274,24 @@ ANSWER is the command to use for the answer. The default is 'privmsg.
266 (string :tag "Command") 274 (string :tag "Command")
267 (const :tag "No special command necessary" nil))))) 275 (const :tag "No special command necessary" nil)))))
268 276
277(defsubst erc-nickserv-alist-sender (network &optional entry)
278 (nth 1 (or entry (assoc network erc-nickserv-alist))))
279
280(defsubst erc-nickserv-alist-regexp (network &optional entry)
281 (nth 2 (or entry (assoc network erc-nickserv-alist))))
282
283(defsubst erc-nickserv-alist-nickserv (network &optional entry)
284 (nth 3 (or entry (assoc network erc-nickserv-alist))))
285
286(defsubst erc-nickserv-alist-ident-keyword (network &optional entry)
287 (nth 4 (or entry (assoc network erc-nickserv-alist))))
288
289(defsubst erc-nickserv-alist-use-nick-p (network &optional entry)
290 (nth 5 (or entry (assoc network erc-nickserv-alist))))
291
292(defsubst erc-nickserv-alist-ident-command (network &optional entry)
293 (nth 6 (or entry (assoc network erc-nickserv-alist))))
294
269;; Functions: 295;; Functions:
270 296
271(defun erc-nickserv-identify-autodetect (proc parsed) 297(defun erc-nickserv-identify-autodetect (proc parsed)
@@ -277,14 +303,14 @@ password for this nickname, otherwise try to send it automatically."
277 (unless (and (null erc-nickserv-passwords) 303 (unless (and (null erc-nickserv-passwords)
278 (null erc-prompt-for-nickserv-password)) 304 (null erc-prompt-for-nickserv-password))
279 (let* ((network (erc-network)) 305 (let* ((network (erc-network))
280 (nickserv (nth 1 (assoc network erc-nickserv-alist))) 306 (sender (erc-nickserv-alist-sender network))
281 (identify-regex (nth 2 (assoc network erc-nickserv-alist))) 307 (identify-regex (erc-nickserv-alist-regexp network))
282 (sspec (erc-response.sender parsed)) 308 (sspec (erc-response.sender parsed))
283 (nick (car (erc-response.command-args parsed))) 309 (nick (car (erc-response.command-args parsed)))
284 (msg (erc-response.contents parsed))) 310 (msg (erc-response.contents parsed)))
285 ;; continue only if we're sure it's the real nickserv for this network 311 ;; continue only if we're sure it's the real nickserv for this network
286 ;; and it's asked us to identify 312 ;; and it's asked us to identify
287 (when (and nickserv (equal sspec nickserv) 313 (when (and sender (equal sspec sender)
288 (string-match identify-regex msg)) 314 (string-match identify-regex msg))
289 (erc-log "NickServ IDENTIFY request detected") 315 (erc-log "NickServ IDENTIFY request detected")
290 (erc-nickserv-call-identify-function nick) 316 (erc-nickserv-call-identify-function nick)
@@ -295,7 +321,7 @@ password for this nickname, otherwise try to send it automatically."
295 (unless (or (and (null erc-nickserv-passwords) 321 (unless (or (and (null erc-nickserv-passwords)
296 (null erc-prompt-for-nickserv-password)) 322 (null erc-prompt-for-nickserv-password))
297 (and (eq erc-nickserv-identify-mode 'both) 323 (and (eq erc-nickserv-identify-mode 'both)
298 (nth 2 (assoc (erc-network) erc-nickserv-alist)))) 324 (erc-nickserv-alist-regexp (erc-network))))
299 (erc-nickserv-call-identify-function nick))) 325 (erc-nickserv-call-identify-function nick)))
300 326
301(defun erc-nickserv-identify-on-nick-change (nick old-nick) 327(defun erc-nickserv-identify-on-nick-change (nick old-nick)
@@ -303,7 +329,7 @@ password for this nickname, otherwise try to send it automatically."
303 (unless (or (and (null erc-nickserv-passwords) 329 (unless (or (and (null erc-nickserv-passwords)
304 (null erc-prompt-for-nickserv-password)) 330 (null erc-prompt-for-nickserv-password))
305 (and (eq erc-nickserv-identify-mode 'both) 331 (and (eq erc-nickserv-identify-mode 'both)
306 (nth 2 (assoc (erc-network) erc-nickserv-alist)))) 332 (erc-nickserv-alist-regexp (erc-network))))
307 (erc-nickserv-call-identify-function nick))) 333 (erc-nickserv-call-identify-function nick)))
308 334
309(defun erc-nickserv-call-identify-function (nickname) 335(defun erc-nickserv-call-identify-function (nickname)
@@ -333,12 +359,16 @@ When called interactively, read the password using `read-passwd'."
333 (let* ((erc-auto-discard-away nil) 359 (let* ((erc-auto-discard-away nil)
334 (network (erc-network)) 360 (network (erc-network))
335 (nickserv-info (assoc network erc-nickserv-alist)) 361 (nickserv-info (assoc network erc-nickserv-alist))
336 (nickserv (or (nth 3 nickserv-info) "NickServ")) 362 (nickserv (or (erc-nickserv-alist-nickserv nil nickserv-info)
337 (identify-word (or (nth 4 nickserv-info) "IDENTIFY")) 363 "NickServ"))
338 (nick (if (nth 5 nickserv-info) 364 (identify-word (or (erc-nickserv-alist-ident-keyword
365 nil nickserv-info)
366 "IDENTIFY"))
367 (nick (if (erc-nickserv-alist-use-nick-p nil nickserv-info)
339 (concat (erc-current-nick) " ") 368 (concat (erc-current-nick) " ")
340 "")) 369 ""))
341 (msgtype (or (nth 6 nickserv-info) "PRIVMSG"))) 370 (msgtype (or (erc-nickserv-alist-ident-command nil nickserv-info)
371 "PRIVMSG")))
342 (erc-message msgtype 372 (erc-message msgtype
343 (concat nickserv " " identify-word " " nick password))))) 373 (concat nickserv " " identify-word " " nick password)))))
344 374
diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el
index e152d8ed0df..fdac1cc3be0 100644
--- a/lisp/erc/erc-sound.el
+++ b/lisp/erc/erc-sound.el
@@ -1,6 +1,6 @@
1;;; erc-sound.el --- CTCP SOUND support for ERC 1;;; erc-sound.el --- CTCP SOUND support for ERC
2 2
3;; Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
6 6
diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el
index 55e24782f77..551b83fb5ac 100644
--- a/lisp/erc/erc-speedbar.el
+++ b/lisp/erc/erc-speedbar.el
@@ -1,6 +1,6 @@
1;;; erc-speedbar.el --- Speedbar support for ERC 1;;; erc-speedbar.el --- Speedbar support for ERC
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Contributor: Eric M. Ludlam <eric@siege-engine.com> 6;; Contributor: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el
index 7ed0f510539..484ddb36d52 100644
--- a/lisp/erc/erc-spelling.el
+++ b/lisp/erc/erc-spelling.el
@@ -1,6 +1,6 @@
1;;; erc-spelling.el --- use flyspell in ERC 1;;; erc-spelling.el --- use flyspell in ERC
2 2
3;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Jorgen Schaefer <forcer@forcix.cx> 5;; Author: Jorgen Schaefer <forcer@forcix.cx>
6;; Keywords: irc 6;; Keywords: irc
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index b0622b99443..5a9977aaead 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -1,6 +1,6 @@
1;;; erc-stamp.el --- Timestamping for ERC messages 1;;; erc-stamp.el --- Timestamping for ERC messages
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm, processes, timestamp 6;; Keywords: comm, processes, timestamp
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 3c8f93acfc2..0fa550a5838 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -1,6 +1,6 @@
1;;; erc-track.el --- Track modified channel buffers 1;;; erc-track.el --- Track modified channel buffers
2 2
3;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm, faces 6;; Keywords: comm, faces
@@ -773,10 +773,6 @@ is in `erc-mode'."
773 str) 773 str)
774 (erc-faces-in str))) 774 (erc-faces-in str)))
775 775
776(defun erc-find-parsed-property ()
777 "Find the next occurrence of the `erc-parsed' text property."
778 (text-property-not-all (point-min) (point-max) 'erc-parsed nil))
779
780;;; Buffer switching 776;;; Buffer switching
781 777
782(defvar erc-track-last-non-erc-buffer nil 778(defvar erc-track-last-non-erc-buffer nil
diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el
index 76475ab8ee5..440dc870e2c 100644
--- a/lisp/erc/erc-truncate.el
+++ b/lisp/erc/erc-truncate.el
@@ -1,6 +1,6 @@
1;;; erc-truncate.el --- Functions for truncating ERC buffers 1;;; erc-truncate.el --- Functions for truncating ERC buffers
2 2
3;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Keywords: IRC, chat, client, Internet, logging 6;; Keywords: IRC, chat, client, Internet, logging
diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el
index d00dfc5e1a0..ea1fa27bf4b 100644
--- a/lisp/erc/erc-xdcc.el
+++ b/lisp/erc/erc-xdcc.el
@@ -1,6 +1,6 @@
1;;; erc-xdcc.el --- XDCC file-server support for ERC 1;;; erc-xdcc.el --- XDCC file-server support for ERC
2 2
3;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm, processes 6;; Keywords: comm, processes
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 427dd178383..927dce02d64 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1,7 +1,7 @@
1;; erc.el --- An Emacs Internet Relay Chat client 1;; erc.el --- An Emacs Internet Relay Chat client
2 2
3;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4;; 2006 Free Software Foundation, Inc. 4;; 2006, 2007 Free Software Foundation, Inc.
5 5
6;; Author: Alexander L. Belikoff (alexander@belikoff.net) 6;; Author: Alexander L. Belikoff (alexander@belikoff.net)
7;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu), 7;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu),
@@ -74,7 +74,6 @@
74(require 'pp) 74(require 'pp)
75(require 'thingatpt) 75(require 'thingatpt)
76(require 'erc-compat) 76(require 'erc-compat)
77(require 'erc-menu)
78 77
79(defvar erc-official-location 78(defvar erc-official-location
80 "http://emacswiki.org/cgi-bin/wiki/ERC (mailing list: erc-discuss@gnu.org)" 79 "http://emacswiki.org/cgi-bin/wiki/ERC (mailing list: erc-discuss@gnu.org)"
@@ -356,6 +355,17 @@ nicknames with erc-server-user struct instances.")
356 (cdr (assq (aref s (match-beginning 0)) c))))) 355 (cdr (assq (aref s (match-beginning 0)) c)))))
357 s)) 356 s))
358 357
358(defmacro erc-with-server-buffer (&rest body)
359 "Execute BODY in the current ERC server buffer.
360If no server buffer exists, return nil."
361 (let ((buffer (make-symbol "buffer")))
362 `(let ((,buffer (erc-server-buffer)))
363 (when (buffer-live-p ,buffer)
364 (with-current-buffer ,buffer
365 ,@body)))))
366(put 'erc-with-server-buffer 'lisp-indent-function 0)
367(put 'erc-with-server-buffer 'edebug-form-spec '(body))
368
359(defstruct (erc-server-user (:type vector) :named) 369(defstruct (erc-server-user (:type vector) :named)
360 ;; User data 370 ;; User data
361 nickname host login full-name info 371 nickname host login full-name info
@@ -782,6 +792,13 @@ set if some hacker is trying to flood you away."
782 :group 'erc 792 :group 'erc
783 :type 'string) 793 :type 'string)
784 794
795(defcustom erc-system-name nil
796 "Use this as the name of your system.
797If nil, ERC will call `system-name' to get this information."
798 :group 'erc
799 :type '(choice (const :tag "Default system name" nil)
800 string))
801
785(defcustom erc-ignore-list nil 802(defcustom erc-ignore-list nil
786 "*List of regexps matching user identifiers to ignore. 803 "*List of regexps matching user identifiers to ignore.
787 804
@@ -1333,6 +1350,14 @@ If BUFFER is nil, the current buffer is used."
1333 (and (eq major-mode 'erc-mode) 1350 (and (eq major-mode 'erc-mode)
1334 (null (erc-default-target))))) 1351 (null (erc-default-target)))))
1335 1352
1353(defun erc-open-server-buffer-p (&optional buffer)
1354 "Return non-nil if argument BUFFER is an ERC server buffer that
1355has an open IRC process.
1356
1357If BUFFER is nil, the current buffer is used."
1358 (and (erc-server-buffer-p)
1359 (erc-server-process-alive)))
1360
1336(defun erc-query-buffer-p (&optional buffer) 1361(defun erc-query-buffer-p (&optional buffer)
1337 "Return non-nil if BUFFER is an ERC query buffer. 1362 "Return non-nil if BUFFER is an ERC query buffer.
1338If BUFFER is nil, the current buffer is used." 1363If BUFFER is nil, the current buffer is used."
@@ -1764,7 +1789,7 @@ all channel buffers on all servers."
1764 1789
1765(defcustom erc-modules '(netsplit fill button match track completion readonly 1790(defcustom erc-modules '(netsplit fill button match track completion readonly
1766 ring autojoin noncommands irccontrols 1791 ring autojoin noncommands irccontrols
1767 stamp) 1792 stamp menu)
1768 "A list of modules which ERC should enable. 1793 "A list of modules which ERC should enable.
1769If you set the value of this without using `customize' remember to call 1794If you set the value of this without using `customize' remember to call
1770\(erc-update-modules) after you change it. When using `customize', modules 1795\(erc-update-modules) after you change it. When using `customize', modules
@@ -1791,17 +1816,21 @@ removed from the list will be disabled."
1791 (const :tag "Set away status automatically" autoaway) 1816 (const :tag "Set away status automatically" autoaway)
1792 (const :tag "Join channels automatically" autojoin) 1817 (const :tag "Join channels automatically" autojoin)
1793 (const :tag "Buttonize URLs, nicknames, and other text" button) 1818 (const :tag "Buttonize URLs, nicknames, and other text" button)
1819 (const
1820 :tag
1821 "Mark unidentified users on freenode and other servers supporting CAPAB"
1822 capab-identify)
1794 (const :tag "Wrap long lines" fill) 1823 (const :tag "Wrap long lines" fill)
1795 (const :tag "Launch an identd server on port 8113" identd) 1824 (const :tag "Launch an identd server on port 8113" identd)
1796 (const :tag "Highlight or remove IRC control characters" 1825 (const :tag "Highlight or remove IRC control characters"
1797 irccontrols) 1826 irccontrols)
1798 (const :tag "Save buffers in logs" log) 1827 (const :tag "Save buffers in logs" log)
1799 (const :tag "Highlight pals, fools, and other keywords" match) 1828 (const :tag "Highlight pals, fools, and other keywords" match)
1829 (const :tag "Display a menu in ERC buffers" menu)
1800 (const :tag "Detect netsplits" netsplit) 1830 (const :tag "Detect netsplits" netsplit)
1801 (const :tag "Don't display non-IRC commands after evaluation" 1831 (const :tag "Don't display non-IRC commands after evaluation"
1802 noncommands) 1832 noncommands)
1803 (const :tag 1833 (const :tag "Notify when the online status of certain users changes"
1804 "Notify when the online status of certain users changes"
1805 notify) 1834 notify)
1806 (const :tag "Complete nicknames and commands (programmable)" 1835 (const :tag "Complete nicknames and commands (programmable)"
1807 completion) 1836 completion)
@@ -1831,6 +1860,8 @@ removed from the list will be disabled."
1831 (setq req (concat "erc-" (symbol-name mod))) 1860 (setq req (concat "erc-" (symbol-name mod)))
1832 (cond 1861 (cond
1833 ;; yuck. perhaps we should bring the filenames into sync? 1862 ;; yuck. perhaps we should bring the filenames into sync?
1863 ((string= req "erc-capab-identify")
1864 (setq req "erc-capab"))
1834 ((string= req "erc-completion") 1865 ((string= req "erc-completion")
1835 (setq req "erc-pcomplete")) 1866 (setq req "erc-pcomplete"))
1836 ((string= req "erc-pcomplete") 1867 ((string= req "erc-pcomplete")
@@ -1891,6 +1922,7 @@ Returns the buffer for the given server or channel."
1891 (old-buffer (current-buffer)) 1922 (old-buffer (current-buffer))
1892 old-point 1923 old-point
1893 continued-session) 1924 continued-session)
1925 (when connect (run-hook-with-args 'erc-before-connect server port nick))
1894 (erc-update-modules) 1926 (erc-update-modules)
1895 (set-buffer buffer) 1927 (set-buffer buffer)
1896 (setq old-point (point)) 1928 (setq old-point (point))
@@ -2104,8 +2136,6 @@ server and full-name will be set to those values, whereas
2104`erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will 2136`erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will
2105be invoked for the values of the other parameters." 2137be invoked for the values of the other parameters."
2106 (interactive (erc-select-read-args)) 2138 (interactive (erc-select-read-args))
2107
2108 (run-hook-with-args 'erc-before-connect server port nick)
2109 (erc-open server port nick full-name t password)) 2139 (erc-open server port nick full-name t password))
2110 2140
2111(defalias 'erc-select 'erc) 2141(defalias 'erc-select 'erc)
@@ -4300,8 +4330,10 @@ See also `erc-display-message'."
4300 nil) 4330 nil)
4301 4331
4302(defun erc-process-away (proc away-p) 4332(defun erc-process-away (proc away-p)
4303 ;; FIXME: This docstring is AWFUL -- Lawrence 2004-01-08 4333 "Toggle the away status of the user depending on the value of AWAY-P.
4304 "Process the user being away, or returning from an away break." 4334
4335If nil, set the user as away.
4336If non-nil, return from being away."
4305 (let ((sessionbuf (process-buffer proc))) 4337 (let ((sessionbuf (process-buffer proc)))
4306 (when sessionbuf 4338 (when sessionbuf
4307 (with-current-buffer sessionbuf 4339 (with-current-buffer sessionbuf
@@ -4881,6 +4913,9 @@ Specifically, return the position of `erc-insert-marker'."
4881 erc-input-marker 4913 erc-input-marker
4882 (erc-end-of-input-line))) 4914 (erc-end-of-input-line)))
4883 4915
4916(defvar erc-command-regexp "^/\\([A-Za-z]+\\)\\(\\s-+.*\\|\\s-*\\)$"
4917 "Regular expression used for matching commands in ERC.")
4918
4884(defun erc-send-input (input) 4919(defun erc-send-input (input)
4885 "Treat INPUT as typed in by the user. It is assumed that the input 4920 "Treat INPUT as typed in by the user. It is assumed that the input
4886and the prompt is already deleted. 4921and the prompt is already deleted.
@@ -4902,7 +4937,7 @@ This returns non-nil only iff we actually send anything."
4902 (run-hook-with-args 'erc-send-pre-hook input) 4937 (run-hook-with-args 'erc-send-pre-hook input)
4903 (when erc-send-this 4938 (when erc-send-this
4904 (if (or (string-match "\n" str) 4939 (if (or (string-match "\n" str)
4905 (not (char-equal (aref str 0) ?/))) 4940 (not (string-match erc-command-regexp str)))
4906 (mapc 4941 (mapc
4907 (lambda (line) 4942 (lambda (line)
4908 (mapc 4943 (mapc
@@ -4967,7 +5002,7 @@ current position."
4967 "Extract command and args from the input LINE. 5002 "Extract command and args from the input LINE.
4968If no command was given, return nil. If command matches, return a 5003If no command was given, return nil. If command matches, return a
4969list of the form: (command args) where both elements are strings." 5004list of the form: (command args) where both elements are strings."
4970 (when (string-match "^/\\([A-Za-z]+\\)\\(\\s-+.*\\|\\s-*\\)$" line) 5005 (when (string-match erc-command-regexp line)
4971 (let* ((cmd (erc-command-symbol (match-string 1 line))) 5006 (let* ((cmd (erc-command-symbol (match-string 1 line)))
4972 ;; note: return is nil, we apply this simply for side effects 5007 ;; note: return is nil, we apply this simply for side effects
4973 (canon-defun (while (and cmd (symbolp (symbol-function cmd))) 5008 (canon-defun (while (and cmd (symbolp (symbol-function cmd)))
@@ -5406,7 +5441,7 @@ user input."
5406 (erc-log (format "login: nick: %s, user: %s %s %s :%s" 5441 (erc-log (format "login: nick: %s, user: %s %s %s :%s"
5407 (erc-current-nick) 5442 (erc-current-nick)
5408 (user-login-name) 5443 (user-login-name)
5409 (system-name) 5444 (or erc-system-name (system-name))
5410 erc-session-server 5445 erc-session-server
5411 erc-session-user-full-name)) 5446 erc-session-user-full-name))
5412 (if erc-session-password 5447 (if erc-session-password
@@ -5655,6 +5690,7 @@ of `mode-line-buffer-identification'.
5655 5690
5656The following characters are replaced: 5691The following characters are replaced:
5657%a: String indicating away status or \"\" if you are not away 5692%a: String indicating away status or \"\" if you are not away
5693%l: The estimated lag time to the server
5658%m: The modes of the channel 5694%m: The modes of the channel
5659%n: The current nick name 5695%n: The current nick name
5660%o: The topic of the channel 5696%o: The topic of the channel
@@ -5666,9 +5702,9 @@ The following characters are replaced:
5666 :group 'erc-mode-line-and-header 5702 :group 'erc-mode-line-and-header
5667 :type 'string) 5703 :type 'string)
5668 5704
5669(defcustom erc-header-line-format "[IRC] %n on %t %m %o" 5705(defcustom erc-header-line-format "%n on %t (%m,%l) %o"
5670 "A string to be formatted and shown in the header-line in `erc-mode'. 5706 "A string to be formatted and shown in the header-line in `erc-mode'.
5671Only used in Emacs 21. 5707Only used starting in Emacs 21.
5672 5708
5673See `erc-mode-line-format' for which characters are can be used." 5709See `erc-mode-line-format' for which characters are can be used."
5674 :group 'erc-mode-line-and-header 5710 :group 'erc-mode-line-and-header
@@ -5758,33 +5794,37 @@ if `erc-away' is non-nil."
5758 ""))) 5794 "")))
5759 5795
5760(defun erc-format-channel-modes () 5796(defun erc-format-channel-modes ()
5761 "Return the current channel's modes and the estimated lag." 5797 "Return the current channel's modes."
5798 (concat (apply 'concat
5799 "+" erc-channel-modes)
5800 (cond ((and erc-channel-user-limit erc-channel-key)
5801 (if erc-show-channel-key-p
5802 (format "lk %.0f %s" erc-channel-user-limit
5803 erc-channel-key)
5804 (format "kl %.0f" erc-channel-user-limit)))
5805 (erc-channel-user-limit
5806 ;; Emacs has no bignums
5807 (format "l %.0f" erc-channel-user-limit))
5808 (erc-channel-key
5809 (if erc-show-channel-key-p
5810 (format "k %s" erc-channel-key)
5811 "k"))
5812 (t nil))))
5813
5814(defun erc-format-lag-time ()
5815 "Return the estimated lag time to server, `erc-server-lag'."
5762 (let ((lag (when (erc-server-buffer-live-p) 5816 (let ((lag (when (erc-server-buffer-live-p)
5763 (with-current-buffer (process-buffer erc-server-process) 5817 (with-current-buffer (process-buffer erc-server-process)
5764 erc-server-lag)))) 5818 erc-server-lag))))
5765 (concat (apply 'concat 5819 (cond (lag (format "lag:%.0f" lag))
5766 "(+" erc-channel-modes) 5820 (t ""))))
5767 (cond ((and erc-channel-user-limit erc-channel-key)
5768 (if erc-show-channel-key-p
5769 (format "lk %.0f %s" erc-channel-user-limit
5770 erc-channel-key)
5771 (format "kl %.0f" erc-channel-user-limit)))
5772 (erc-channel-user-limit
5773 ;; Emacs has no bignums
5774 (format "l %.0f" erc-channel-user-limit))
5775 (erc-channel-key
5776 (if erc-show-channel-key-p
5777 (format "k %s" erc-channel-key)
5778 "k"))
5779 (t ""))
5780 (if lag (format ",lag:%.0f" lag) "")
5781 ")")))
5782 5821
5783(defun erc-update-mode-line-buffer (buffer) 5822(defun erc-update-mode-line-buffer (buffer)
5784 "Update the mode line in a single ERC buffer BUFFER." 5823 "Update the mode line in a single ERC buffer BUFFER."
5785 (with-current-buffer buffer 5824 (with-current-buffer buffer
5786 (let ((spec (format-spec-make 5825 (let ((spec (format-spec-make
5787 ?a (erc-format-away-status) 5826 ?a (erc-format-away-status)
5827 ?l (erc-format-lag-time)
5788 ?m (erc-format-channel-modes) 5828 ?m (erc-format-channel-modes)
5789 ?n (or (erc-current-nick) "") 5829 ?n (or (erc-current-nick) "")
5790 ?o (erc-controls-strip erc-channel-topic) 5830 ?o (erc-controls-strip erc-channel-topic)
@@ -5831,7 +5871,10 @@ if `erc-away' is non-nil."
5831 (erc-propertize header 'help-echo help-echo 5871 (erc-propertize header 'help-echo help-echo
5832 'face face) 5872 'face face)
5833 (erc-propertize header 'help-echo help-echo)))))) 5873 (erc-propertize header 'help-echo help-echo))))))
5834 (t (setq header-line-format header)))))) 5874 (t (setq header-line-format
5875 (if face
5876 (erc-propertize header 'face face)
5877 header)))))))
5835 (if (featurep 'xemacs) 5878 (if (featurep 'xemacs)
5836 (redraw-modeline) 5879 (redraw-modeline)
5837 (force-mode-line-update)))) 5880 (force-mode-line-update))))
@@ -6185,6 +6228,10 @@ This function should be on `erc-kill-channel-hook'."
6185 6228
6186;;; Dealing with `erc-parsed' 6229;;; Dealing with `erc-parsed'
6187 6230
6231(defun erc-find-parsed-property ()
6232 "Find the next occurrence of the `erc-parsed' text property."
6233 (text-property-not-all (point-min) (point-max) 'erc-parsed nil))
6234
6188(defun erc-get-parsed-vector (point) 6235(defun erc-get-parsed-vector (point)
6189 "Return the whole parsed vector on POINT." 6236 "Return the whole parsed vector on POINT."
6190 (get-text-property point 'erc-parsed)) 6237 (get-text-property point 'erc-parsed))