aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc
diff options
context:
space:
mode:
authorKaroly Lorentey2007-01-01 17:38:32 +0000
committerKaroly Lorentey2007-01-01 17:38:32 +0000
commit65e86587ab836aaa86b12ce30b219bcb4fcbaa06 (patch)
tree7e13feee7387635f52df3613cf1bba4414781aab /lisp/erc
parent8c778e28bcf16b4baef6400a124ec2403941e940 (diff)
parent1fc8c92b50100da709c94a0faa47deed5603634f (diff)
downloademacs-65e86587ab836aaa86b12ce30b219bcb4fcbaa06.tar.gz
emacs-65e86587ab836aaa86b12ce30b219bcb4fcbaa06.zip
Merged from emacs@sv.gnu.org.
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-536 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-537 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-538 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-539 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-540 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-541 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-542 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-543 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-544 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-545 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-546 Update from erc--emacs--22 * emacs@sv.gnu.org/emacs--devo--0--patch-547 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-548 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-549 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-550 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-551 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-552 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-553 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-554 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-555 erc-iswitchb: Temporarily enable iswitchb mode * emacs@sv.gnu.org/emacs--devo--0--patch-556 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-557 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-558 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-559 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-560 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-561 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-562 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-563 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-564 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-565 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-566 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-567 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-568 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-569 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-570 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-571 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-572 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-573 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-574 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-575 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-576 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-577 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-578 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-579 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-580 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-581 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-582 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-583 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-584 Fix admin/quick-install-emacs to work with recent versions of autoconf * emacs@sv.gnu.org/gnus--rel--5.10--patch-171 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-172 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-173 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-174 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-175 Update from CVS: lisp/legacy-gnus-agent.el: Add Copyright notice. * emacs@sv.gnu.org/gnus--rel--5.10--patch-176 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-177 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-178 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-179 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-180 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-181 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-182 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-183 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-184 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-185 Merge from emacs--devo--0 git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-590
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog30
-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-dcc.el1
-rw-r--r--lisp/erc/erc-ezbounce.el8
-rw-r--r--lisp/erc/erc-list.el415
-rw-r--r--lisp/erc/erc-stamp.el4
-rw-r--r--lisp/erc/erc.el37
11 files changed, 61 insertions, 444 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index dfb6fc7afe8..b356f83b0b2 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,23 @@
12006-12-13 Leo <sdl.web@gmail.com> (tiny change)
2
3 * erc.el (erc-iswitchb): Temporarily enable iswitchb mode if it
4 isn't active already, instead of leaving it on.
5
62006-12-10 Juanma Barranquero <lekktu@gmail.com>
7
8 * erc-ezbounce.el (erc-ezb-init-session-list): Doc fix.
9
102006-12-08 Michael Olson <mwolson@gnu.org>
11
12 * erc.el: Re-evaluate contributions from a contributor, and found
13 them under 15 lines of non-obvious code, so it is safe to remove
14 the copyright notice.
15 (erc-modules): Remove list module.
16
17 * erc-list.el: Remove, since a contributor who has not completed
18 their assignment has contributed significantly more than 15 lines
19 of code to this file.
20
12006-11-28 Juanma Barranquero <lekktu@gmail.com> 212006-11-28 Juanma Barranquero <lekktu@gmail.com>
2 22
3 * erc.el (erc-cmd-BANLIST, erc-cmd-MASSUNBAN): Simplify. 23 * erc.el (erc-cmd-BANLIST, erc-cmd-MASSUNBAN): Simplify.
@@ -18,6 +38,11 @@
18 (erc-update-current-channel-member, erc-load-script): 38 (erc-update-current-channel-member, erc-load-script):
19 (erc-mode-line-away-status-format): Doc fixes. 39 (erc-mode-line-away-status-format): Doc fixes.
20 40
412006-11-20 Andrea Russo <rastandy@inventati.org>
42
43 * erc-dcc.el (erc-dcc-chat-setup): Initialize `erc-input-marker'
44 before calling `erc-display-prompt'.
45
212006-11-24 Juanma Barranquero <lekktu@gmail.com> 462006-11-24 Juanma Barranquero <lekktu@gmail.com>
22 47
23 * erc.el (erc-after-connect, erc-open-ssl-stream) 48 * erc.el (erc-after-connect, erc-open-ssl-stream)
@@ -86,6 +111,11 @@
86 `erc-show-my-nick' is non-nil. 111 `erc-show-my-nick' is non-nil.
87 (erc-compute-server): Doc fix. 112 (erc-compute-server): Doc fix.
88 113
1142006-10-01 John J Foerch <jjfoerch@earthlink.net>
115
116 * erc-stamp.el (erc-insert-timestamp-right): Exclude the newline
117 from the erc-timestamp field.
118
892006-09-11 Michael Olson <mwolson@gnu.org> 1192006-09-11 Michael Olson <mwolson@gnu.org>
90 120
91 * erc-nicklist.el (erc-nicklist-insert-contents): Add missing 121 * erc-nicklist.el (erc-nicklist-insert-contents): Add missing
diff --git a/lisp/erc/ChangeLog.01 b/lisp/erc/ChangeLog.01
index 20a03801477..25f57569742 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 Free Software Foundation, Inc. 1038 Copyright (C) 2001, 2006 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 006ac0c1415..332bd7fbfb9 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 Free Software Foundation, Inc. 2599 Copyright (C) 2002, 2006 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 6f55258c04e..20f0f92f5e0 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 Free Software Foundation, Inc. 2143 Copyright (C) 2003, 2006 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 3ab41db65b4..c5338a311c9 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 Free Software Foundation, Inc. 2072 Copyright (C) 2004, 2006 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 8fa725459e2..a640aba00a1 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 Free Software Foundation, Inc. 1220 Copyright (C) 2005, 2006 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-dcc.el b/lisp/erc/erc-dcc.el
index 1b5111e8525..eeb3e93801e 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -1035,6 +1035,7 @@ other client."
1035 (setq erc-dcc-entry-data entry) 1035 (setq erc-dcc-entry-data entry)
1036 (setq erc-dcc-unprocessed-output "") 1036 (setq erc-dcc-unprocessed-output "")
1037 (setq erc-insert-marker (set-marker (make-marker) (point-max))) 1037 (setq erc-insert-marker (set-marker (make-marker) (point-max)))
1038 (setq erc-input-marker (make-marker))
1038 (erc-display-prompt buffer (point-max)) 1039 (erc-display-prompt buffer (point-max))
1039 (set-process-buffer proc buffer) 1040 (set-process-buffer proc buffer)
1040 (add-hook 'kill-buffer-hook 'erc-dcc-chat-buffer-killed nil t) 1041 (add-hook 'kill-buffer-hook 'erc-dcc-chat-buffer-killed nil t)
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index d04fe782f7e..ea5afcabcbe 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -126,7 +126,7 @@ in the alist is `nil', prompt for the appropriate values."
126 126
127;;;###autoload 127;;;###autoload
128(defun erc-ezb-init-session-list (message) 128(defun erc-ezb-init-session-list (message)
129 "Reset the EZBounce session list to NIL." 129 "Reset the EZBounce session list to nil."
130 (setq erc-ezb-session-list nil) 130 (setq erc-ezb-session-list nil)
131 (setq erc-ezb-inside-session-listing t)) 131 (setq erc-ezb-inside-session-listing t))
132 132
@@ -134,7 +134,7 @@ in the alist is `nil', prompt for the appropriate values."
134(defun erc-ezb-end-of-session-list (message) 134(defun erc-ezb-end-of-session-list (message)
135 "Indicate the end of the EZBounce session listing." 135 "Indicate the end of the EZBounce session listing."
136 (setq erc-ezb-inside-session-listing nil)) 136 (setq erc-ezb-inside-session-listing nil))
137 137
138;;;###autoload 138;;;###autoload
139(defun erc-ezb-add-session (message) 139(defun erc-ezb-add-session (message)
140 "Add an EZBounce session to the session list." 140 "Add an EZBounce session to the session list."
@@ -157,7 +157,7 @@ in the alist is `nil', prompt for the appropriate values."
157 (read-from-minibuffer "IRC port: " 157 (read-from-minibuffer "IRC port: "
158 (erc-port-to-string "6667"))))) 158 (erc-port-to-string "6667")))))
159 (erc-server-send (format "CONN %s %s" server port))))) 159 (erc-server-send (format "CONN %s %s" server port)))))
160 160
161 161
162;;;###autoload 162;;;###autoload
163(defun erc-ezb-select-session () 163(defun erc-ezb-select-session ()
@@ -173,7 +173,7 @@ in the alist is `nil', prompt for the appropriate values."
173(defun erc-ezb-initialize () 173(defun erc-ezb-initialize ()
174 "Add EZBouncer convenience functions to ERC." 174 "Add EZBouncer convenience functions to ERC."
175 (add-hook 'erc-server-NOTICE-functions 'erc-ezb-notice-autodetect)) 175 (add-hook 'erc-server-NOTICE-functions 'erc-ezb-notice-autodetect))
176 176
177(provide 'erc-ezbounce) 177(provide 'erc-ezbounce)
178 178
179;; arch-tag: e972aa7b-a9f4-4d16-a489-074ec7a1002e 179;; arch-tag: e972aa7b-a9f4-4d16-a489-074ec7a1002e
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
deleted file mode 100644
index c041842429e..00000000000
--- a/lisp/erc/erc-list.el
+++ /dev/null
@@ -1,415 +0,0 @@
1;;; erc-list.el --- Provide a faster channel listing mechanism
2
3;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4;; Copyright (C) 2004 Brian Palmer
5
6;; Author: Mario Lang <mlang@lexx.delysid.org>
7;; Keywords: comm
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option)
14;; any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA.
25
26;;; Commentary:
27
28;; This file provides a simple derived mode for viewing Channel lists.
29;; It also serves as a demonstration of how the new server hook facility
30;; can be used.
31
32;;; Code:
33
34(require 'erc)
35(require 'erc-networks)
36(require 'sort)
37(unless (fboundp 'make-overlay)
38 (require 'overlay))
39(eval-when-compile (require 'cl))
40
41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
42;; User customizable variables.
43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
44
45(defgroup erc-list nil
46 "Display IRC channels in another window when using /LIST"
47 :group 'erc)
48
49(defcustom erc-chanlist-progress-message t
50 "*Show progress message while accumulating channel list."
51 :group 'erc-list
52 :type 'boolean)
53
54(defcustom erc-no-list-networks nil
55 "*A list of network names on which the /LIST command refuses to work."
56 :group 'erc-list
57 :type '(repeat string))
58
59(defcustom erc-chanlist-frame-parameters nil
60 "*If nil, the channel list is displayed in a new window; if non-nil,
61this variable holds the frame parameters used to make a frame to
62display the channel list."
63 :group 'erc-list
64 :type 'list)
65
66(defcustom erc-chanlist-hide-modeline nil
67 "*If nil, the channel list buffer has a modeline, otherwise the modeline is hidden."
68 :group 'erc-list
69 :type 'boolean)
70
71(defface erc-chanlist-header-face '((t (:bold t)))
72 "Face used for the headers in erc's channel list."
73 :group 'erc-faces)
74
75(defface erc-chanlist-odd-line-face '((t (:inverse-video t)))
76 "Face used for the odd lines in erc's channel list."
77 :group 'erc-faces)
78
79(defface erc-chanlist-even-line-face '((t (:inverse-video nil)))
80 "Face used for the even lines in erc's channel list."
81 :group 'erc-faces)
82
83(defface erc-chanlist-highlight '((t (:foreground "red")))
84 "Face used to highlight the current line in the channel list."
85 :group 'erc-faces)
86
87;; This should perhaps be a defface that inherits values from the highlight face
88;; but xemacs does not support inheritance
89(defcustom erc-chanlist-highlight-face 'erc-chanlist-highlight
90 "Face used for highlighting the current line in a list."
91 :type 'face
92 :group 'erc-faces)
93
94
95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
96;; All variables below this line are for internal use only.
97;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
98
99(defvar erc-chanlist-channel-line-regexp "^\\([#&\\*][^ \t\n]*\\)\\s-+[0-9]+"
100 "Regexp that matches a channel line in the channel list buffer.")
101
102(defvar erc-chanlist-buffer nil)
103(make-variable-buffer-local 'erc-chanlist-buffer)
104
105(defvar erc-chanlist-last-time 0
106 "A time value used to throttle the progress indicator.")
107
108(defvar erc-chanlist-frame nil
109 "The frame displaying the most recent channel list buffer.")
110
111(defvar erc-chanlist-sort-state 'channel
112 "The sort mode of the channel list buffer. Either 'channel or 'users.")
113(make-variable-buffer-local 'erc-chanlist-sort-state)
114
115(defvar erc-chanlist-highlight-overlay nil
116 "The overlay used for erc chanlist highlighting")
117(make-variable-buffer-local 'erc-chanlist-highlight-overlay)
118
119;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
120;; Define erc-chanlist-mode.
121;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
122
123(defcustom erc-chanlist-mode-hook nil
124 "Hook run by erc-chanlist-mode."
125 :group 'erc-list
126 :type 'hook)
127
128(define-derived-mode erc-chanlist-mode fundamental-mode "ERC Channel List"
129 "Mode for viewing a channel list of a particular server.
130
131\\{erc-chanlist-mode-map}"
132 (local-set-key "\C-c\C-j" 'erc-join-channel)
133 (local-set-key "j" 'erc-chanlist-join-channel)
134 (local-set-key "n" 'next-line)
135 (local-set-key "p" 'previous-line)
136 (local-set-key "q" 'erc-chanlist-quit)
137 (local-set-key "s" 'erc-chanlist-toggle-sort-state)
138 (local-set-key "t" 'toggle-truncate-lines)
139 (setq erc-chanlist-sort-state 'channel)
140 (setq truncate-lines t)
141 (add-hook 'post-command-hook 'erc-chanlist-post-command-hook 'append 'local))
142
143;; Define module:
144;;;###autoload (autoload 'erc-list-mode "erc-list")
145(define-erc-module list nil
146 "List channels nicely in a separate buffer."
147 ((defalias 'erc-cmd-LIST 'erc-list-channels))
148 ((defalias 'erc-cmd-LIST 'erc-list-channels-simple)))
149
150;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
151;; Functions.
152;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
153
154;;;###autoload
155(defun erc-list-channels (&rest channel)
156 "Display a buffer containing a list of channels on the current server.
157Optional argument CHANNEL specifies a single channel to list (instead of every
158available channel)."
159 (interactive
160 (remove "" (split-string
161 (read-from-minibuffer "List channels (RET for all): ") " ")))
162 (if (and (null channel)
163 (erc-member-ignore-case (erc-network-name) erc-no-list-networks))
164 (erc-display-line "ERC is configured not to allow the /LIST command on this network!"
165 (current-buffer))
166 (erc-display-line (erc-make-notice (concat "Listing channel"
167 (if channel
168 "."
169 "s. This may take a while."))))
170 (erc-chanlist channel))
171 t)
172
173(defun erc-list-channels-simple (&optional line)
174 "Send the LIST command to the current server with optional channels LINE."
175 (when (string-match "^\\s-*\\(.*\\)$" line)
176 (let ((channels (match-string 1 line)))
177 (erc-log (format "cmd: LIST: %s" channels))
178 (erc-server-send
179 (if (string= channels "")
180 "LIST"
181 (concat "LIST :" channels))))
182 t))
183(put 'erc-list-channels-simple 'do-not-parse-args t)
184
185;;;###autoload
186(defun erc-chanlist (&optional channels)
187 "Show a channel listing of the current server in a special mode.
188Please note that this function only works with IRC servers which conform
189to RFC and send the LIST header (#321) at start of list transmission."
190 (interactive)
191 (with-current-buffer (erc-server-buffer)
192 (erc-once-with-server-event
193 321
194 '(progn
195 (add-hook 'erc-server-322-functions 'erc-chanlist-322 nil t)
196
197 (erc-once-with-server-event
198 323
199 '(progn
200 (remove-hook 'erc-server-322-functions 'erc-chanlist-322 t)
201 (let ((buf erc-chanlist-buffer))
202 (if (not (buffer-live-p buf))
203 (error "`erc-chanlist-buffer' does not refer to a live buffer"))
204
205 (set-buffer buf)
206 (buffer-disable-undo)
207 (let (buffer-read-only
208 (sort-fold-case t))
209 (sort-lines nil (point-min) (point-max))
210 (setq erc-chanlist-sort-state 'channel)
211
212 (let ((sum (count-lines (point-min) (point-max))))
213 (goto-char (point-min))
214 (insert (substitute-command-keys
215 (concat "'\\[erc-chanlist-toggle-sort-state]' toggle sort mode.\n"
216 "'\\[erc-chanlist-quit]' kill this buffer.\n"
217 "'\\[toggle-truncate-lines]' toggle line truncation.\n"
218 "'\\[erc-chanlist-join-channel]' join the channel listed on the current line.\n\n")))
219 (insert (format "%d channels (sorted by %s).\n\n"
220 sum (if (eq erc-chanlist-sort-state 'channel)
221 "channel name"
222 "number of users"))))
223
224 (insert (format "%-25s%5s %s\n------------------------ ----- ----------------------------\n"
225 "Channel"
226 "Users"
227 "Topic"))
228
229 ;; Display the channel list buffer.
230 (if erc-chanlist-frame-parameters
231 (progn
232 (if (or (null erc-chanlist-frame)
233 (not (frame-live-p erc-chanlist-frame)))
234 (setq erc-chanlist-frame
235 (make-frame `((name . ,(format "Channels on %s"
236 erc-session-server))
237 ,@erc-chanlist-frame-parameters))))
238 (select-frame erc-chanlist-frame)
239 (switch-to-buffer buf)
240 (erc-prettify-channel-list))
241 (pop-to-buffer buf)
242 (erc-prettify-channel-list))))
243 (goto-char (point-min))
244 (search-forward-regexp "^------" nil t)
245 (forward-line 1)
246 (erc-chanlist-highlight-line)
247 (message "")
248 t))
249
250 (setq erc-chanlist-buffer (get-buffer-create
251 (format "*Channels on %s*"
252 (erc-response.sender parsed))))
253 (with-current-buffer erc-chanlist-buffer
254 (setq buffer-read-only nil)
255 (erase-buffer)
256 (erc-chanlist-mode)
257 (setq erc-server-process proc)
258 (if erc-chanlist-hide-modeline
259 (setq mode-line-format nil))
260 (setq buffer-read-only t))
261 t))
262
263 ;; Now that we've setup our callbacks, pull the trigger.
264 (if (interactive-p)
265 (message "Collecting channel list for server %s" erc-session-server))
266 (erc-server-send (if (null channels)
267 "LIST"
268 (concat "LIST "
269 (mapconcat #'identity channels ","))))))
270
271(defun erc-chanlist-322 (proc parsed)
272 "Process an IRC 322 message.
273
274The message carries information about one channel for the LIST
275command."
276 (multiple-value-bind (channel num-users)
277 (cdr (erc-response.command-args parsed))
278 (let ((topic (erc-response.contents parsed)))
279 (with-current-buffer erc-chanlist-buffer
280 (save-excursion
281 (goto-char (point-max))
282 (let (buffer-read-only)
283 (insert (format "%-26s%4s %s\n" (erc-controls-strip channel)
284 num-users
285 (erc-controls-strip topic))))
286
287 ;; Maybe display a progress indicator in the minibuffer.
288 (when (and erc-chanlist-progress-message
289 (> (erc-time-diff
290 erc-chanlist-last-time (erc-current-time))
291 3))
292 (setq erc-chanlist-last-time (erc-current-time))
293 (message "Accumulating channel list ... %c"
294 (aref [?/ ?| ?\\ ?- ?! ?O ?o] (random 7))))
295
296 ;; Return success to prevent other hook functions from being run.
297 t)))))
298
299(defun erc-chanlist-post-command-hook ()
300 "Keep the current line highlighted."
301 (ignore-errors
302 (save-excursion
303 (beginning-of-line)
304 (if (looking-at erc-chanlist-channel-line-regexp)
305 (erc-chanlist-highlight-line)
306 (erc-chanlist-dehighlight-line)))))
307
308(defun erc-chanlist-highlight-line ()
309 "Highlight the current line."
310 (unless erc-chanlist-highlight-overlay
311 (setq erc-chanlist-highlight-overlay
312 (make-overlay (point-min) (point-min)))
313 ;; Detach it from the buffer.
314 (delete-overlay erc-chanlist-highlight-overlay)
315 (overlay-put erc-chanlist-highlight-overlay
316 'face erc-chanlist-highlight-face)
317 ;; Expressly put it at a higher priority than the text
318 ;; properties used for faces later on. Gnu emacs promises that
319 ;; right now overlays are higher priority than text properties,
320 ;; but why take chances?
321 (overlay-put erc-chanlist-highlight-overlay 'priority 1))
322 (move-overlay erc-chanlist-highlight-overlay (point) (1+ (point-at-eol))))
323
324(defun erc-chanlist-dehighlight-line ()
325 "Remove the line highlighting."
326 (delete-overlay erc-chanlist-highlight-overlay))
327
328(defun erc-prettify-channel-list ()
329 "Make the channel list buffer look pretty.
330When this function runs, the current buffer must be the channel
331list buffer, or it does nothing."
332 (if (eq major-mode 'erc-chanlist-mode)
333 (save-excursion
334 (let ((inhibit-read-only t))
335 (goto-char (point-min))
336 (when (search-forward-regexp "^-------" nil t)
337 (add-text-properties
338 (point-min) (1+ (point-at-eol)) '(face erc-chanlist-header-face))
339 (forward-line 1))
340
341 (while (not (eobp))
342 (add-text-properties
343 (point) (1+ (point-at-eol)) '(face erc-chanlist-odd-line-face))
344 (forward-line 1)
345 (unless (eobp)
346 (add-text-properties
347 (point) (1+ (point-at-eol)) '(face erc-chanlist-even-line-face)))
348 (forward-line 1))))))
349
350(defun erc-chanlist-toggle-sort-state ()
351 "Toggle the channel list buffer sorting method.
352Either sort by channel names or by number of users in each channel."
353 (interactive)
354 (let ((inhibit-read-only t)
355 (sort-fold-case t))
356 (save-excursion
357 (goto-char (point-min))
358 (search-forward-regexp "^-----" nil t)
359 (forward-line 1)
360 (unless (eobp)
361 (if (eq erc-chanlist-sort-state 'channel)
362 (progn
363 (sort-numeric-fields 2 (point) (point-max))
364 (reverse-region (point) (point-max))
365 (setq erc-chanlist-sort-state 'users))
366 (sort-lines nil (point) (point-max))
367 (setq erc-chanlist-sort-state 'channel))
368
369 (goto-char (point-min))
370 (if (search-forward-regexp "^[0-9]+ channels (sorted by \\(.*\\)).$"
371 nil t)
372 (replace-match (if (eq erc-chanlist-sort-state 'channel)
373 "channel name"
374 "number of users")
375 nil nil nil 1))
376
377 (goto-char (point-min))
378 (search-forward-regexp "^-----" nil t)
379 (forward-line 1)
380 (recenter -1)
381
382 (erc-prettify-channel-list)))))
383
384(defun erc-chanlist-quit ()
385 "Quit Chanlist mode.
386Kill the channel list buffer, window, and frame (if there's a frame
387devoted to the channel list)."
388 (interactive)
389 (kill-buffer (current-buffer))
390 (if (eq (selected-frame) erc-chanlist-frame)
391 (delete-frame)
392 (delete-window)))
393
394(defun erc-chanlist-join-channel ()
395 "Join the channel listed on the current line of the channel list buffer.
396Private channels, which are shown as asterisks (*), are ignored."
397 (interactive)
398 (save-excursion
399 (beginning-of-line)
400 (when (looking-at erc-chanlist-channel-line-regexp)
401 (let ((channel-name (match-string 1)))
402 (when (and (stringp channel-name)
403 (not (string= channel-name "*")))
404 (run-at-time 0.5 nil 'erc-join-channel channel-name))))))
405
406(provide 'erc-list)
407
408;;; erc-list.el ends here
409;;
410;; Local Variables:
411;; indent-tabs-mode: t
412;; tab-width: 8
413;; End:
414
415;; arch-tag: 4a13196a-a61b-465a-9926-044dfbc7e5ff
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 5d43baab6c9..b0622b99443 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -266,8 +266,8 @@ be printed just before the window-width."
266 (indent-to pos) 266 (indent-to pos)
267 (setq from (point)) 267 (setq from (point))
268 (insert string)) 268 (insert string))
269 (erc-put-text-property from (1+ (point)) 'field 'erc-timestamp) 269 (erc-put-text-property from (point) 'field 'erc-timestamp)
270 (erc-put-text-property from (1+ (point)) 'rear-nonsticky t) 270 (erc-put-text-property from (point) 'rear-nonsticky t)
271 (when erc-timestamp-intangible 271 (when erc-timestamp-intangible
272 (erc-put-text-property from (1+ (point)) 'intangible t))))) 272 (erc-put-text-property from (1+ (point)) 'intangible t)))))
273 273
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index a40da6f62c0..7de2828b86d 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2,7 +2,6 @@
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 Free Software Foundation, Inc.
5;; Copyright (C) 2004 Brian Palmer
6 5
7;; Author: Alexander L. Belikoff (alexander@belikoff.net) 6;; Author: Alexander L. Belikoff (alexander@belikoff.net)
8;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu), 7;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu),
@@ -1669,22 +1668,25 @@ If `erc-track-mode' is in enabled, put the last element of
1669Due to some yet unresolved reason, global function `iswitchb-mode' 1668Due to some yet unresolved reason, global function `iswitchb-mode'
1670needs to be active for this function to work." 1669needs to be active for this function to work."
1671 (interactive "P") 1670 (interactive "P")
1672 (eval-and-compile 1671 (eval-when-compile
1673 (require 'iswitchb)) 1672 (require 'iswitchb))
1674 (let ((iswitchb-make-buflist-hook 1673 (let ((enabled iswitchb-mode))
1675 (lambda () 1674 (or enabled (iswitchb-mode 1))
1676 (setq iswitchb-temp-buflist 1675 (let ((iswitchb-make-buflist-hook
1677 (mapcar 'buffer-name 1676 (lambda ()
1678 (erc-buffer-list 1677 (setq iswitchb-temp-buflist
1679 nil 1678 (mapcar 'buffer-name
1680 (when arg erc-server-process))))))) 1679 (erc-buffer-list
1681 (switch-to-buffer 1680 nil
1682 (iswitchb-read-buffer 1681 (when arg erc-server-process)))))))
1683 "Switch-to: " 1682 (switch-to-buffer
1684 (if (boundp 'erc-modified-channels-alist) 1683 (iswitchb-read-buffer
1685 (buffer-name (caar (last erc-modified-channels-alist))) 1684 "Switch-to: "
1686 nil) 1685 (if (boundp 'erc-modified-channels-alist)
1687 t)))) 1686 (buffer-name (caar (last erc-modified-channels-alist)))
1687 nil)
1688 t)))
1689 (or enabled (iswitchb-mode -1))))
1688 1690
1689(defun erc-channel-list (proc) 1691(defun erc-channel-list (proc)
1690 "Return a list of channel buffers. 1692 "Return a list of channel buffers.
@@ -1761,7 +1763,7 @@ all channel buffers on all servers."
1761 1763
1762(defcustom erc-modules '(netsplit fill button match track completion readonly 1764(defcustom erc-modules '(netsplit fill button match track completion readonly
1763 ring autojoin noncommands irccontrols 1765 ring autojoin noncommands irccontrols
1764 stamp list) 1766 stamp)
1765 "A list of modules which ERC should enable. 1767 "A list of modules which ERC should enable.
1766If you set the value of this without using `customize' remember to call 1768If you set the value of this without using `customize' remember to call
1767\(erc-update-modules) after you change it. When using `customize', modules 1769\(erc-update-modules) after you change it. When using `customize', modules
@@ -1792,7 +1794,6 @@ removed from the list will be disabled."
1792 (const :tag "Launch an identd server on port 8113" identd) 1794 (const :tag "Launch an identd server on port 8113" identd)
1793 (const :tag "Highlight or remove IRC control characters" 1795 (const :tag "Highlight or remove IRC control characters"
1794 irccontrols) 1796 irccontrols)
1795 (const :tag "List channels in a separate buffer" list)
1796 (const :tag "Save buffers in logs" log) 1797 (const :tag "Save buffers in logs" log)
1797 (const :tag "Highlight pals, fools, and other keywords" match) 1798 (const :tag "Highlight pals, fools, and other keywords" match)
1798 (const :tag "Detect netsplits" netsplit) 1799 (const :tag "Detect netsplits" netsplit)