Skip to content

Commit

Permalink
* sauron-erc: make sure the ERC hook functions evaluate to nil
Browse files Browse the repository at this point in the history
  - note, if the hooks *don't* evaluate to nil, ERC won't run potential other
    hook functions
  • Loading branch information
djcb committed Feb 16, 2012
1 parent 0d87d4a commit ba587d2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions sauron-erc.el
Expand Up @@ -92,15 +92,18 @@ The following events are erc-track

(defun sr-erc-JOIN-hook-func (proc parsed)
"JOIN hook function."
(sr-erc-hook-func proc parsed 'join))
(sr-erc-hook-func proc parsed 'join)
nil)

(defun sr-erc-QUIT-hook-func (proc parsed)
"QUIT hook function."
(sr-erc-hook-func proc parsed 'quit))
(sr-erc-hook-func proc parsed 'quit)
nil)

(defun sr-erc-PART-hook-func (proc parsed)
"PART hook function."
(sr-erc-hook-func proc parsed 'part))
(sr-erc-hook-func proc parsed 'part)
nil)

(defun sr-erc-msg-clean (msg)
"Clean IRC escaped stuff from messages."
Expand Down Expand Up @@ -131,15 +134,16 @@ The following events are erc-track
(propertize " says " 'face 'sauron-highlight1-face)
msg)
;; FIXME: assumes we open separate window
(lexical-let* ((target-mark target)
(lexical-let* ((target-mark target)
(target-buf (if for-me sender channel)))
(lambda ()
(sauron-switch-to-marker-or-buffer (or target-mark target-buf))))
`( :event privmsg
:sender ,sender
:me ,me
:target ,target
:msg ,msg))))
:msg ,msg)))
nil)

(provide 'sauron-erc)

Expand Down

0 comments on commit ba587d2

Please sign in to comment.