Variable: erc-pre-send-functions

erc-pre-send-functions is a customizable variable defined in erc.el.gz.

Value

nil

Documentation

Special hook to possibly alter the string to send and insert.

ERC calls the member functions with one argument, an erc-input struct instance to modify as needed.

The struct has five slots:

  string: String to send, originally from prompt input.
  insertp: Whether a string should be inserted in the buffer.
  sendp: Whether string should be sent to the IRC server.
  substxt: String to display (but not send) instead of string.
  refoldp: Whether to re-split string per protocol limits.

This hook runs after protocol line splitting has taken place, so the value of string comes "pre-split" according to the option erc-split-line-length. If you need ERC to refill the entire payload before sending it, set the refoldp slot to a non-nil value. Note that this refilling is only a convenience, and modules with special needs, such as preserving "preformatted" text or encoding for subprotocol "tunneling", should handle splitting manually and possibly also specify replacement text to display via the substxt slot.

This variable was added, or its default value changed, in ERC version
5.3.

Probably introduced at or before Emacs version 27.1.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defcustom erc-pre-send-functions nil
  "Special hook to possibly alter the string to send and insert.
ERC calls the member functions with one argument, an `erc-input'
struct instance to modify as needed.

The struct has five slots:

  `string': String to send, originally from prompt input.
  `insertp': Whether a string should be inserted in the buffer.
  `sendp': Whether `string' should be sent to the IRC server.
  `substxt': String to display (but not send) instead of `string'.
  `refoldp': Whether to re-split `string' per protocol limits.

This hook runs after protocol line splitting has taken place, so
the value of `string' comes \"pre-split\" according to the option
`erc-split-line-length'.  If you need ERC to refill the entire
payload before sending it, set the `refoldp' slot to a non-nil
value.  Note that this refilling is only a convenience, and
modules with special needs, such as preserving \"preformatted\"
text or encoding for subprotocol \"tunneling\", should handle
splitting manually and possibly also specify replacement text to
display via the `substxt' slot."
  :package-version '(ERC . "5.3")
  :group 'erc-hooks
  :type 'hook)