emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/erc/erc-list.el


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/erc/erc-list.el
Date: Sun, 12 Feb 2006 12:02:53 +0000

Index: emacs/lisp/erc/erc-list.el
diff -u emacs/lisp/erc/erc-list.el:1.2 emacs/lisp/erc/erc-list.el:1.3
--- emacs/lisp/erc/erc-list.el:1.2      Wed Feb  8 02:41:23 2006
+++ emacs/lisp/erc/erc-list.el  Sun Feb 12 12:02:53 2006
@@ -140,12 +140,19 @@
   (setq truncate-lines t)
   (add-hook 'post-command-hook 'erc-chanlist-post-command-hook 'append 'local))
 
+;; Define module:
+;;;###autoload (autoload 'erc-list-mode "erc-list")
+(define-erc-module list nil
+  "List channels nicely in a separate buffer."
+  ((defalias 'erc-cmd-LIST 'erc-list-channels))
+  ((defalias 'erc-cmd-LIST 'erc-list-channels-simple)))
+
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Functions.
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;;###autoload
-(defun erc-cmd-LIST (&rest channel)
+(defun erc-list-channels (&rest channel)
   "Display a buffer containing a list of channels on the current server.
 Optional argument CHANNEL specifies a single channel to list (instead of every
 available channel)."
@@ -163,6 +170,18 @@
     (erc-chanlist channel))
   t)
 
+(defun erc-list-channels-simple (&optional line)
+  "Send the LIST command to the current server with optional channels LINE."
+  (when (string-match "^\\s-*\\(.*\\)$" line)
+    (let ((channels (match-string 1 line)))
+      (erc-log (format "cmd: LIST: %s" channels))
+      (erc-server-send
+       (if (string= channels "")
+          "LIST"
+        (concat "LIST :" channels))))
+    t))
+(put 'erc-list-channels-simple 'do-not-parse-args t)
+
 ;;;###autoload
 (defun erc-chanlist (&optional channels)
   "Show a channel listing of the current server in a special mode.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]