Skip to content

Instantly share code, notes, and snippets.

@ivey
Created October 3, 2010 12:52
Show Gist options
  • Save ivey/608556 to your computer and use it in GitHub Desktop.
Save ivey/608556 to your computer and use it in GitHub Desktop.
(defun erc-cmd-UNTRACK (&optional target)
"Add TARGET to the list of target to be tracked."
(if target
(erc-with-server-buffer
(let ((untracked (car (erc-member-ignore-case target erc-track-exclude))))
(if untracked
(erc-display-line
(erc-make-notice (format "%s is not currently tracked!" target))
'active)
(add-to-list 'erc-track-exclude target)
(erc-display-line
(erc-make-notice (format "Now not tracking %s" target))
'active))))
(if (null erc-track-exclude)
(erc-display-line (erc-make-notice "Untracked targets list is empty") 'active)
(erc-display-line (erc-make-notice "Untracked targets list:") 'active)
(mapc #'(lambda (item)
(erc-display-line (erc-make-notice item) 'active))
(erc-with-server-buffer erc-track-exclude))))
t)
(defun erc-cmd-TRACK (target)
"Remove TARGET of the list of targets which they should not be tracked.
If no TARGET argument is specified, list the contents of `erc-track-exclude'."
(when target
(erc-with-server-buffer
(let ((tracked (not (car (erc-member-ignore-case target erc-track-exclude)))))
(if tracked
(erc-display-line
(erc-make-notice (format "%s is currently tracked!" target))
'active)
(setq erc-track-exclude (remove target erc-track-exclude))
(erc-display-line
(erc-make-notice (format "Now tracking %s" target))
'active)))))
t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment