Commit 27e81f9f authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/erc/erc.el (erc-channel-receive-names): Reduce redundancy.

parent dff76c18
2014-07-08 Stefan Monnier <monnier@iro.umontreal.ca>
* erc.el (erc-channel-receive-names): Reduce redundancy.
2014-06-19 Kelvin White <kelvin.white77@gmail.com> 2014-06-19 Kelvin White <kelvin.white77@gmail.com>
* erc-backend.el: Handle user modes in relevant server responses * erc-backend.el: Handle user modes in relevant server responses
......
...@@ -2797,7 +2797,8 @@ VALUE is computed by evaluating the rest of LINE in Lisp." ...@@ -2797,7 +2797,8 @@ VALUE is computed by evaluating the rest of LINE in Lisp."
(concat "\n" (pp-to-string val)) (concat "\n" (pp-to-string val))
(format " %S\n" val))))) (format " %S\n" val)))))
(apropos-internal "^erc-" 'custom-variable-p)))) (apropos-internal "^erc-" 'custom-variable-p))))
(current-buffer)) t) (current-buffer))
t)
(t nil))) (t nil)))
(defalias 'erc-cmd-VAR 'erc-cmd-SET) (defalias 'erc-cmd-VAR 'erc-cmd-SET)
(defalias 'erc-cmd-VARIABLE 'erc-cmd-SET) (defalias 'erc-cmd-VARIABLE 'erc-cmd-SET)
...@@ -3874,7 +3875,8 @@ If FACE is non-nil, it will be used to propertize the prompt. If it is nil, ...@@ -3874,7 +3875,8 @@ If FACE is non-nil, it will be used to propertize the prompt. If it is nil,
(insert (read-from-minibuffer "Message: " (insert (read-from-minibuffer "Message: "
(string (if (featurep 'xemacs) (string (if (featurep 'xemacs)
last-command-char last-command-char
last-command-event)) read-map)) last-command-event))
read-map))
(erc-send-current-line))) (erc-send-current-line)))
(defvar erc-action-history-list () (defvar erc-action-history-list ()
...@@ -4106,10 +4108,12 @@ E.g. \"Read error to Nick [user@some.host]: 110\" would be shortened to ...@@ -4106,10 +4108,12 @@ E.g. \"Read error to Nick [user@some.host]: 110\" would be shortened to
host (regexp-quote host)) host (regexp-quote host))
(or (when (string-match (concat "^\\(Read error\\) to " (or (when (string-match (concat "^\\(Read error\\) to "
nick "\\[" host "\\]: " nick "\\[" host "\\]: "
"\\(.+\\)$") reason) "\\(.+\\)$")
reason)
(concat (match-string 1 reason) ": " (match-string 2 reason))) (concat (match-string 1 reason) ": " (match-string 2 reason)))
(when (string-match (concat "^\\(Ping timeout\\) for " (when (string-match (concat "^\\(Ping timeout\\) for "
nick "\\[" host "\\]$") reason) nick "\\[" host "\\]$")
reason)
(match-string 1 reason)) (match-string 1 reason))
reason)) reason))
...@@ -4226,7 +4230,8 @@ See also `erc-format-nick-function'." ...@@ -4226,7 +4230,8 @@ See also `erc-format-nick-function'."
(let ((nick (erc-server-user-nickname user))) (let ((nick (erc-server-user-nickname user)))
(concat (erc-propertize (concat (erc-propertize
(erc-get-user-mode-prefix nick) (erc-get-user-mode-prefix nick)
'face 'erc-nick-prefix-face) nick))) 'face 'erc-nick-prefix-face)
nick)))
(defun erc-get-user-mode-prefix (user) (defun erc-get-user-mode-prefix (user)
(when user (when user
...@@ -4252,7 +4257,8 @@ also `erc-format-nick-function'." ...@@ -4252,7 +4257,8 @@ also `erc-format-nick-function'."
(let ((nick (erc-server-user-nickname user))) (let ((nick (erc-server-user-nickname user)))
(concat (erc-propertize (concat (erc-propertize
(erc-get-user-mode-prefix nick) (erc-get-user-mode-prefix nick)
'face 'erc-nick-prefix-face) nick)))) 'face 'erc-nick-prefix-face)
nick))))
(defun erc-format-my-nick () (defun erc-format-my-nick ()
"Return the beginning of this user's message, correctly propertized." "Return the beginning of this user's message, correctly propertized."
...@@ -4772,24 +4778,16 @@ channel." ...@@ -4772,24 +4778,16 @@ channel."
(let ((updatep t)) (let ((updatep t))
(setq name item op 'off voice 'off halfop 'off admin 'off owner 'off) (setq name item op 'off voice 'off halfop 'off admin 'off owner 'off)
(if (rassq (elt item 0) prefix) (if (rassq (elt item 0) prefix)
(cond ((= (length item) 1) (if (= (length item) 1)
(setq updatep nil)) (setq updatep nil)
((eq (elt item 0) voice-ch) (setq name (substring item 1))
(setq name (substring item 1) (setf (pcase (aref item 0)
voice 'on)) ((pred (eq voice-ch)) voice)
((eq (elt item 0) hop-ch) ((pred (eq hop-ch)) hop)
(setq name (substring item 1) ((pred (eq op-ch)) op)
halfop 'on)) ((pred (eq adm-ch)) adm)
((eq (elt item 0) op-ch) ((pred (eq own-ch)) own))
(setq name (substring item 1) 'on)))
op 'on))
((eq (elt item 0) adm-ch)
(setq name (substring item 1)
admin 'on))
((eq (elt item 0) own-ch)
(setq name (substring item 1)
owner 'on))
(t (setq name (substring item 1)))))
(when updatep (when updatep
(puthash (erc-downcase name) t (puthash (erc-downcase name) t
erc-channel-new-member-names) erc-channel-new-member-names)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment