aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2010-08-22 18:44:55 -0400
committerChong Yidong2010-08-22 18:44:55 -0400
commitc00725d7967fc88c5492d05f1bbfd5d4eaa4066a (patch)
treedcfdf3782ea4d9035418a70ebf031540acfdc0d5
parentbc7d7ea63ba9d98b3ecc3b6decf4392a651dcbfb (diff)
downloademacs-c00725d7967fc88c5492d05f1bbfd5d4eaa4066a.tar.gz
emacs-c00725d7967fc88c5492d05f1bbfd5d4eaa4066a.zip
Handle multiple entries in some RCIRC commands (Bug#6894).
* lisp/net/rcirc.el (rcirc-add-or-remove): Accept a list of elements. (ignore, bright, dim, keyword): Split list of nicknames before passing to rcirc-add-or-remove.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/net/rcirc.el31
2 files changed, 26 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 45a7cf2c87e..8ea9d0b975e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12010-08-22 Leo <sdl.web@gmail.com>
2
3 * net/rcirc.el (rcirc-add-or-remove): Accept a list of elements.
4 (ignore, bright, dim, keyword): Split list of nicknames before
5 passing to rcirc-add-or-remove (Bug#6894).
6
12010-08-22 Chong Yidong <cyd@stupidchicken.com> 72010-08-22 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix (Bug#6880). 9 * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix (Bug#6880).
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 17e36855ac6..500f27851f6 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1083,7 +1083,7 @@ Create the buffer if it doesn't exist."
1083 (when (not (equal 0 (- (point) rcirc-prompt-end-marker))) 1083 (when (not (equal 0 (- (point) rcirc-prompt-end-marker)))
1084 ;; delete a trailing newline 1084 ;; delete a trailing newline
1085 (when (eq (point) (point-at-bol)) 1085 (when (eq (point) (point-at-bol))
1086 (delete-backward-char 1)) 1086 (delete-char -1))
1087 (let ((input (buffer-substring-no-properties 1087 (let ((input (buffer-substring-no-properties
1088 rcirc-prompt-end-marker (point)))) 1088 rcirc-prompt-end-marker (point))))
1089 (dolist (line (split-string input "\n")) 1089 (dolist (line (split-string input "\n"))
@@ -2110,12 +2110,13 @@ With a prefix arg, prompt for new topic."
2110 (rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a" 2110 (rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a"
2111 target args))) 2111 target args)))
2112 2112
2113(defun rcirc-add-or-remove (set &optional elt) 2113(defun rcirc-add-or-remove (set &rest elements)
2114 (if (and elt (not (string= "" elt))) 2114 (dolist (elt elements)
2115 (if (member-ignore-case elt set) 2115 (if (and elt (not (string= "" elt)))
2116 (delete elt set) 2116 (setq set (if (member-ignore-case elt set)
2117 (cons elt set)) 2117 (delete elt set)
2118 set)) 2118 (cons elt set)))))
2119 set)
2119 2120
2120(defun-rcirc-command ignore (nick) 2121(defun-rcirc-command ignore (nick)
2121 "Manage the ignore list. 2122 "Manage the ignore list.
@@ -2123,7 +2124,9 @@ Ignore NICK, unignore NICK if already ignored, or list ignored
2123nicks when no NICK is given. When listing ignored nicks, the 2124nicks when no NICK is given. When listing ignored nicks, the
2124ones added to the list automatically are marked with an asterisk." 2125ones added to the list automatically are marked with an asterisk."
2125 (interactive "sToggle ignoring of nick: ") 2126 (interactive "sToggle ignoring of nick: ")
2126 (setq rcirc-ignore-list (rcirc-add-or-remove rcirc-ignore-list nick)) 2127 (setq rcirc-ignore-list
2128 (apply #'rcirc-add-or-remove rcirc-ignore-list
2129 (split-string nick nil t)))
2127 (rcirc-print process nil "IGNORE" target 2130 (rcirc-print process nil "IGNORE" target
2128 (mapconcat 2131 (mapconcat
2129 (lambda (nick) 2132 (lambda (nick)
@@ -2135,14 +2138,18 @@ ones added to the list automatically are marked with an asterisk."
2135(defun-rcirc-command bright (nick) 2138(defun-rcirc-command bright (nick)
2136 "Manage the bright nick list." 2139 "Manage the bright nick list."
2137 (interactive "sToggle emphasis of nick: ") 2140 (interactive "sToggle emphasis of nick: ")
2138 (setq rcirc-bright-nicks (rcirc-add-or-remove rcirc-bright-nicks nick)) 2141 (setq rcirc-bright-nicks
2142 (apply #'rcirc-add-or-remove rcirc-bright-nicks
2143 (split-string nick nil t)))
2139 (rcirc-print process nil "BRIGHT" target 2144 (rcirc-print process nil "BRIGHT" target
2140 (mapconcat 'identity rcirc-bright-nicks " "))) 2145 (mapconcat 'identity rcirc-bright-nicks " ")))
2141 2146
2142(defun-rcirc-command dim (nick) 2147(defun-rcirc-command dim (nick)
2143 "Manage the dim nick list." 2148 "Manage the dim nick list."
2144 (interactive "sToggle deemphasis of nick: ") 2149 (interactive "sToggle deemphasis of nick: ")
2145 (setq rcirc-dim-nicks (rcirc-add-or-remove rcirc-dim-nicks nick)) 2150 (setq rcirc-dim-nicks
2151 (apply #'rcirc-add-or-remove rcirc-dim-nicks
2152 (split-string nick nil t)))
2146 (rcirc-print process nil "DIM" target 2153 (rcirc-print process nil "DIM" target
2147 (mapconcat 'identity rcirc-dim-nicks " "))) 2154 (mapconcat 'identity rcirc-dim-nicks " ")))
2148 2155
@@ -2151,7 +2158,9 @@ ones added to the list automatically are marked with an asterisk."
2151Mark KEYWORD, unmark KEYWORD if already marked, or list marked 2158Mark KEYWORD, unmark KEYWORD if already marked, or list marked
2152keywords when no KEYWORD is given." 2159keywords when no KEYWORD is given."
2153 (interactive "sToggle highlighting of keyword: ") 2160 (interactive "sToggle highlighting of keyword: ")
2154 (setq rcirc-keywords (rcirc-add-or-remove rcirc-keywords keyword)) 2161 (setq rcirc-keywords
2162 (apply #'rcirc-add-or-remove rcirc-keywords
2163 (split-string keyword nil t)))
2155 (rcirc-print process nil "KEYWORD" target 2164 (rcirc-print process nil "KEYWORD" target
2156 (mapconcat 'identity rcirc-keywords " "))) 2165 (mapconcat 'identity rcirc-keywords " ")))
2157 2166