Function: erc-cmd-IGNORE

erc-cmd-IGNORE is a byte-compiled function defined in erc.el.gz.

Signature

(erc-cmd-IGNORE &optional USER)

Documentation

Ignore USER. This should be a regexp matching nick!user@host.

If no USER argument is specified, list the contents of erc-ignore-list.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-cmd-IGNORE (&optional user)
  "Ignore USER.  This should be a regexp matching nick!user@host.
If no USER argument is specified, list the contents of `erc-ignore-list'."
  (if user
      (let ((quoted (regexp-quote user)))
        (when (and (not (string= user quoted))
                   (y-or-n-p (format "Use regexp-quoted form (%s) instead? "
                                     quoted)))
          (setq user quoted))
        (let ((timeout
               (erc--read-time-period
                "Add a timeout? (Blank for no, or a time spec like 2h): "))
              (buffer (current-buffer)))
          (when timeout
            (run-at-time timeout nil
                         (lambda ()
                           (erc--unignore-user user buffer))))
          (erc-display-line
           (erc-make-notice (format "Now ignoring %s" user))
           'active)
          (erc-with-server-buffer (add-to-list 'erc-ignore-list user))))
    (if (null (erc-with-server-buffer erc-ignore-list))
        (erc-display-line (erc-make-notice "Ignore list is empty") 'active)
      (erc-display-line (erc-make-notice "Ignore list:") 'active)
      (mapc (lambda (item)
              (erc-display-line (erc-make-notice item)
                             'active))
            (erc-with-server-buffer erc-ignore-list))))
  t)