Function: erc-auto-query

erc-auto-query is a byte-compiled function defined in erc.el.gz.

Signature

(erc-auto-query PROC PARSED)

Documentation

Put this on erc-server-PRIVMSG-functions.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-auto-query (proc parsed)
  ;; FIXME: This needs more documentation, unless it's not a user function --
  ;; Lawrence 2004-01-08
  "Put this on `erc-server-PRIVMSG-functions'."
  (when erc-auto-query
    (let* ((nick (car (erc-parse-user (erc-response.sender parsed))))
           (target (car (erc-response.command-args parsed)))
           (msg (erc-response.contents parsed))
           (query  (if (not erc-query-on-unjoined-chan-privmsg)
                       nick
                     (if (erc-current-nick-p target)
                         nick
                       target))))
      (and (not (erc-ignored-user-p (erc-response.sender parsed)))
           (or erc-query-on-unjoined-chan-privmsg
               (string= target (erc-current-nick)))
           (not (erc-get-buffer query proc))
           (not (erc-is-message-ctcp-and-not-action-p msg))
           (let ((erc-query-display erc-auto-query))
             (erc-cmd-QUERY query))
           nil))))