[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-commit] [commit][master] erc-list: Add module definition, strip ini
From: |
mwolson |
Subject: |
[Erc-commit] [commit][master] erc-list: Add module definition, strip initial space from arg. |
Date: |
Thu, 10 Jan 2008 01:10:22 -0500 |
commit ee94b3a1e03ddb62dcbe598f05da37c8deb6a4ba
Author: Michael W. Olson <address@hidden>
Date: Thu Jan 10 00:34:25 2008 -0500
erc-list: Add module definition, strip initial space from arg.
diff --git a/ChangeLog b/ChangeLog
index 6e4abad..b990c8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-01-10 Michael Olson <address@hidden>
+
+ * erc.el (erc-modules): Add list-old.
+
+ * erc-list.el: New file from Tom Tromey. Use erc-propertize
+ instead of propertize. Add simple module definition.
+ (erc-list-handle-322): Handle the case where we run the LIST
+ command, but do not go through the normal steps.
+ (erc-cmd-LIST): Add docstring. Strip initial space from line if
+ it is non-nil.
+
+ * erc-list-old.el: Renamed from old erc-list.el.
+
2008-01-04 Stefan Monnier <address@hidden>
* erc-ibuffer.el (erc-channel-modes):
diff --git a/erc-list.el b/erc-list.el
index 5cb024b..256ae41 100644
--- a/erc-list.el
+++ b/erc-list.el
@@ -49,6 +49,13 @@
;; local in the list buffer.
(defvar erc-list-server-buffer nil)
+;; Define module:
+;;;###autoload (autoload 'erc-list-mode "erc-list")
+(define-erc-module list nil
+ "List channels nicely in a separate buffer."
+ (nil)
+ (nil))
+
;; Format a record for display.
(defun erc-list-make-string (channel users topic)
(concat
@@ -156,8 +163,9 @@
(channel (car args))
(nusers (car (cdr args)))
(topic (erc-response.contents parsed)))
- (with-current-buffer erc-list-buffer
- (erc-list-insert-item channel nusers topic)))
+ (when (buffer-live-p erc-list-buffer)
+ (with-current-buffer erc-list-buffer
+ (erc-list-insert-item channel nusers topic))))
;; Don't let another hook run.
t)
@@ -187,13 +195,21 @@
;; The main entry point.
(defun erc-cmd-LIST (&optional line)
+ "Show a listing of channels on the current server in a separate window.
+
+If LINE is specified, include it with the /LIST command. It
+should usually be one or more channels, separated by commas.
+
+Please note that this function only works with IRC servers which conform
+to RFC and send the LIST header (#321) at start of list transmission."
(erc-with-server-buffer
(set (make-variable-buffer-local 'erc-list-last-argument) line)
(erc-once-with-server-event
321
'(progn
(erc-list-install-322-handler))))
- (erc-server-send (concat "LIST :" (or line ""))))
+ (erc-server-send (concat "LIST :" (or (and line (substring line 1))
+ ""))))
(put 'erc-cmd-LIST 'do-not-parse-args t)
;;; erc-list.el ends here
diff --git a/erc.el b/erc.el
index 6ca09bc..4b98b68 100644
--- a/erc.el
+++ b/erc.el
@@ -1840,6 +1840,7 @@ removed from the list will be disabled."
(const :tag "irccontrols: Highlight or remove IRC control characters"
irccontrols)
(const :tag "list: List channels in a separate buffer" list)
+ (const :tag "list-old: List channels in a separate buffer (old)" list-old)
(const :tag "log: Save buffers in logs" log)
(const :tag "match: Highlight pals, fools, and other keywords" match)
(const :tag "menu: Display a menu in ERC buffers" menu)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erc-commit] [commit][master] erc-list: Add module definition, strip initial space from arg.,
mwolson <=