Function: erc--determine-speaker-message-format-args
erc--determine-speaker-message-format-args is a byte-compiled function
defined in erc.el.gz.
Signature
(erc--determine-speaker-message-format-args NICK MESSAGE QUERYP PRIVMSGP INPUTP &optional STATUSMSG PREFIX DISP-NICK)
Documentation
Return a list consisting of a "speaker"-template key and spec args.
Consider the three flags QUERYP, PRIVMSGP, and INPUTP, as well as the possibly null STATUSMSG string. (Combined, these describe the context of a newly arrived "PRIVMSG" or, when PRIVMSGP is nil, a "NOTICE"). Interpret QUERYP to mean that MESSAGE is directed at the ERC client itself (a direct message), and INPUTP to mean MESSAGE is an outgoing or echoed message originating from or meant to simulate prompt input. Interpret a non-nil STATUSMSG to mean MESSAGE should be formatted as a special channel message intended for privileged members of the same or greater status.
After deciding on the template key for the current "speaker"
catalog, use the remaining arguments, possibly along with
STATUSMSG, to construct the appropriate spec-args plist forming
the returned list's tail. In this plist, pair the char ?n with
NICK, the nickname of the speaker and ?m with MESSAGE, the
message body. When non-nil, assume DISP-NICK to be a possibly
phony display name to take the place of NICK for ?n. When PREFIX
is non-nil, look up NICK's channel-membership status, possibly
using PREFIX itself if it's an erc-channel-user object, which
it must be when called outside of a channel buffer. Pair the
result with the ?p specifier. When STATUSMSG is non-nil, pair it
with the ?s specifier. Ensure unused spec values are the empty
string rather than nil.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--determine-speaker-message-format-args
(nick message queryp privmsgp inputp &optional statusmsg prefix disp-nick)
"Return a list consisting of a \"speaker\"-template key and spec args.
Consider the three flags QUERYP, PRIVMSGP, and INPUTP, as well as
the possibly null STATUSMSG string. (Combined, these describe
the context of a newly arrived \"PRIVMSG\" or, when PRIVMSGP is
nil, a \"NOTICE\"). Interpret QUERYP to mean that MESSAGE is
directed at the ERC client itself (a direct message), and INPUTP
to mean MESSAGE is an outgoing or echoed message originating from
or meant to simulate prompt input. Interpret a non-nil STATUSMSG
to mean MESSAGE should be formatted as a special channel message
intended for privileged members of the same or greater status.
After deciding on the template key for the current \"speaker\"
catalog, use the remaining arguments, possibly along with
STATUSMSG, to construct the appropriate spec-args plist forming
the returned list's tail. In this plist, pair the char ?n with
NICK, the nickname of the speaker and ?m with MESSAGE, the
message body. When non-nil, assume DISP-NICK to be a possibly
phony display name to take the place of NICK for ?n. When PREFIX
is non-nil, look up NICK's channel-membership status, possibly
using PREFIX itself if it's an `erc-channel-user' object, which
it must be when called outside of a channel buffer. Pair the
result with the ?p specifier. When STATUSMSG is non-nil, pair it
with the ?s specifier. Ensure unused spec values are the empty
string rather than nil."
(when prefix
(setq prefix (erc-get-channel-membership-prefix
(if (erc-channel-user-p prefix) prefix nick))))
(when (and queryp erc--target erc-format-query-as-channel-p
(not (erc--target-channel-p erc--target)))
(setq queryp nil))
(list (cond (statusmsg (if inputp 'statusmsg-input 'statusmsg))
(privmsgp (if queryp
(if inputp 'input-query-privmsg 'query-privmsg)
(if inputp 'input-chan-privmsg 'chan-privmsg)))
(t (if queryp
(if inputp 'input-query-notice 'query-notice)
(if inputp 'input-chan-notice 'chan-notice))))
?p (or prefix "") ?n (erc--speakerize-nick nick disp-nick)
?s (or statusmsg "") ?m message))