Function: erc-ctcp-query-PAGE

erc-ctcp-query-PAGE is a byte-compiled function defined in erc-page.el.gz.

Signature

(erc-ctcp-query-PAGE PROC NICK LOGIN HOST TO MSG)

Documentation

Deal with an CTCP PAGE query, if erc-page-mode(var)/erc-page-mode(fun) is non-nil.

This will call erc-page-function, if defined, or it will just print a message and beep. In addition to that, the page message is also inserted into the server buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-page.el.gz
(defun erc-ctcp-query-PAGE (_proc nick login host _to msg)
  "Deal with an CTCP PAGE query, if `erc-page-mode' is non-nil.
This will call `erc-page-function', if defined, or it will just print
a message and `beep'.  In addition to that, the page message is also
inserted into the server buffer."
  (when (and erc-page-mode
	     (string-match "PAGE\\(\\s-+.*\\)?$" msg))
    (let* ((m (match-string 1 msg))
	   (page-msg (if m (erc-controls-interpret (substring m 1))
		       "[no message]"))
	   text)
      (if m (setq m (substring m 1)))
      (setq text (erc-format-message 'CTCP-PAGE
				     ?n nick ?u login
				     ?h host ?m page-msg))
      (if erc-page-function
	  (funcall erc-page-function nick page-msg)
	;; if no function is defined
	(message "%s" text)
	(beep))
      ;; insert text into buffer
      (erc-display-message
       nil 'notice nil text)))
  nil)