Function: erc-cmd-QUERY

erc-cmd-QUERY is an interactive and byte-compiled function defined in erc.el.gz.

Signature

(erc-cmd-QUERY &optional USER)

Documentation

Open a query with USER.

Display the query buffer in accordance with erc-interactive-display.

Key Bindings

Aliases

erc-cmd-Q

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-cmd-QUERY (&optional user)
  "Open a query with USER.
Display the query buffer in accordance with `erc-interactive-display'."
  ;; FIXME: The doc string used to say at the end:
  ;; "If USER is omitted, close the current query buffer if one exists
  ;; - except this is broken now ;-)"
  ;; Does it make sense to have that functionality?  What's wrong with
  ;; `kill-buffer'?  If it makes sense, re-add it.  -- SK @ 2021-11-11
  (interactive
   (list (read-string "Start a query with: ")))
  (unless user
      ;; currently broken, evil hack to display help anyway
                                        ;(erc-delete-query))))
    (signal 'wrong-number-of-arguments '(erc-cmd-QUERY 0)))
  (let ((erc-join-buffer erc-interactive-display)
        (erc--display-context `((erc-interactive-display . /QUERY)
                                ,@erc--display-context)))
    (erc-with-server-buffer
      (if-let* ((buffer (erc-get-buffer user erc-server-process)))
          (prog1 buffer
            (erc-setup-buffer buffer))
        (prog1 (erc--open-target user) ; becomes current buffer
          (erc--ensure-query-member user))))))